-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserControl1.xaml
45 lines (44 loc) · 2.53 KB
/
UserControl1.xaml
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
<UserControl
x:Class="MemoryLeakTest.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MemoryLeakTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
mc:Ignorable="d">
<Grid Background="#404040" Width="400" Height="400">
<controls:DataGrid ItemsSource="{x:Bind _someData, Mode=OneWay}"
SelectionChanged="ItemListDataGrid_OnSelectionChanged"
IsTabStop="False"
HorizontalAlignment="Center"
AutoGenerateColumns="False"
>
<controls:DataGrid.Columns>
<controls:DataGridTemplateColumn Header="Test" Width="75" Tag="checked">
<controls:DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="local:SomeItem">
<Grid Width="20" IsTabStop="False">
<CheckBox VerticalAlignment="Center" IsTabStop="False" HorizontalAlignment="Left" IsChecked="{x:Bind Value3, Mode=TwoWay}"/>
</Grid>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
<controls:DataGridTemplateColumn Header="Test" Width="*" Tag="name">
<controls:DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="local:SomeItem">
<TextBlock VerticalAlignment="Center" Margin="10,0,0,0" Text="{x:Bind Value2}"/>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
<controls:DataGridTemplateColumn Header="Test" Tag="value">
<controls:DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="local:SomeItem">
<TextBlock VerticalAlignment="Center" Margin="10,0,10,0" Text="{x:Bind Value2}"/>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
</controls:DataGrid.Columns>
</controls:DataGrid>
</Grid>
</UserControl>