Skip to content

Commit

Permalink
[housekeeping] Automated PR to fix formatting errors (#2183)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 6, 2024
1 parent 7fc7911 commit 4bcb555
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static string GetPageRoute(Type viewModelType)
{
return new KeyValuePair<Type, (Type GalleryPageType, Type ContentPageType)>(typeof(TViewModel), (typeof(TGalleryPage), typeof(TPage)));
}

void SetupNavigationView()
{
#if WINDOWS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using CommunityToolkit.Maui.Alerts;
using CommunityToolkit.Maui.Behaviors;
using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
using CommunityToolkit.Maui.Markup;
using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;

namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;

public class TouchBehaviorCollectionViewMultipleSelectionPage : BasePage<TouchBehaviorCollectionViewMultipleSelectionViewModel>
{
readonly CollectionView collectionView;

public TouchBehaviorCollectionViewMultipleSelectionPage(TouchBehaviorCollectionViewMultipleSelectionViewModel viewModel) : base(viewModel)
{
Content = new VerticalStackLayout
Expand All @@ -19,7 +19,7 @@ public TouchBehaviorCollectionViewMultipleSelectionPage(TouchBehaviorCollectionV
.Text($"This page demonstrates how to use the TouchBehavior inside of a CollectionView when {nameof(SelectionMode)}.{nameof(SelectionMode.Multiple)} is in use")
.Center()
.TextCenter(),

new CollectionView { SelectionMode = SelectionMode.Multiple }
.ItemTemplate(new CreatorsDataTemplate(viewModel))
.Invoke(collectionView => collectionView.SelectionChanged += HandleSelectionChanged)
Expand All @@ -30,7 +30,7 @@ public TouchBehaviorCollectionViewMultipleSelectionPage(TouchBehaviorCollectionV
}
};
}

async void HandleSelectionChanged(object? sender, SelectionChangedEventArgs e)
{
await Toast.Make($"Number of Creators Selected: {collectionView.SelectedItems?.Count ?? 0}").Show();
Expand All @@ -44,10 +44,10 @@ sealed class CreatorsDataTemplate(TouchBehaviorCollectionViewMultipleSelectionVi
{
new Label()
.Center()
.Bind(Label.TextProperty,
.Bind(Label.TextProperty,
getter: static (ContentCreator creator) => creator.Resource,
mode: BindingMode.OneTime),

new Image()
.Size(100, 100)
.Bind(Image.SourceProperty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
public partial class TouchBehaviorCollectionViewMultipleSelectionViewModel : BaseViewModel
{
public ObservableCollection<ContentCreator> ContentCreators { get; } = [.. ContentCreator.GetContentCreators()];

[RelayCommand]
void OnRowTapped(ContentCreator creatorTapped)
{
Expand Down

0 comments on commit 4bcb555

Please sign in to comment.