RecipeFileViewModel.cs 772 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Windows.Shapes;
  2. namespace ConfigFileManager.ViewModels.Dialog;
  3. internal partial class RecipeFileViewModel : ObservableObject, IDialogAware
  4. {
  5. public DialogCloseListener RequestClose { get; set; }
  6. [ObservableProperty]
  7. private string? _Title;
  8. public bool CanCloseDialog()
  9. {
  10. return true;
  11. }
  12. public void OnDialogClosed()
  13. {
  14. }
  15. public void OnDialogOpened(IDialogParameters parameters)
  16. {
  17. this.Title = "配方文件";
  18. this.Path = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "Files", "Furnace", "Recipes", "Recipes", "Furnace");
  19. }
  20. [ObservableProperty]
  21. private string? _Path;
  22. [RelayCommand]
  23. private void Close()
  24. {
  25. this.RequestClose.Invoke();
  26. }
  27. }