Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[housekeeping] Automated PR to fix formatting errors #2183

Merged
merged 1 commit into from
Sep 6, 2024
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
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