Browse by Tags
All Tags »
WPF (
RSS)
Finally, the last post of the series :) Initial posts - WPF Popups and ToolTip behavior - A Journey WPF Popups and ToolTip Behavior – Implementation Attached is my final solution with a working example. Usage <Control> <controls:RichToolTip.PopupContent> <RichToolTip> <TextBlock Text="This will be displayed in the popup" /> </RichToolTip> </controls:RichToolTip.PopupContent> </Control> Dependency Properties: (Popup Placement Related) Placement PlacementTarget...
In continuation to my first post - WPF Popups and ToolTip behavior - A Journey I decided to approach the implementation of such a popup like the ToolTip and ContextMenu are doing it themselves. I did not inherit from Popup but rather created my own control and I used the Popup.CreateRootPopup which sets the Popup.Child property to my control and it picks up on all the ToolTipService properties defined on my control. I started from reading the following post: Popup your control There were some problems...
I am currently working on a WPF project which I needed a ToolTip with a certain behavior: It should act like a ToolTip Support content template Appear upon hovering with a small interval Appear once - hovering another element with a tooltip should hide the last shown tooltip. Support Rich Content The latter is marked as bold since that was the essential requirement that made me not use the ordinary WPF ToolTip. I needed the ToolTip to hold rich content - such as clickable buttons. This also implicates...
A very nice extension built for WPF, Read the full details Here . E.g. - < Polyline Points ="{ln:PyBinding PointCollection([Point(p.Time, p.Value * $(Container.ActualHeight) ) for p in $(.MarketData.DataPoints) ])}" Stroke ="IndianRed" StrokeThickness ="1" /> Very cool!
There are times in which you would have code that does some runtime work that will cause the designer to fail loading the WPF content and display the error. At such times, you might want to tweak your code to support this need. Let's look at the following example for a converter: public class TemplatePickEnabledConverter : IMultiValueConverter { public object Convert( object [] values, Type targetType, object parameter, System.Globalization. CultureInfo culture) { int id = ( int )values[0]; ...
Make sure you check the latest source and bits of: WPF Toolkit DataGrid v1 DatePicker/Calendar v1 Visual State Manager Preview Ribbon Preview Silverlight Toolkit AutoCompleteBox NumericUpDown Viewbox Expander ImplicitStyleManager Charting TreeView DockPanel WrapPanel Label HeaderedContentControl HeaderedItemsControl Themes - Expression Dark / Light | Rainier Purple / Orange | Shiny Blue / Red
Via this post . "This document covers the design and some implementation details of getting WPF windows wrapped in custom chrome. Currently WPF supports standard windows, with an icon, title-text, and caption buttons, as well as borderless windows, which when combined with transparency allow arbitrary top-level shapes but the application loses system support for behaviors associated with having a standard caption area, such as maximize. There is a desire to create applications that fill a middle...
Via this post . I won't elaborate so much about it, do read Lester's post in the link above. The new feature introduces useful and simple usage to control string formatting in binding statements. No need to use converter everywhere :) A good thing! < TextBox Text = " {Binding Path=Double, StringFormat=F3 } " />
Via this post from WiredPrairie blog. The post holds links that explain approaches for extending the binding extensions. Extending "Binding" or "BindingBase" is pretty tacky, this is due to the fact that BindingBase.ProvideValue is sealed. The posts illustrate an elegant approach for wrapping it up and creating your own MarkUp extension to provide you with the functionality you desire.
A pretty common animation when dealing with WPF is the transition of an element from layout to layout. Take the following scenario : Let's say I got a window with a form-like view. The form has a rich textbox where the user can enter lots of content. In this case, I would like to give the user the possibility to expand that textbox if he needs to edit it in a more convenient way. So I go and add an expand button, when clicked I add the textbox as a child to a grid that is placed on the entire...
I got around building a decent amount of controls that derived from ListBox. The default template of a ListBoxItem contains default style for the selection triggered by various triggers. If you wish to control the colors, you can adjust it by the following : <ListBox.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" /> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black"...