datatriggers

Bind FontWeight to a Boolean in Silverlight

Silverlight does not feature DataTriggers, so in this case... what might be the best way to conditionally set the fontweight of an item to a boolean? For example... the following is not possible in Silverlight. <TextBlock Text="{Binding Text}"> <TextBlock.Triggers> <DataTrigger Binding="{Binding IsDefault}" Value="True"> ...

WPF DataTrigger not firing outside of ItemsControl

I have a Custom UserControl that extends the button control and adds two new dependency properites IsActive and Icon. In the control there are DataTriggers that set the Icon and the Active state based on the value. The issue I am having is that the control only working inside of an ItemControl. Here is the XAML portion of the contro...

Change Rectangle Fill Based on ColumnWidth of a grid

Essentially i want to do as the title says, if the columnwidth is .50 then the rectangle should be red, if it's .75 then it should be amber, and if it's 1 then it should be green. I thought I could achieve this with DataTriggers but for some reason I am getting "Object Reference Not Set To An Instance Of An Object" error, here is my cod...

WPF : Conditional templating of textblock

I have a bunch of textblocks in an itemscontrol... I need to know how can I underline the text in the textblock based on whether the text is available in a list in the data model.. Sounds very simple to me...but I have been googling since the past 8 hrs... Can I use datatriggers and valueconverters for this purpose? If yes, then how ca...

WPF Multiple DataTriggers targeting the same property with Animation

I have created a UserControl which is basically an Ellipse with a DependencyProperty called ValueH. The Fill property of the Ellipse is based on ValueH. So for example if ValueH=1 Fill=Red, ValueH=2 Fill=Blue, ValueH=3 Fill=Green and so on. I have also declared storyboards so that when the value of ValueH changes, a ColorAnimation is run...