RecipeCommandViewModel.cs 638 B

12345678910111213141516171819202122232425262728293031
  1. using CommunityToolkit.Mvvm.Input;
  2. using System.Windows.Media;
  3. namespace SummaryModule.Pops.Main;
  4. public partial class RecipeCommandViewModel : ObservableObject, IPopAware
  5. {
  6. public string? Title { get; set; } = "PM Command";
  7. public Action? RequestClose { get; set; }
  8. public ImageSource? ImageSource { get; set; } = (DrawingImage)Application.Current.Resources["Icon_Recipe"];
  9. public bool CanClose()
  10. {
  11. return true;
  12. }
  13. public void OnClose()
  14. {
  15. }
  16. public void OnPop(object? state)
  17. {
  18. }
  19. [RelayCommand]
  20. private void Close()
  21. {
  22. this.RequestClose?.Invoke();
  23. }
  24. }