示例#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);
        }
 public AboutWindow()
 {
     InitializeComponent();
     UpdateDownloadCommand = new RelayCommandAsync <TempFile>(DownloadUpdate_Execute,
                                                              () => UpdateAvailable && !string.IsNullOrEmpty(Update.UpdatePayloadUrl),
                                                              null,
                                                              PostExecute);
 }
示例#3
0
        partial void SetupImageCommands()
        {
            RemoveImageCommand  = new RelayCommand <TargetImage>(RemoveImage_Execute, CanExecute_ImageExists);
            ReplaceImageCommand = new RelayCommandAsync <TargetImage, LoadImageResults>(LoadImage_Execute, image => CanExecute_ViewModelLoaded(), image => PreExecute_SetBusy(), LoadImage_PostExecute);
            ExportImageCommand  = new RelayCommandAsync <TargetImage, SaveImageResults>(ExportImage_Execute, CanExecute_ImageExists, image => PreExecute_SetBusy(), ExportImage_PostExecute);

            DragImageCommand = new RelayCommand <DragEventArgs>(DragImage_Execute, image => CanExecute_ViewModelLoaded());

            DropTopImageCommand = new RelayCommandAsync <DragEventArgs, LoadImageResults>(e => DropImage_Execute(e, TargetImage.Top), image => CanExecute_ViewModelLoaded(), image => PreExecute_SetBusy(), LoadImage_PostExecute);

            DropBottomImageCommand = new RelayCommandAsync <DragEventArgs, LoadImageResults>(e => DropImage_Execute(e, TargetImage.Bottom), image => CanExecute_ViewModelLoaded(), image => PreExecute_SetBusy(), LoadImage_PostExecute);

            CopyResizeSMDHIconCommandCommand = new RelayCommand <bool>(CopySMDHLargeToSmall_Execute);
        }
        partial void SetupImageCommands()
        {
            // Menus

            RemoveImageCommand  = new RelayCommand <TargetImage>(RemoveImage_Execute, CanExecute_ImageExists);
            ReplaceImageCommand = new RelayCommandAsync <TargetImage, LoadImageResults>(LoadImage_Execute,
                                                                                        image => CanExecute_ViewModelLoaded(),
                                                                                        image => PreExecute_SetBusy(),
                                                                                        LoadImage_PostExecute);
            ExportImageCommand = new RelayCommandAsync <TargetImage, SaveImageResults>(ExportImage_Execute,
                                                                                       CanExecute_ImageExists,
                                                                                       image => PreExecute_SetBusy(),
                                                                                       ExportImage_PostExecute);

            // Drop Targets

            DragImageCommand = new RelayCommand <DragEventArgs>(DragImage_Execute, image => CanExecute_ViewModelLoaded());

            Func <TargetImage, ICommand> genCommand = target => new RelayCommandAsync <DragEventArgs, LoadImageResults>(
                e => DropImage_Execute(e, target),
                image => CanExecute_ViewModelLoaded(),
                image => PreExecute_SetBusy(),
                LoadImage_PostExecute);

            DropTopImageCommand          = genCommand(TargetImage.Top);
            DropTopAltImageCommand       = genCommand(TargetImage.TopAlt);
            DropBottomImageCommand       = genCommand(TargetImage.Bottom);
            DropFileLargeImageCommand    = genCommand(TargetImage.FileLarge);
            DropFileSmallImageCommand    = genCommand(TargetImage.FileSmall);
            DropFolderClosedImageCommand = genCommand(TargetImage.FolderClosed);
            DropFolderOpenImageCommand   = genCommand(TargetImage.FolderOpen);

            // SMDH Icon

            CopyResizeSMDHIconCommandCommand = new RelayCommand <bool>(CopySMDHLargeToSmall_Execute);
        }