This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 206
/
SettingsView.xaml
288 lines (275 loc) · 12.7 KB
/
SettingsView.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="eShopOnContainers.Views.SettingsView"
xmlns:viewModelBase="clr-namespace:eShopOnContainers.ViewModels.Base;assembly=eShopOnContainers"
xmlns:controls="clr-namespace:eShopOnContainers.Controls;assembly=eShopOnContainers"
xmlns:converters="clr-namespace:eShopOnContainers.Converters;assembly=eShopOnContainers"
xmlns:animations="clr-namespace:eShopOnContainers.Animations;assembly=eShopOnContainers"
xmlns:triggers="clr-namespace:eShopOnContainers.Triggers;assembly=eShopOnContainers"
xmlns:viewmodels="clr-namespace:eShopOnContainers.ViewModels"
x:DataType="viewmodels:SettingsViewModel"
Title="SETTINGS"
Shell.FlyoutBehavior="Disabled"
Shell.NavBarIsVisible="True"
Shell.TabBarIsVisible="False">
<ContentPage.Resources>
<ResourceDictionary>
<converters:DoubleConverter x:Key="DoubleConverter" />
<Style x:Key="SettingsStackLayoutStyle" TargetType="{x:Type StackLayout}">
<Setter Property="Margin"
Value="6" />
</Style>
<Style x:Key="SettingsTitleStyle"
TargetType="{x:Type Label}"
BasedOn="{StaticResource MediumSizeFontStyle}">
<Setter Property="HorizontalOptions"
Value="Start" />
<Setter Property="VerticalOptions"
Value="Center" />
<Setter Property="Margin"
Value="12, 0" />
<Setter Property="TextColor" Value="{StaticResource GreenColor}" />
</Style>
<Style x:Key="SettingsDescriptionStyle"
TargetType="{x:Type Label}"
BasedOn="{StaticResource LittleSizeFontStyle}">
<Setter Property="HorizontalOptions"
Value="Start" />
<Setter Property="VerticalOptions"
Value="Center" />
<Setter Property="Margin"
Value="12, 0" />
</Style>
<Style x:Key="SettingsWarningMessageStyle"
TargetType="{x:Type Label}"
BasedOn="{StaticResource LittleSizeFontStyle}">
<Setter Property="HorizontalOptions"
Value="Start" />
<Setter Property="VerticalOptions"
Value="Center" />
<Setter Property="Margin"
Value="12, 0" />
<Setter Property="TextColor" Value="{StaticResource ErrorColor}" />
</Style>
<Style x:Key="SettingsToggleButtonStyle"
TargetType="{x:Type controls:ToggleButton}">
<Setter Property="HeightRequest"
Value="48" />
<Setter Property="WidthRequest"
Value="48" />
<Setter Property="VerticalOptions"
Value="Center" />
<Setter Property="HorizontalOptions"
Value="Center" />
<Setter Property="Margin"
Value="12,0" />
<Setter Property="Animate"
Value="True" />
</Style>
<Style x:Key="SettingsEntryStyle"
TargetType="{x:Type Entry}"
BasedOn="{StaticResource EntryStyle}">
<Setter Property="Margin"
Value="12, 0" />
</Style>
<Style x:Key="SettingsWinUIEntryStyle"
TargetType="{x:Type Entry}"
BasedOn="{StaticResource WinUIEntryStyle}">
<Setter Property="Margin"
Value="12, 0" />
</Style>
<Style x:Key="HeaderLabelStyle"
TargetType="{x:Type Label}">
<Setter Property="FontFamily"
Value="Montserrat-Regular" />
<Setter Property="FontSize"
Value="{StaticResource LittleSize}" />
<Setter Property="TextColor"
Value="{StaticResource GreenColor}" />
<Setter Property="HorizontalOptions"
Value="Start" />
<Setter Property="Margin"
Value="12,0" />
</Style>
<animations:StoryBoard
x:Key="MockServicesAnimation"
Target="{x:Reference MockServices}">
<animations:FadeInAnimation
Direction="Up">
<animations:FadeInAnimation.Duration>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="0" />
<On Platform="Android, WinUI" Value="500" />
</OnPlatform>
</animations:FadeInAnimation.Duration>
</animations:FadeInAnimation>
</animations:StoryBoard>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Triggers>
<EventTrigger
Event="Appearing">
<triggers:BeginAnimation
Animation="{StaticResource MockServicesAnimation}" />
</EventTrigger>
</ContentPage.Triggers>
<!-- SETTINGS -->
<Grid x:Name="MockServices">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- MOCK SERVICES -->
<StackLayout
Style="{StaticResource SettingsStackLayoutStyle}">
<Label
Text="{Binding TitleUseAzureServices}"
Style="{StaticResource SettingsTitleStyle}"/>
<Label
Text="{Binding DescriptionUseAzureServices}"
Style="{StaticResource SettingsDescriptionStyle}"/>
</StackLayout>
<!-- ON / OFF -->
<controls:ToggleButton
Grid.Column="1"
Checked="{Binding UseAzureServices, Mode=TwoWay}"
Command="{Binding ToggleMockServicesCommand}"
Style="{StaticResource SettingsToggleButtonStyle}"
CheckedImage="{StaticResource ToggleOnImageSource}"
UnCheckedImage="{StaticResource ToggleOffImageSource}" />
<!-- ENDPOINT -->
<StackLayout
Grid.Row="1"
Grid.ColumnSpan="2"
Style="{StaticResource SettingsStackLayoutStyle}"
IsVisible="{Binding UseAzureServices}">
<Label
Text="Identity Url"
Style="{StaticResource HeaderLabelStyle}"/>
<Entry
Text="{Binding IdentityEndpoint, Mode=TwoWay}">
<Entry.Style>
<OnPlatform x:TypeArguments="Style">
<On Platform="iOS, Android" Value="{StaticResource SettingsEntryStyle}" />
<On Platform="WinUI" Value="{StaticResource SettingsWinUIEntryStyle}" />
</OnPlatform>
</Entry.Style>
</Entry>
<Label
Text="Gateway Shopping Url"
Style="{StaticResource HeaderLabelStyle}"/>
<Entry
Text="{Binding GatewayShoppingEndpoint, Mode=TwoWay}">
<Entry.Style>
<OnPlatform x:TypeArguments="Style">
<On Platform="iOS, Android" Value="{StaticResource SettingsEntryStyle}" />
<On Platform="WinUI" Value="{StaticResource SettingsWinUIEntryStyle}" />
</OnPlatform>
</Entry.Style>
</Entry>
<Label
Text="Gateway Marketing Url"
Style="{StaticResource HeaderLabelStyle}"/>
<Entry
Text="{Binding GatewayMarketingEndpoint, Mode=TwoWay}">
<Entry.Style>
<OnPlatform x:TypeArguments="Style">
<On Platform="iOS, Android" Value="{StaticResource SettingsEntryStyle}" />
<On Platform="WinUI" Value="{StaticResource SettingsWinUIEntryStyle}" />
</OnPlatform>
</Entry.Style>
</Entry>
</StackLayout>
<!-- USE LOCATIONS --><!--
<StackLayout
Grid.Row="2"
IsVisible="{Binding UserIsLogged}"
Style="{StaticResource SettingsStackLayoutStyle}">
<Label
Text="{Binding TitleUseFakeLocation}"
Style="{StaticResource SettingsTitleStyle}"/>
<Label
Text="{Binding DescriptionUseFakeLocation}"
Style="{StaticResource SettingsDescriptionStyle}"/>
</StackLayout>
--><!-- ON / OFF --><!--
<controls:ToggleButton
Grid.Column="1"
Grid.Row="2"
Checked="{Binding UseFakeLocation, Mode=TwoWay}"
Command="{Binding ToggleFakeLocationCommand}"
Style="{StaticResource SettingsToggleButtonStyle}"
IsVisible="{Binding UserIsLogged}"
CheckedImage="{StaticResource ToggleOnImageSource}"
UnCheckedImage="{StaticResource ToggleOffImageSource}" />
--><!-- FAKE LOCATIONS --><!--
<StackLayout
Grid.Row="3"
Grid.ColumnSpan="2"
Style="{StaticResource SettingsStackLayoutStyle}"
IsVisible="{Binding UseFakeLocation}">
<Label
Text="Latitude"
Style="{StaticResource HeaderLabelStyle}"/>
<Entry
Text="{Binding Latitude, Mode=TwoWay, Converter={StaticResource DoubleConverter}}"
Keyboard="Text">
<Entry.Style>
<OnPlatform x:TypeArguments="Style">
<On Platform="iOS, Android" Value="{StaticResource SettingsEntryStyle}" />
<On Platform="WinUI" Value="{StaticResource SettingsWinUIEntryStyle}" />
</OnPlatform>
</Entry.Style>
</Entry>
<Label
Text="Longitude"
Style="{StaticResource HeaderLabelStyle}"/>
<Entry
Text="{Binding Longitude, Mode=TwoWay, Converter={StaticResource DoubleConverter}}"
Keyboard="Text">
<Entry.Style>
<OnPlatform x:TypeArguments="Style">
<On Platform="iOS, Android" Value="{StaticResource SettingsEntryStyle}" />
<On Platform="WinUI" Value="{StaticResource SettingsWinUIEntryStyle}" />
</OnPlatform>
</Entry.Style>
</Entry>
<Button
Command="{Binding ToggleSendLocationCommand}"
Text="Send Location"/>
</StackLayout>
--><!-- ALLOW GPS LOCATION --><!--
<StackLayout
Grid.Row="4"
Style="{StaticResource SettingsStackLayoutStyle}"
IsVisible="{Binding UseFakeLocation, Converter={StaticResource InverseBoolConverter}}">
<Label
Text="{Binding TitleAllowGpsLocation}"
Style="{StaticResource SettingsTitleStyle}"/>
<Label
Text="{Binding DescriptionAllowGpsLocation}"
Style="{StaticResource SettingsDescriptionStyle}"/>
<Label
Text="{Binding GpsWarningMessage}"
Style="{StaticResource SettingsWarningMessageStyle}"/>
</StackLayout>
--><!-- ON / OFF --><!--
<controls:ToggleButton
Grid.Column="1"
Grid.Row="4"
Checked="{Binding AllowGpsLocation, Mode=TwoWay}"
Command="{Binding ToggleAllowGpsLocationCommand}"
Style="{StaticResource SettingsToggleButtonStyle}"
IsVisible="{Binding UseFakeLocation, Converter={StaticResource InverseBoolConverter}}"
CheckedImage="{StaticResource ToggleOnImageSource}"
UnCheckedImage="{StaticResource ToggleOffImageSource}" />-->
</Grid>
</ContentPage>