Search Results

Search found 4 results on 1 pages for 'hayrob'.

Page 1/1 | 1 

  • Force ListViewItem Background colour to change when bound item it is bound to changes.

    - by hayrob
    My ItemContainerStyle works perfectly when a ListViewItem is added: <Style x:Key="ItemContStyle" TargetType="{x:Type ListViewItem}"> <Style.Resources> <SolidColorBrush x:Key="lossBrush" Color="Red" /> <SolidColorBrush x:Key="newPartNo" Color="LightGreen" /> <SolidColorBrush x:Key="noSupplier" Color="Yellow" /> <Orders:OrderItemStatusConverter x:Key="OrderItemConverter" /> </Style.Resources> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=DataContext, Converter={StaticResource OrderItemConverter}}" Value="-1"> <Setter Property="Background" Value="{StaticResource lossBrush}" /> </DataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext, Converter={StaticResource OrderItemConverter}}" Value="-2"> <Setter Property="Background" Value="{StaticResource newPartNo}" /> </DataTrigger> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=DataContext, Converter={StaticResource OrderItemConverter}}" Value="-3"> <Setter Property="Background" Value="{StaticResource noSupplier}" /> </DataTrigger> </Style.Triggers> </Style> However when the source item changes, the trigger is not fired and the background colour is not what I expect. How can I make the trigger fire?

    Read the article

  • Using ToArgb() followed by FromArgb() does not result in the original color

    - by hayrob
    This does not work int blueInt = Color.Blue.ToArgb(); Color fred = Color.FromArgb(blueInt); Assert.AreEqual(Color.Blue,fred); Any suggestions? [Edit] I'm using NUnit and the output is failed: Expected: Color [Blue] But was: Color [A=255, R=0, G=0, B=255] [Edit] This works! int blueInt = Color.Blue.ToArgb(); Color fred = Color.FromArgb(blueInt); Assert.AreEqual(Color.Blue.ToArgb(),fred.ToArgb());

    Read the article

1