Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create this trigger
Message
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
How to create this trigger
Miscellaneous
Thread ID:
01474336
Message ID:
01474336
Views:
91
I have a collection of classes together in a tree. The whole collection is bound to a TreeView. One of the classes has a bool property on called IsChanged:
public class ReportColumn
{
    public string ColumnName { get; set; }
    public object OriginalValue { get; set; }
    public object ChangedValue { get; set; }
    public bool IsChanged { get; set; }
}
In my XAML I created a DataTemplate for it:
<DataTemplate DataType="{x:Type local:ReportColumn}"
    <StackPanel Orientation="Horizontal"

        <!-- Column Name --
        <TextBlock Margin="0,0,5,0" 
                    FontWeight="Bold"Name:</TextBlock
        <TextBlock Text="{Binding Path=ColumnName}"</TextBlock

        <!-- Original Value --
        <TextBlock Margin="20,0,5,0" 
                    FontWeight="Bold"Original:</TextBlock
        <TextBlock Text="{Binding Path=OriginalValue}"</TextBlock

        <!-- Changed Value --
        <TextBlock Margin="20,0,5,0" 
                    FontWeight="Bold"Change:</TextBlock
        <TextBlock Text="{Binding Path=ChangedValue}"</TextBlock

    </StackPanel
</DataTemplate
Then the whole thing is bound to the treeview. What I'd like is to make this node's foreground red when IsChanged is true. Can someone explain how to do this?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform