File tree Expand file tree Collapse file tree
src/MahApps.Metro.Samples/MahApps.Metro.Demo Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 <mah : MetroHeader Header =" Text" >
4444 <TextBox Text =" {Binding ElementName=mscb_Example, Path=Text}" />
4545 </mah : MetroHeader >
46+ <mah : MetroHeader Header =" Separator" >
47+ <TextBox Text =" {Binding ElementName=mscb_Example, Path=Separator}" />
48+ </mah : MetroHeader >
4649 <mah : MetroHeader Header =" IsEditable" >
4750 <mah : ToggleSwitch IsOn =" {Binding ElementName=mscb_Example, Path=IsEditable}" />
4851 </mah : MetroHeader >
7780 <mah : MetroHeader Header =" OrderSelectedItemsBy" >
7881 <ComboBox SelectedItem =" {Binding ElementName=mscb_Example, Path=OrderSelectedItemsBy}" ItemsSource =" {Binding Source={StaticResource Demo.Enums.OrderSelectedItemsBy}}" />
7982 </mah : MetroHeader >
83+
84+ <mah : MetroHeader Header =" DisplayMemberPath" >
85+ <ComboBox SelectedItem =" {Binding ElementName=mscb_Example, Path=DisplayMemberPath}" mah:TextBoxHelper.ClearTextButton=" True" >
86+ <system : String >Title</system : String >
87+ <system : String >Artist</system : String >
88+ <system : String >Genre</system : String >
89+ </ComboBox >
90+ </mah : MetroHeader >
8091 </StackPanel >
8192 </GroupBox >
8293 </StackPanel >
91102 <mah : MultiSelectionComboBox x : Name =" mscb_Example"
92103 Margin =" 5"
93104 VerticalAlignment =" Center"
105+ Separator =" , "
94106 SelectedItemsTemplate =" {DynamicResource MahApps.DataTemplates.MultiSelectionComboBox.Removeable}"
95- DisplayMemberPath = " Genre "
107+ TextWrapping = " Wrap "
96108 ItemsSource =" {Binding Albums}" />
97109 </Grid >
98110 </GroupBox >
Original file line number Diff line number Diff line change 55using System ;
66using System . Collections . Generic ;
77using System . ComponentModel ;
8+ using System . Globalization ;
89using System . Linq ;
910using MetroDemo . Core ;
1011
@@ -73,6 +74,12 @@ public virtual Artist Artist
7374 get => this . _artist ;
7475 set => this . Set ( ref this . _artist , value ) ;
7576 }
77+
78+ public override string ToString ( )
79+ {
80+ return $ "{ Artist } : { Title } ({ Price . ToString ( "C" ) } )";
81+ }
82+
7683 }
7784
7885 public static class SampleData
Original file line number Diff line number Diff line change @@ -30,5 +30,10 @@ public List<Album> Albums
3030 get => this . _albums ;
3131 set => this . Set ( ref this . _albums , value ) ;
3232 }
33+
34+ public override string ToString ( )
35+ {
36+ return Name ;
37+ }
3338 }
3439}
Original file line number Diff line number Diff line change @@ -37,5 +37,10 @@ public List<Album> Albums
3737 get => this . _albums ;
3838 set => this . Set ( ref this . _albums , value ) ;
3939 }
40+
41+ public override string ToString ( )
42+ {
43+ return Name ;
44+ }
4045 }
4146}
You can’t perform that action at this time.
0 commit comments