-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
140 lines (92 loc) · 5.39 KB
/
MainWindow.xaml
File metadata and controls
140 lines (92 loc) · 5.39 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!--/// <Summary>
/// Author : R. Arun Mutharasu
/// Created :25-01-2022
/// YouTube Channel : C# Design Pro
/// </Summary>-->
<Window x:Class="ResponsiveApp.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:ResponsiveApp.Helper"
xmlns:vm="clr-namespace:ResponsiveApp.ViewModel"
mc:Ignorable="d"
Title="MainWindow"
x:Name="ResponsiveWindow"
Height="700"
Width="1350"
MinWidth="428"
WindowStyle="None"
AllowsTransparency="True"
ResizeMode="CanResizeWithGrip"
WindowStartupLocation="CenterScreen"
Background="Transparent">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibility" />
</Window.Resources>
<Window.DataContext>
<vm:MainViewModel />
</Window.DataContext>
<Grid>
<Border Background="#282D33"
BorderBrush="#3A4149"
BorderThickness="5"
CornerRadius="8,8,0,8" />
<!--// Responsive Layouts //-->
<ContentControl Content="{Binding}">
<ContentControl.Style>
<Style TargetType="ContentControl">
<!--// Default Layout //-->
<Setter Property="ContentTemplate"
Value="{StaticResource Laptop_Layout}" />
<Style.Triggers>
<!--// Desktop Layout // {width > 1400px}-->
<DataTrigger Binding="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=Window}, Converter={x:Static local:IsGreaterThanConverter.Instance}, ConverterParameter=1400}"
Value="True">
<Setter Property="ContentTemplate"
Value="{StaticResource Desktop_Layout}" />
</DataTrigger>
<!--// Tablet Landscape Layout // {width < 1200px}-->
<DataTrigger Binding="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=Window}, Converter={x:Static local:IsLessThanConverter.Instance}, ConverterParameter=1200}"
Value="True">
<Setter Property="ContentTemplate"
Value="{StaticResource Tablet_Landscape_Layout}" />
</DataTrigger>
<!--// Tablet Portrait Layout // {width < 1024px}-->
<DataTrigger Binding="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=Window}, Converter={x:Static local:IsLessThanConverter.Instance}, ConverterParameter=1024}"
Value="True">
<Setter Property="ContentTemplate"
Value="{StaticResource Tablet_Portrait_Layout}" />
</DataTrigger>
<!--// Mobile Landscape Layout // {width < 812px}-->
<DataTrigger Binding="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=Window}, Converter={x:Static local:IsLessThanConverter.Instance}, ConverterParameter=812}"
Value="True">
<Setter Property="ContentTemplate"
Value="{StaticResource Mobile_Landscape_Layout}" />
</DataTrigger>
<!--// Mobile Portrait Layout // {width < 667px}-->
<DataTrigger Binding="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=Window}, Converter={x:Static local:IsLessThanConverter.Instance}, ConverterParameter=667}"
Value="True">
<Setter Property="ContentTemplate"
Value="{StaticResource Mobile_Portrait_Layout}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
<!--// Side Menu // [ For Tablet, Mobile Layouts ]-->
<ContentControl Content="{Binding}"
Visibility="{Binding IsPanelVisible, Converter={StaticResource BooleanToVisibility}}">
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="ContentTemplate"
Value="{StaticResource MenuTemplate}" />
</Style>
</ContentControl.Style>
</ContentControl>
<!--// Close App Button //-->
<Button Command="{Binding CloseAppCommand}"
CommandParameter="{Binding ElementName=ResponsiveWindow}"
Style="{StaticResource CloseAppStyle}" />
</Grid>
</Window>