-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathSelectorExample.xaml
More file actions
75 lines (74 loc) · 3.95 KB
/
SelectorExample.xaml
File metadata and controls
75 lines (74 loc) · 3.95 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
<UserControl x:Class="WPFDevelopers.Samples.ExampleViews.SelectorExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
xmlns:vm="clr-namespace:WPFDevelopers.Samples.ViewModels"
xmlns:model="clr-namespace:WPFDevelopers.Sample.Models"
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<controls:CodeViewer Header="{Binding NavigateMenuItem.Name}">
<Grid Margin="4">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,4"
HorizontalAlignment="Center">
<TextBox wd:ElementHelper.Watermark="输入数字0~199"
x:Name="MyTextBox"/>
<Button
Style="{StaticResource WD.DangerPrimaryButton}"
Content="定位行"
Click="Button_Click"
Margin="4,0"/>
</StackPanel>
<UniformGrid Rows="2" Columns="2" Grid.Row="1">
<DataGrid ItemsSource="{Binding ListArrays,RelativeSource={RelativeSource AncestorType=UserControl}}"
SelectedItem="{Binding SelectItem,RelativeSource={RelativeSource AncestorType=UserControl}}"
wd:ScrollIntoView.IsPosition="true"
Margin="4" IsReadOnly="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" />
<DataGridTextColumn Header="Date" Binding="{Binding Date}" Width="Auto"/>
</DataGrid.Columns>
</DataGrid>
<ListBox ItemsSource="{Binding ListArrays,RelativeSource={RelativeSource AncestorType=UserControl}}"
SelectedItem="{Binding SelectItem,RelativeSource={RelativeSource AncestorType=UserControl}}"
wd:ScrollIntoView.IsPosition="true"
Margin="4">
<ListBox.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2">
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding Date}"/>
</UniformGrid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListView ItemsSource="{Binding ListArrays,RelativeSource={RelativeSource AncestorType=UserControl}}"
SelectedItem="{Binding SelectItem,RelativeSource={RelativeSource AncestorType=UserControl}}"
wd:ScrollIntoView.IsPosition="true"
Margin="4">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" />
<GridViewColumn Header="Date" DisplayMemberBinding="{Binding Date}" />
</GridView>
</ListView.View>
</ListView>
</UniformGrid>
</Grid>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SelectorExample.xaml"
CodeType="Xaml"/>
<controls:SourceCodeModel
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SelectorExample.xaml.cs"
CodeType="CSharp"/>
</controls:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>