2009-08-12 8 views
4

Comment puis-je effectuer les opérations suivantes via C# (comme je générer listviews programatically):Définition des ressources WPF en C#

<ListView> 
    <ListView.Resources> 
     <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/> 
     <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/> 
    </ListView.Resources> 
... 

Répondre

2

Je suis encore à apprendre à WPF, mais vous pouvez essayer ceci:

ListView view = new ListView(); 
    view.Resources.Add(SystemColors.HighlightBrushKey, new SolidColorBrush(Colors.Transparent)); 
    view.Resources.Add(SystemColors.ControlBrushKey, new SolidColorBrush(Colors.Transparent)); 
Questions connexes