-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathMainPage.xaml
More file actions
89 lines (85 loc) · 4.99 KB
/
MainPage.xaml
File metadata and controls
89 lines (85 loc) · 4.99 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
<?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:pageModels="clr-namespace:DeveloperBalance.PageModels"
xmlns:models="clr-namespace:DeveloperBalance.Models"
xmlns:controls="clr-namespace:DeveloperBalance.Pages.Controls"
xmlns:pullToRefresh="clr-namespace:Syncfusion.Maui.Toolkit.PullToRefresh;assembly=Syncfusion.Maui.Toolkit"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="DeveloperBalance.Pages.MainPage"
x:DataType="pageModels:MainPageModel"
Title="{Binding Today}">
<ContentPage.Behaviors>
<toolkit:EventToCommandBehavior
EventName="NavigatedTo"
Command="{Binding NavigatedToCommand}" />
<toolkit:EventToCommandBehavior
EventName="NavigatedFrom"
Command="{Binding NavigatedFromCommand}" />
<toolkit:EventToCommandBehavior
EventName="Appearing"
Command="{Binding AppearingCommand}" />
</ContentPage.Behaviors>
<ContentPage.Resources>
<ResourceDictionary>
<toolkit:InvertedBoolConverter x:Key="InvertedBoolConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<Grid>
<pullToRefresh:SfPullToRefresh
IsRefreshing="{Binding IsRefreshing}"
RefreshCommand="{Binding RefreshCommand}">
<pullToRefresh:SfPullToRefresh.PullableContent>
<ScrollView>
<VerticalStackLayout Spacing="{StaticResource LayoutSpacing}" Padding="{StaticResource LayoutPadding}">
<Label Text="Task Categories" Style="{StaticResource Title2}"/>
<controls:CategoryChart />
<Label Text="Projects" Style="{StaticResource Title2}"/>
<CollectionView
ItemsSource="{Binding Projects}"
Margin="-15, 0">
<CollectionView.ItemsLayout>
<LinearItemsLayout
Orientation="Horizontal"
ItemSpacing="15" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:Project">
<controls:ProjectCardView WidthRequest="200">
<controls:ProjectCardView.GestureRecognizers>
<TapGestureRecognizer Command="{Binding NavigateToProjectCommand, Source={RelativeSource AncestorType={x:Type pageModels:MainPageModel}}, x:DataType=pageModels:MainPageModel}" CommandParameter="{Binding .}"/>
</controls:ProjectCardView.GestureRecognizers>
</controls:ProjectCardView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Grid HeightRequest="44">
<Label Text="Tasks" Style="{StaticResource Title2}" VerticalOptions="Center"/>
<ImageButton
Source="{StaticResource IconClean}"
HorizontalOptions="End"
VerticalOptions="Center"
Aspect="Center"
HeightRequest="44"
WidthRequest="44"
IsVisible="{Binding HasCompletedTasks}"
Command="{Binding CleanTasksCommand}"
SemanticProperties.Description="Clean tasks" />
</Grid>
<VerticalStackLayout Spacing="15"
BindableLayout.ItemsSource="{Binding Tasks}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<controls:TaskView TaskCompletedCommand="{Binding TaskCompletedCommand, Source={RelativeSource AncestorType={x:Type pageModels:MainPageModel}}, x:DataType=pageModels:MainPageModel}" />
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
</pullToRefresh:SfPullToRefresh.PullableContent>
</pullToRefresh:SfPullToRefresh>
<controls:AddButton
IsEnabled="{Binding IsBusy, Converter={StaticResource InvertedBoolConverter}}"
Command="{Binding AddTaskCommand}" />
</Grid>
</ContentPage>