-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathProjectDetailPage.xaml
More file actions
193 lines (176 loc) · 10.4 KB
/
ProjectDetailPage.xaml
File metadata and controls
193 lines (176 loc) · 10.4 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
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
<?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:pages="clr-namespace:DeveloperBalance.Pages"
xmlns:sf="clr-namespace:Syncfusion.Maui.Toolkit.TextInputLayout;assembly=Syncfusion.Maui.Toolkit"
xmlns:controls="clr-namespace:DeveloperBalance.Pages.Controls"
xmlns:fonts="clr-namespace:Fonts"
x:Class="DeveloperBalance.Pages.ProjectDetailPage"
x:DataType="pageModels:ProjectDetailPageModel"
Title="Project">
<ContentPage.Resources>
<DataTemplate x:Key="NormalTagTemplate" x:DataType="models:Tag">
<Border StrokeShape="RoundRectangle 22"
HeightRequest="44"
StrokeThickness="0"
Background="{AppThemeBinding Light={StaticResource LightSecondaryBackground},Dark={StaticResource DarkSecondaryBackground}}"
Padding="{OnPlatform '18,0,18,8',Android='18,0,18,0'}"
SemanticProperties.Description="{Binding Title}">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ToggleTagCommand, Source={RelativeSource AncestorType={x:Type pageModels:ProjectDetailPageModel}}, x:DataType=pageModels:ProjectDetailPageModel}" CommandParameter="{Binding .}"/>
</Border.GestureRecognizers>
<Label Text="{Binding Title}"
TextColor="{AppThemeBinding Light={StaticResource DarkOnLightBackground},Dark={StaticResource LightOnDarkBackground}}"
FontSize="{OnIdiom 16,Desktop=18}"
VerticalOptions="Center"
VerticalTextAlignment="Center"/>
</Border>
</DataTemplate>
<DataTemplate x:Key="SelectedTagTemplate" x:DataType="models:Tag">
<Border StrokeShape="RoundRectangle 22"
HeightRequest="44"
StrokeThickness="0"
Background="{Binding DisplayColor}"
Padding="{OnPlatform '18,0,18,8',Android='18,0,18,0'}"
SemanticProperties.Description="{Binding Title}">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ToggleTagCommand, Source={RelativeSource AncestorType={x:Type pageModels:ProjectDetailPageModel}}, x:DataType=pageModels:ProjectDetailPageModel}" CommandParameter="{Binding .}"/>
</Border.GestureRecognizers>
<Label Text="{Binding Title}"
TextColor="{AppThemeBinding Light={StaticResource LightBackground},Dark={StaticResource DarkBackground}}"
FontSize="{OnIdiom 16,Desktop=18}"
VerticalOptions="Center"
VerticalTextAlignment="Center"/>
</Border>
</DataTemplate>
<controls:ChipDataTemplateSelector
x:Key="ChipDataTemplateSelector"
NormalTagTemplate="{StaticResource NormalTagTemplate}"
SelectedTagTemplate="{StaticResource SelectedTagTemplate}"/>
</ContentPage.Resources>
<ContentPage.ToolbarItems>
<ToolbarItem
Command="{Binding DeleteCommand}"
Order="Primary"
Priority="0"
IconImageSource="{StaticResource IconDelete}"
SemanticProperties.Description="Delete" />
</ContentPage.ToolbarItems>
<Grid>
<ScrollView>
<VerticalStackLayout Padding="{StaticResource LayoutPadding}" Spacing="{StaticResource LayoutSpacing}">
<sf:SfTextInputLayout
Hint="Name" >
<Entry
Text="{Binding Name}" />
</sf:SfTextInputLayout>
<sf:SfTextInputLayout
Hint="Description">
<Entry
Text="{Binding Description}" />
</sf:SfTextInputLayout>
<sf:SfTextInputLayout
Hint="Category">
<Picker
ItemsSource="{Binding Categories}"
SelectedItem="{Binding Category}"
SelectedIndex="{Binding CategoryIndex}" />
</sf:SfTextInputLayout>
<Label
Text="Icon"
Style="{StaticResource Title2}"/>
<CollectionView
HeightRequest="44" Margin="0,0,0,15"
SelectionMode="Single"
SelectedItem="{Binding Icon}"
ItemsSource="{Binding Icons}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:IconData">
<Grid RowDefinitions="Auto,4" RowSpacing="{StaticResource size60}"
SemanticProperties.Description="{Binding Description}"
SemanticProperties.Hint="Icon representing the type of task . Tap to select"
InputTransparent="True">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent"/>
<Setter TargetName="SelectedIndicator" Property="BoxView.IsVisible" Value="False"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Transparent"/>
<Setter Property="Background" Value="Transparent"/>
<Setter TargetName="SelectedIndicator" Property="BoxView.IsVisible" Value="True"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Label
Text="{Binding Icon}"
x:Name="IconImage"
FontFamily="{x:Static fonts:FluentUI.FontFamily}"
FontSize="24"
VerticalOptions="Center"
HorizontalOptions="Center"
TextColor="{AppThemeBinding Light={StaticResource DarkOnLightBackground},Dark={StaticResource LightOnDarkBackground}}"/>
<BoxView x:Name="SelectedIndicator" Color="{StaticResource Primary}" HeightRequest="4" HorizontalOptions="Fill" Grid.Row="1"/>
<!-- This TapGestureRecognizer ensures that the grid is treated as a button for accessibility purposes on iOS -->
<Grid.GestureRecognizers>
<TapGestureRecognizer />
</Grid.GestureRecognizers>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Horizontal" ItemSpacing="{StaticResource LayoutSpacing}"/>
</CollectionView.ItemsLayout>
</CollectionView>
<Label
Text="Tags"
Style="{StaticResource Title2}"/>
<ScrollView Orientation="Horizontal">
<HorizontalStackLayout
Spacing="{StaticResource LayoutSpacing}"
HeightRequest="44"
Margin="0,0,0,15"
BindableLayout.ItemsSource="{Binding AllTags}"
BindableLayout.ItemTemplateSelector="{StaticResource ChipDataTemplateSelector}"/>
</ScrollView>
<Button Text="Save"
HeightRequest="{OnIdiom 44, Desktop=60}"
Command="{Binding SaveCommand}" />
<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 up"
/>
</Grid>
<VerticalStackLayout
Spacing="{StaticResource LayoutSpacing}"
BindableLayout.ItemsSource="{Binding Tasks}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<controls:TaskView TaskCompletedCommand="{Binding TaskCompletedCommand, Source={RelativeSource AncestorType={x:Type pageModels:ProjectDetailPageModel}}, x:DataType=pageModels:ProjectDetailPageModel}" />
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
<controls:AddButton Command="{Binding AddTaskCommand}" />
</Grid>
</ContentPage>