diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandBarViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandBarViewModel.cs index 420f41f49f1e..c6887a7ae0a5 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandBarViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandBarViewModel.cs @@ -29,6 +29,8 @@ public ICommandBarContext? SelectedItem field = value; SetSelectedItem(value); + + OnPropertyChanged(nameof(SelectedItem)); } } @@ -115,6 +117,10 @@ private void UpdateContextItems() { ShouldShowContextMenu = false; } + + OnPropertyChanged(nameof(HasSecondaryCommand)); + OnPropertyChanged(nameof(SecondaryCommand)); + OnPropertyChanged(nameof(ShouldShowContextMenu)); } // InvokeItemCommand is what this will be in Xaml due to source generator diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ContentPageViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ContentPageViewModel.cs index 73bb041b99a5..f8b0e90834ad 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ContentPageViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ContentPageViewModel.cs @@ -167,7 +167,7 @@ protected override void FetchProperty(string propertyName) Commands.ForEach(contextItem => { - contextItem.InitializeProperties(); + contextItem.SlowInitializeProperties(); }); } else diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ListViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ListViewModel.cs index b45ea08f5457..bcafb0235e34 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ListViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/ListViewModel.cs @@ -436,7 +436,7 @@ protected override void FetchProperty(string propertyName) break; case nameof(EmptyContent): EmptyContent = new(new(model.EmptyContent), PageContext); - EmptyContent.InitializeProperties(); + EmptyContent.SlowInitializeProperties(); break; case nameof(IsLoading): UpdateEmptyContent(); @@ -454,6 +454,8 @@ private void UpdateEmptyContent() return; } + UpdateProperty(nameof(EmptyContent)); + DoOnUiThread( () => {