Yesterday, I had a problem where I need to hook up an event to a certain data condition. I first thought about EventTrigger. However, it does the other way around. This class is responsible for convert event into trigger. So I digged around WPF architecture to see what I can do and bingo. I found that I can create an attached property with the following construct and then in XAML, you can register for this event by <TextBox Text="Try me"> <TextBox.Style> <Style TargetType="{x:Type ......
Andrew Flick announced that Infragistics WPF Express Edition will be free as well. Before this release, xamDataGrid suffered a lot of performance problem. It seems that they have fixed various performance problem. So I think I will give it a try again later. To try it out visit http://blogs.infragistics.com/blogs/andrew_flick/archive/2007/09/13/infragistics-netadvantage-for-wpf-express-aka-free-grid.aspx for more information.
Sometimes, you would like to get a combobox where a user can type. This can be done by turning on IsEditable property to true. However, it opens another can of worm, it means the user can type anything in the combobox even text that is not in the ItemsSource. To provide LimitToList feature, you can hook up an event to PreviewLostKeyboardFocus as follows: private void ComboBox_PreviewLostKeyboar... sender, KeyboardFocusChangedEventArgs e) { if (!e.Handled) { TextBox textBox = e.OldFocus ......
I posted in MSDN Forum a while ago that I ran into a WPF bug that occurs when you put one template inside another template like <ListBox HorizontalContentAlignment=... VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="Honeydew" ItemsSource="{Binding}"> <ListBox.ItemTemplate> <DataTemplate> <ListBox ItemsSource="{Binding}"> <ListBox.ItemTemplate> <DataTemplate> <etc.............. </DataTemplate> </ListBox.ItemTemplate> </ListBox> ......