Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public partial class MainPageModel : ObservableObject, IProjectTaskPageModel
[ObservableProperty]
private Project? selectedProject;

[ObservableProperty]
private ProjectTask? selectedTask;

public bool HasCompletedTasks
=> Tasks?.Any(t => t.IsCompleted) ?? false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public partial class ProjectDetailPageModel : ObservableObject, IQueryAttributab
new IconData { Icon = FluentUI.bot_24_regular, Description = "Bot Icon" }
};

[ObservableProperty]
private ProjectTask? selectedTask;

private bool _canDelete;

public bool CanDelete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
StrokeShape="RoundRectangle 20"
Background="{AppThemeBinding Light={StaticResource LightSecondaryBackground}, Dark={StaticResource DarkSecondaryBackground}}"
x:DataType="models:ProjectTask">

<effectsView:SfEffectsView
TouchDownEffects="Highlight"
HighlightBackground="{AppThemeBinding Light={StaticResource DarkOnLightBackground}, Dark={StaticResource LightOnDarkBackground}}">

<shimmer:SfShimmer
BackgroundColor="Transparent"
VerticalOptions="Fill"
Expand Down Expand Up @@ -44,12 +41,6 @@
HorizontalOptions="Start"
VerticalOptions="Center"
LineBreakMode="WordWrap"/>

<Grid.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding NavigateToTaskCommand, Source={RelativeSource AncestorType={x:Type pageModels:IProjectTaskPageModel}}, x:DataType=pageModels:IProjectTaskPageModel}"
CommandParameter="{Binding .}"/>
</Grid.GestureRecognizers>
</Grid>

<CheckBox Grid.Column="0"
Expand All @@ -63,5 +54,4 @@
</Grid>
</shimmer:SfShimmer.Content>
</shimmer:SfShimmer>
</effectsView:SfEffectsView>
</Border>
21 changes: 15 additions & 6 deletions src/Templates/src/templates/maui-mobile/Pages/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,23 @@
Command="{Binding CleanTasksCommand}"
SemanticProperties.Description="Clean tasks" />
</Grid>
<VerticalStackLayout Grid.Row="5" Spacing="15"
BindableLayout.ItemsSource="{Binding Tasks}">
<BindableLayout.ItemTemplate>
<CollectionView ItemsSource="{Binding Tasks}"
Grid.Row="5"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you verify if this change does not regress accessibility on mobile?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I've tested it and it seems to be working fine :)

x:Name="TasksCollectionView"
SelectionMode="Single"
SelectedItem="{Binding SelectedTask}"
SelectionChangedCommand="{Binding NavigateToTaskCommand}"
SelectionChangedCommandParameter="{Binding SelectedTask}">
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical"
ItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<controls:TaskView TaskCompletedCommand="{Binding TaskCompletedCommand, Source={RelativeSource AncestorType={x:Type pageModels:MainPageModel}}, x:DataType=pageModels:MainPageModel}" />
<controls:TaskView TaskCompletedCommand="{Binding TaskCompletedCommand, Source={RelativeSource AncestorType={x:Type pageModels:MainPageModel}}, x:DataType=pageModels:MainPageModel}"/>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ScrollView>
</pullToRefresh:SfPullToRefresh.PullableContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,22 @@
SemanticProperties.Description="Clean up"
/>
</Grid>
<VerticalStackLayout
Spacing="{StaticResource LayoutSpacing}"
BindableLayout.ItemsSource="{Binding Tasks}">
<BindableLayout.ItemTemplate>
<CollectionView ItemsSource="{Binding Tasks}"
x:Name="ProjectTasksCollectionView"
SelectionMode="Single"
SelectedItem="{Binding SelectedTask}"
SelectionChangedCommand="{Binding NavigateToTaskCommand}"
SelectionChangedCommandParameter="{Binding SelectedTask}">
<CollectionView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical"
ItemSpacing="{StaticResource LayoutSpacing}"/>
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<controls:TaskView TaskCompletedCommand="{Binding TaskCompletedCommand, Source={RelativeSource AncestorType={x:Type pageModels:ProjectDetailPageModel}}, x:DataType=pageModels:ProjectDetailPageModel}" />
<controls:TaskView TaskCompletedCommand="{Binding TaskCompletedCommand, Source={RelativeSource AncestorType={x:Type pageModels:ProjectDetailPageModel}}, x:DataType=pageModels:ProjectDetailPageModel}"/>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>

Expand Down
Loading