Repository navigation
Expand file tree
/
Copy pathSegmentedExample.xaml
More file actions
113 lines (103 loc) · 4.5 KB
/
Copy pathSegmentedExample.xaml
File metadata and controls
113 lines (103 loc) · 4.5 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<UserControl
x:Class="WPFDevelopers.Samples.ExampleViews.SegmentedExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<controls:CodeViewer Header="{Binding NavigateMenuItem.Name}">
<StackPanel
Margin="20"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Orientation="Horizontal">
<StackPanel wd:PanelHelper.Spacing="10" Orientation="Vertical">
<TextBlock
FontSize="14"
FontWeight="Bold"
Text="横向 (Horizontal)" />
<TextBlock
Margin="0,10,0,0"
FontSize="12"
Foreground="Gray"
Text="XAML 模式:" />
<wd:Segmented
x:Name="HorizontalXAMLSegmented"
Width="300"
Height="60"
Padding="6"
ItemClick="Segmented_ItemClick"
SelectedIndex="0">
<wd:SegmentedItem Content="Large" />
<wd:SegmentedItem Content="Medium" />
<wd:SegmentedItem Content="Small" />
</wd:Segmented>
<wd:Segmented Width="300" SelectedIndex="0">
<wd:SegmentedItem>
<StackPanel>
<wd:PathIcon Kind="Home" />
<TextBlock Text="Home" />
</StackPanel>
</wd:SegmentedItem>
<wd:SegmentedItem>
<StackPanel>
<wd:PathIcon Kind="Friend" />
<TextBlock Text="Friend" />
</StackPanel>
</wd:SegmentedItem>
<wd:SegmentedItem>
<StackPanel>
<wd:PathIcon Kind="Star" />
<TextBlock Text="Star" />
</StackPanel>
</wd:SegmentedItem>
</wd:Segmented>
<TextBlock>
<Run Text="选中索引:" />
</TextBlock>
<TextBlock
Margin="0,20,0,0"
FontSize="12"
Text="MVVM 模式:" />
<wd:Segmented
x:Name="HorizontalMVVMSegmented"
Width="300"
wd:ElementHelper.CornerRadius="15"
DisplayMemberPath="Name"
ItemClickCommand="{Binding ItemClickCommand}"
ItemsSource="{Binding Options}"
SelectedIndex="{Binding SelectedOptionIndex, Mode=TwoWay}" />
</StackPanel>
<Rectangle
Width="1"
Margin="40,0"
Fill="LightGray" />
<StackPanel wd:PanelHelper.Spacing="10" Orientation="Vertical">
<TextBlock
FontSize="14"
FontWeight="Bold"
Text="竖向 (Vertical)" />
<wd:Segmented
x:Name="VerticalXAMLSegmented"
Height="200"
Margin="0,10,0,0"
ItemClick="Segmented_ItemClick"
Orientation="Vertical"
SelectedIndex="0">
<wd:SegmentedItem Content="Option A" />
<wd:SegmentedItem Content="Option B" />
<wd:SegmentedItem Content="Option C" />
<wd:SegmentedItem Content="Option D" />
</wd:Segmented>
</StackPanel>
</StackPanel>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SegmentedExample.xaml" CodeType="Xaml" />
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SegmentedExample.xaml.cs" CodeType="CSharp" />
</controls:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>