-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBindingsOverview.axaml
81 lines (76 loc) · 4.01 KB
/
BindingsOverview.axaml
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
<UserControl xmlns="https://github.com/avaloniaui"
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:vm="clr-namespace:TouchGestures.UX.ViewModels"
xmlns:views="clr-namespace:TouchGestures.UX.Views"
xmlns:gestures-views="clr-namespace:TouchGestures.UX.Views.Gestures"
xmlns:containers="clr-namespace:TouchGestures.UX.Controls.Containers"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="vm:BindingsOverviewViewModel"
x:Class="TouchGestures.UX.Views.BindingsOverview">
<!-- Currently, applying a background from here cause a wall of a stacktrace to appear -->
<!--<Design.PreviewWith>
<views:BindingsOverview Background="{StaticResource BodyColorBrush}" />
</Design.PreviewWith>-->
<Design.DataContext>
<vm:BindingsOverviewViewModel />
</Design.DataContext>
<UserControl.Styles>
<Style Selector="Button#VIEW_Adder">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="9,11,12,12" />
<Setter Property="IsEnabled" Value="{Binding IsConnected}" />
</Style>
<Style Selector="Button#VIEW_Adder:disabled > ContentPresenter">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="TextBox#VIEW_SearchBar">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{StaticResource InputBorderColorBrush}" />
<Setter Property="Margin" Value="4, 0" />
</Style>
<Style Selector="#VIEW_Body > ContentPresenter">
<Setter Property="Margin" Value="0, 0, 0, 16" />
</Style>
<Style Selector="#VIEW_Body > ContentPresenter:nth-last-child(1)">
<Setter Property="Margin" Value="0, 0, 0, 0" />
</Style>
</UserControl.Styles>
<ContentControl Content="{Binding NextViewModel}">
<ContentControl.DataTemplates>
<DataTemplate DataType="vm:BindingsOverviewViewModel">
<Grid RowDefinitions="Auto, *, Auto">
<Grid Name="VIEW_Header" ColumnDefinitions="Auto, *, Auto" Grid.Row="0" Margin="0, 32">
<Button Name="VIEW_Adder" Command="{Binding StartSetupWizardCommand}" Grid.Column="0" ToolTip.Tip="Setup a new gesture">
<Grid>
<Image Source="/Assets/Icons/Add.png" Margin="1, 1, 0, 0" IsVisible="{Binding IsConnected}" />
<Image Source="/Assets/Icons/Add_disabled.png" Margin="1, 1, 0, 0" IsVisible="{Binding !IsConnected}" />
</Grid>
</Button>
<TextBox Name="VIEW_SearchBar" Watermark="Search..." Text="{Binding SearchText}" Grid.Column="1" />
<TextBlock Text="" Width="35" Height="36" Grid.Column="2"/>
</Grid>
<ScrollViewer Grid.Row="1" Margin="23, 0" Grid.IsSharedSizeScope="True">
<ItemsControl Name="VIEW_Body" ItemsSource="{Binding GestureBindings}" Padding="32, 0">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:GestureBindingDisplayViewModel">
<containers:GestureBindingDisplay />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Border Background="{StaticResource AccentColorBrush}" BorderThickness="0,2,0,0" Grid.Row="2" Padding="4">
<Button Command="{Binding RequestSave}" Content="Save" IsEnabled="{Binding IsConnected}" HorizontalAlignment="Right" />
</Border>
</Grid>
</DataTemplate>
<DataTemplate DataType="vm:GestureSetupWizardViewModel">
<gestures-views:GestureSetupWizard />
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
</UserControl>