From 673d6dcf203f2e93080b4833ae868af5332d6739 Mon Sep 17 00:00:00 2001 From: Thomas Labrecque Date: Wed, 15 May 2024 14:16:13 -0400 Subject: [PATCH] fix: Workaround for Posts page --- .../ViewModels/Posts/PostItemViewModel.cs | 13 +------------ .../ViewModels/Posts/PostsPageViewModel.cs | 2 +- .../Content/Posts/PostsPage.xaml | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostItemViewModel.cs b/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostItemViewModel.cs index 15847732..5925488f 100644 --- a/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostItemViewModel.cs +++ b/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostItemViewModel.cs @@ -7,28 +7,17 @@ namespace ApplicationTemplate.Presentation; /// /// Post item view model. /// -/// -/// This was created as a workaround for an Uno issue. -/// See https://github.com/unoplatform/uno/issues/13996 for more details. -/// public sealed class PostItemViewModel : ViewModel { /// /// Initializes a new instance of the class. /// - /// The parent view model. /// The post. - public PostItemViewModel(IViewModel parent, Post post) + public PostItemViewModel(Post post) { - Parent = parent; Post = post; } - /// - /// The parent view model. - /// - public IViewModel Parent { get; } - /// /// The post. /// diff --git a/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostsPageViewModel.cs b/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostsPageViewModel.cs index 1713ca03..473a5ed4 100644 --- a/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostsPageViewModel.cs +++ b/src/app/ApplicationTemplate.Presentation/ViewModels/Posts/PostsPageViewModel.cs @@ -28,7 +28,7 @@ private async Task> GetPosts(CancellationToken var posts = await this.GetService().GetPosts(ct); return posts - .Select(p => this.GetChild(() => new PostItemViewModel(this, p), p.Id.ToString(CultureInfo.InvariantCulture))) + .Select(p => this.GetChild(() => new PostItemViewModel(p), p.Id.ToString(CultureInfo.InvariantCulture))) .ToImmutableList(); } } diff --git a/src/app/ApplicationTemplate.Shared.Views/Content/Posts/PostsPage.xaml b/src/app/ApplicationTemplate.Shared.Views/Content/Posts/PostsPage.xaml index 81e2b6c2..b7a2d9a6 100644 --- a/src/app/ApplicationTemplate.Shared.Views/Content/Posts/PostsPage.xaml +++ b/src/app/ApplicationTemplate.Shared.Views/Content/Posts/PostsPage.xaml @@ -35,11 +35,11 @@ Padding="16"> - -