示例#1
0
        partial void SetupThemeCommands()
        {
            var loadCommand = new RelayCommandAsync <string, LoadThemeResults>(LoadTheme_Execute,
                                                                               null,
                                                                               str => PreExecute_SetBusy(),
                                                                               LoadTheme_PostExecute);

            var saveAsCommand = new RelayCommandAsync <string, SaveThemeResults>(SaveTheme_Execute,
                                                                                 str => CanExecute_ViewModelLoaded(),
                                                                                 str => PreExecute_SetBusy(),
                                                                                 SaveTheme_PostExecute);

            var saveCommand = new RelayCommandAsync <SaveThemeResults>(() => SaveTheme_Execute(ThemePath),
                                                                       CanExecute_ViewModelLoaded,
                                                                       PreExecute_SetBusy,
                                                                       SaveTheme_PostExecute);

            var newCommand = new RelayCommandAsync <LoadThemeResults>(LoadNullTheme_Execute,
                                                                      null,
                                                                      PreExecute_SetBusy,
                                                                      LoadTheme_PostExecute);

            var sendChmm2Command = new RelayCommandAsync <string, SendThemeResults>(SendTheme_Execute,
                                                                                    str => CanExecute_ViewModelLoaded(),
                                                                                    str => PreExecute_SetBusy(),
                                                                                    SendTheme_PostExecute);

            DragThemeCommand = new RelayCommand <DragEventArgs>(DragTheme_Execute);
            DropThemeCommand = new RelayCommandAsync <DragEventArgs, LoadThemeResults>(DropTheme_Execute,
                                                                                       null,
                                                                                       arg => PreExecute_SetBusy(),
                                                                                       LoadTheme_PostExecute);

            LoadThemeCommandWrapper
                = new GestureCommandWrapper(loadCommand, new KeyGesture(Key.O, ModifierKeys.Control));
            SaveThemeCommandWrapper
                = new GestureCommandWrapper(saveCommand, new KeyGesture(Key.S, ModifierKeys.Control));
            SaveAsThemeCommandWrapper
                = new GestureCommandWrapper(saveAsCommand,
                                            new KeyGesture(Key.S, ModifierKeys.Control | ModifierKeys.Shift));

            SendThemeCHMM2Command = sendChmm2Command;

            NewThemeCommandWrapper = new GestureCommandWrapper(newCommand, new KeyGesture(Key.N, ModifierKeys.Control));

            ReloadBGMCommand = new RelayCommandAsync <LoadBGMResults>(LoadBGM_Execute,
                                                                      CanExecute_LoadedFromFile,
                                                                      PreExecute_SetBusy,
                                                                      LoadBGM_PostExecute);

            ExportMetadataCommand = new RelayCommandAsync <string, SaveMetadataResults>(SaveMetadata_Execute,
                                                                                        str => CanExecute_ViewModelLoaded(),
                                                                                        str => PreExecute_SetBusy(),
                                                                                        (r) => IsBusy = false);

            ImportMetadataCommand = new RelayCommandAsync <string, LoadMetadataResults>(LoadMetadata_Execute,
                                                                                        str => CanExecute_ViewModelLoaded(),
                                                                                        str => PreExecute_SetBusy(),
                                                                                        ImportMetadata_PostExecute);
        }
        partial void SetupThemeCommands()
        {
            var loadCommand = new RelayCommandAsync<string, LoadThemeResults>(LoadTheme_Execute,
                null,
                str => PreExecute_SetBusy(),
                LoadTheme_PostExecute);

            var saveAsCommand = new RelayCommandAsync<string, SaveThemeResults>(SaveTheme_Execute,
                str => CanExecute_ViewModelLoaded(),
                str => PreExecute_SetBusy(),
                SaveTheme_PostExecute);

            var saveCommand = new RelayCommandAsync<SaveThemeResults>(() => SaveTheme_Execute(ThemePath),
                CanExecute_ViewModelLoaded,
                PreExecute_SetBusy,
                SaveTheme_PostExecute);

            var newCommand = new RelayCommandAsync<LoadThemeResults>(LoadNullTheme_Execute,
                null,
                PreExecute_SetBusy,
                LoadTheme_PostExecute);

            LoadThemeCommandWrapper
                = new GestureCommandWrapper(loadCommand, new KeyGesture(Key.O, ModifierKeys.Control));
            SaveThemeCommandWrapper
                = new GestureCommandWrapper(saveCommand, new KeyGesture(Key.S, ModifierKeys.Control));
            SaveAsThemeCommandWrapper
                = new GestureCommandWrapper(saveAsCommand, new KeyGesture(Key.S, ModifierKeys.Control | ModifierKeys.Shift));

            NewThemeCommandWrapper = new GestureCommandWrapper(newCommand, new KeyGesture(Key.N, ModifierKeys.Control));

            ReloadBGMCommand = new RelayCommandAsync<LoadBGMResults>(LoadBGM_Execute,
                CanExecute_LoadedFromFile,
                PreExecute_SetBusy,
                LoadBGM_PostExecute);
        }