From b01a18dcef03f955523b8ec71a3f02ec98c96824 Mon Sep 17 00:00:00 2001 From: James Crutchley Date: Thu, 19 Dec 2024 14:20:40 -0800 Subject: [PATCH] Fix mvvmtk0045 warning for `StateContainerViewModel` (#2400) Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> --- .../Layouts/StateContainerViewModel.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/samples/CommunityToolkit.Maui.Sample/ViewModels/Layouts/StateContainerViewModel.cs b/samples/CommunityToolkit.Maui.Sample/ViewModels/Layouts/StateContainerViewModel.cs index 6253d3faf6..dd083184ea 100644 --- a/samples/CommunityToolkit.Maui.Sample/ViewModels/Layouts/StateContainerViewModel.cs +++ b/samples/CommunityToolkit.Maui.Sample/ViewModels/Layouts/StateContainerViewModel.cs @@ -6,16 +6,28 @@ namespace CommunityToolkit.Maui.Sample.ViewModels.Layouts; public partial class StateContainerViewModel : BaseViewModel { [ObservableProperty] - string? currentState, gridState, noAnimateState, notFoundState, fullPageState; + public partial string? CurrentState { get; set; } + + [ObservableProperty] + public partial string? GridState { get; set; } + + [ObservableProperty] + public partial string? NoAnimateState { get; set; } + + [ObservableProperty] + public partial string? NotFoundState { get; set; } + + [ObservableProperty] + public partial string? FullPageState { get; set; } [ObservableProperty, NotifyCanExecuteChangedFor(nameof(ToggleGridStateCommand))] - bool canGridStateChange = true; + public partial bool CanGridStateChange { get; set; } = true; [ObservableProperty, NotifyCanExecuteChangedFor(nameof(CycleStatesCommand))] - bool canCycleStateChange = true; + public partial bool CanCycleStateChange { get; set; } = true; [ObservableProperty, NotifyCanExecuteChangedFor(nameof(ToggleFullPageStateCommand))] - bool canFullPageStateChange = true; + public partial bool CanFullPageStateChange { get; set; } = true; [ObservableProperty] public partial bool CanAnimationStateChange { get; set; } = true;