-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPage.xaml
More file actions
98 lines (95 loc) · 4.72 KB
/
Copy pathMainPage.xaml
File metadata and controls
98 lines (95 loc) · 4.72 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
<?xml version="1.0" encoding="utf-8"?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:local="clr-namespace:ToDo"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ToDo.MainPage">
<ScrollView
x:Name="scrollView"
Orientation="Vertical"
VerticalOptions="FillAndExpand">
<VerticalStackLayout
Padding="20,0"
Spacing="10">
<Button
Text="Add new item"
Clicked="btnClicked"
MaximumWidthRequest="150"
BackgroundColor="#DCDCDC" />
<BoxView
HeightRequest="1"
Color="#00CC00" />
<CollectionView
ItemsSource="{Binding Items}"
CanReorderItems="True"
ReorderCompleted="OnReorderCompleted">
<CollectionView.ItemTemplate>
<DataTemplate
x:DataType="local:todoItem">
<Frame
Margin="5"
Padding="5"
BorderColor="white"
CornerRadius="10"
BackgroundColor="black">
<Grid
ColumnDefinitions="Auto, *, Auto"
VerticalOptions="Center">
<CheckBox
Grid.Column="0"
IsChecked="{Binding isCompleted}" />
<Label
Grid.Column="1"
Text="{Binding listItem}">
<Label.Style>
<Style
TargetType="Label">
<Setter
Property="FontSize"
Value="18" />
<Setter
Property="VerticalTextAlignment"
Value="Center" />
<Setter
Property="TextDecorations"
Value="None" />
<!-- Default state -->
<Style.Triggers>
<DataTrigger
TargetType="Label"
Binding="{Binding isCompleted}"
Value="True">
<Setter
Property="TextDecorations"
Value="Strikethrough" />
<!-- Strikethrough when checked -->
</DataTrigger>
<DataTrigger
TargetType="Label"
Binding="{Binding isCompleted}"
Value="False">
<Setter
Property="TextDecorations"
Value="None" />
<!-- No strikethrough when unchecked -->
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
<ImageButton
Grid.Column="2"
Source="menu.png"
BackgroundColor="black"
WidthRequest="32"
HeightRequest="32"
Clicked="menuBtnClicked" />
</Grid>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>