Autor Beitrag
new.Matrix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Do 24.04.08 09:32 
Hallo Zusammen,

Ich habe ne abgeleitete ComboBoxItem Klasse, die ich nun in XAML verwenden möchte und deren neu inzugeüfgten Eigenschaft.
Hier die Klasse:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
    public class ColoredComboBoxItem : ComboBoxItem
    {
        public bool Visited
        {
            get { return (bool)GetValue(VisitedProperty); }
            set { SetValue(VisitedProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Visited.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty VisitedProperty =
               DependencyProperty.Register("Visited"typeof(bool), typeof(ColoredComboBoxItem), new UIPropertyMetadata(false));
    }


Wie kann ich nun in XAML meiner ComboBox sagen, dass er die ColoredComboBoxItem als Items nehmen soll?


Zuletzt bearbeitet von new.Matrix am Sa 31.05.08 08:59, insgesamt 1-mal bearbeitet
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Do 24.04.08 13:01 
Dazu musst du ComboBox.GetContainerForItemOverride überschreiben.
new.Matrix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Do 24.04.08 14:51 
Ok besten Dank, werdes mal ausprobieren...