aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml
blob: 1cf4479d7104c1a9ef7a405175e3ec7fa2cec7af (plain)
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
<Window x:Class="Tango.UITests.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Tango.UITests"
        xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
        xmlns:components="clr-namespace:Tango.Touch.Components;assembly=Tango.Touch"
        xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
		xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
        xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
        mc:Ignorable="d"
        Title="MainWindow" Height="1000" Width="800" DataContext="{Binding RelativeSource={RelativeSource Self}}" Background="{StaticResource TangoMidBackgroundBrush}">

    <Grid>

        <Button HorizontalAlignment="Left" VerticalAlignment="Top" Click="Button_Click_1">ADD</Button>
        
        <touch:LightTouchDataGrid ItemsSource="{Binding Persons}" Margin="50" OnDragAndDropCommand="{Binding DropCommand}">
            <touch:LightTouchDataGrid.Columns>
                <touch:LightTouchDataGridColumn SortMember="FirstName" Header="FIRST NAME">
                    <touch:LightTouchDataGridColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding FirstName}"></TextBlock>
                        </DataTemplate>
                    </touch:LightTouchDataGridColumn.CellTemplate>
                </touch:LightTouchDataGridColumn>

                <touch:LightTouchDataGridColumn>
                    <touch:LightTouchDataGridColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="LAST NAME"></TextBlock>
                        </DataTemplate>
                    </touch:LightTouchDataGridColumn.HeaderTemplate>
                    <touch:LightTouchDataGridColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding LastName}"></TextBlock>
                        </DataTemplate>
                    </touch:LightTouchDataGridColumn.CellTemplate>
                </touch:LightTouchDataGridColumn>

                <touch:LightTouchDataGridColumn>
                    <touch:LightTouchDataGridColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="AGE"></TextBlock>
                        </DataTemplate>
                    </touch:LightTouchDataGridColumn.HeaderTemplate>
                    <touch:LightTouchDataGridColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Age}"></TextBlock>
                        </DataTemplate>
                    </touch:LightTouchDataGridColumn.CellTemplate>
                </touch:LightTouchDataGridColumn>

                <touch:LightTouchDataGridColumn SortMember="Index" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" DisplayChevron="False">
                    <touch:LightTouchDataGridColumn.HeaderTemplate>
                        <DataTemplate>
                            <Border CornerRadius="0 5 5 0">
                                <Border.Style>
                                    <Style TargetType="Border">
                                        <Setter Property="Opacity" Value="0.0"></Setter>
                                        <Setter Property="Background" Value="Black"></Setter>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding SortDirection}" Value="Ascending">
                                                <Setter Property="Opacity" Value="0.2"></Setter>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding SortDirection}" Value="Descending">
                                                <Setter Property="Opacity" Value="0.5"></Setter>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Border.Style>
                            </Border>
                        </DataTemplate>
                    </touch:LightTouchDataGridColumn.HeaderTemplate>
                    <touch:LightTouchDataGridColumn.CellTemplate>
                        <DataTemplate>
                            <dragAndDrop:DragThumb Background="Transparent" components:Ripple.PreventRipple="True">
                                <TextBlock IsHitTestVisible="False" Text="{Binding Index}"></TextBlock>
                            </dragAndDrop:DragThumb>
                        </DataTemplate>
                    </touch:LightTouchDataGridColumn.CellTemplate>
                </touch:LightTouchDataGridColumn>
            </touch:LightTouchDataGrid.Columns>
        </touch:LightTouchDataGrid>
    </Grid>
</Window>