datatrigger

What is the replacement for DataTrigger in Silverlight

This is my scenario. I have 2 Properties. Type and State. Type is an Enum with 3 values eg, ball, car, arrow. State is an int which would accept 3 state values eg., -1, 0, 1. Also, I have 9 images for each state values. Like, if I select type as ball and value as -1, I want to display a Red color ball. If I select type as arrow and va...

How to set the default value of DateTime to empty string?

I have a property called Raised_Time, this property shows the time at which alarm is raised in datagrid Cell. I don't want to show anything in the datagrid cell when user creates any alarm, it just display the empty cell. I googled in the internet and found that the default value of DateTime can be set using DateTime.MinValue and this w...

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...

setting text on DataGridTextColumn

I am using a DataTrigger to replace empty cells with '-' text. My code: <DataGridTextColumn Header="Time taken" Binding="{Binding Path=finish}" Width="Auto" x:Name="x"> <DataGridTextColumn.ElementStyle> <Style TargetType="{x:Type TextBlock}"> <Style.Triggers> <DataTrigger Binding="{Bindi...

Specifying the data context in XAML stops the data trigger from working

I have a DataTrigger setup like so: <UserControl.Resources> <Style x:Key="resultTypeStyle"> <Style.Triggers> <DataTrigger Binding="{Binding Result, Path=Result.Type}" Value="Confirmation"> <Setter Property="Control.Visibility" Value="Collapsed" /> </DataTrigger> </Style.Trigger...

Using binding for the Value property of DataTrigger condition

hi , I have the same problem that already been asked here: http://stackoverflow.com/questions/2240421/using-binding-for-the-value-property-of-datatrigger-condition it been answered but I don't understand the solution, can someone explain it to me? ...

MultiDataTrigger with value range

I have several conditions that need to be met in order to allow a user to edit the details of the selected item. the conditions are: if the item is active they are allowed to edit it regardless of security level. No problem there. if the item is inactive: users above security level 50 can edit it users below security level 50 can only...

DataTrigger doesn't enter to the Converter

this is the xaml: <Window x:Class="WpfApplication4.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:local="clr-namespace:WpfApplication4" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <Grid.RowDefinitions> <RowDefinition /> ...

How can one link a DataTrigger to whether a ScrollViewer can scroll up?

I am wanting to show a half opaque arrow at the top and bottom of my ScrollViewer if it can scroll up or down respectively. I'm thinking the best option is a DataTrigger, but I'm not sure what I can tie it too. I'm trying to avoid subclassing ScrollViewer, but if I absolutely have to, I will. Any ideas? I'm using the .Net Framework 3...

Can I access a named fill gradient in a WPF Datatemplate?

I have a DataTemplate with a number of layered text and graphic objects. One of them is a glow effect that comes from the RadialGradientBrush Fill property of a Rectangle. At first, I named the Rectangle and bound to the Fill property and changed it using a DataTrigger. This worked fine, but I have a number of RadialGradientBrush objects...