-
-
Notifications
You must be signed in to change notification settings - Fork 962
Expand file tree
/
Copy pathComboBoxPage.xaml
More file actions
77 lines (73 loc) · 3.34 KB
/
ComboBoxPage.xaml
File metadata and controls
77 lines (73 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<Page
x:Class="Wpf.Ui.Gallery.Views.Pages.BasicInput.ComboBoxPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Wpf.Ui.Gallery.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf.Ui.Gallery.Views.Pages.BasicInput"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="ComboBoxPage"
d:DataContext="{d:DesignInstance local:ComboBoxPage,
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignWidth="800"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">
<StackPanel Margin="0,0,0,24">
<controls:ControlExample
Margin="0"
HeaderText="A ComboBox with items defined inline."
XamlCode="<ComboBox />">
<ComboBox
MinWidth="200"
HorizontalAlignment="Left"
SelectedIndex="0">
<ComboBoxItem Content="Blue" />
<ComboBoxItem Content="Green" />
<ComboBoxItem Content="Red" />
<ComboBoxItem Content="Yellow" />
</ComboBox>
</controls:ControlExample>
<controls:ControlExample
Margin="0,32,0,0"
HeaderText="A ComboBox with ItemsSource set."
XamlCode="<ComboBox ItemsSource="{Binding FontFamilies}" />">
<ComboBox
MinWidth="200"
HorizontalAlignment="Left"
ItemsSource="{Binding ViewModel.ComboBoxFontFamilies, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ComboBoxPage}, Mode=OneWay}"
SelectedIndex="0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock FontFamily="{Binding}" Text="{Binding}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</controls:ControlExample>
<controls:ControlExample
Margin="0,32,0,0"
HeaderText="An editable ComboBox."
XamlCode="<ComboBox IsEditable="True" />">
<ComboBox
MinWidth="200"
HorizontalAlignment="Left"
IsEditable="True"
ItemsSource="{Binding ViewModel.ComboBoxFontSizes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ComboBoxPage}, Mode=OneWay}"
SelectedIndex="0" />
</controls:ControlExample>
<controls:ControlExample
Margin="0,32,0,0"
HeaderText="A ComboBox with a placeholder."
XamlCode="<ComboBox ui:ComboBoxHelper.Placeholder="Placeholder text" />">
<ComboBox
MinWidth="200"
HorizontalAlignment="Left"
ui:ComboBoxHelper.Placeholder="Placeholder text"
IsEnabled="False" />
</controls:ControlExample>
</StackPanel>
</Page>