-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainPage.xaml
58 lines (51 loc) · 2.62 KB
/
MainPage.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
<?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"
xmlns:vm="clr-namespace:MauiCatAlarm.ViewModels"
x:Class="MauiCatAlarm.MainPage"
x:DataType="vm:MainViewModel">
<ScrollView>
<VerticalStackLayout>
<VerticalStackLayout Spacing="0">
<HorizontalStackLayout HorizontalOptions="Start"
Spacing="6"
Padding="0">
<Label Text="{Binding CurrentWeekday}"
Style="{StaticResource Subheading}"
Margin="0,0,48,0" />
<Label Text="{Binding CurrentMonth}"
Style="{StaticResource SubheadingMonth}" />
<Label Text="{Binding CurrentDayNumber}"
Style="{StaticResource SubheadingDayNumber}" />
</HorizontalStackLayout>
<Label Text="{Binding CurrentTime}"
Style="{StaticResource Heading}" />
</VerticalStackLayout>
<!-- Show an ongoing alarm in case the notification was dismissed -->
<Label Text="Wake up!"
IsVisible="{Binding IsAlarmOngoing}" />
<Button Text="Turn off alarm"
IsVisible="{Binding IsAlarmOngoing}"
Command="{Binding NavigateToAlarmCommand}"
Style="{StaticResource DangerButton}"
Margin="0,0,0,48" />
<!-- Show time picker when alarm is disabled -->
<Label Text="Wake me up at:"
IsVisible="{Binding IsAlarmUnset}" />
<TimePicker Time="{Binding AlarmTime}"
Format="t"
IsVisible="{Binding IsAlarmUnset}" />
<!-- Show a label with the next occurrence if the alarm is enabled -->
<Label Text="{Binding EnabledAlarmLabel}"
IsVisible="{Binding IsAlarmSet}" />
<Button Text="{Binding ToggleAlarmText}"
Command="{Binding ToggleAlarmCommand}"
Style="{StaticResource PrimaryButton}" />
<Label Text="{Binding AlarmRingtoneName, StringFormat='Alarm: {0}'}"
Margin="0,24,0,0" />
<Button Text="Change"
Command="{Binding UpdateAlarmRingtoneCommand}"
Style="{StaticResource SecondaryButton}" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>