Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create this trigger
Message
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
How to create this trigger
Divers
Thread ID:
01474336
Message ID:
01474336
Vues:
93
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform