コード例 #1
0
        private void RenameImpl()
        {
            var dialogVM = new ChooseNameViewModel(MiscRes.ChooseNamePreset, this.PresetsService.AllPresets.Where(preset => !preset.Preset.IsBuiltIn).Select(preset => preset.Preset.Name));

            dialogVM.Name = this.PresetsService.SelectedPreset.DisplayName;
            Ioc.Get <IWindowManager>().OpenDialog(dialogVM, this);

            if (dialogVM.DialogResult)
            {
                string newPresetName = dialogVM.Name;
                this.PresetsService.RenamePreset(newPresetName);
            }
        }
コード例 #2
0
        private void SaveAsImpl()
        {
            var dialogVM = new ChooseNameViewModel(MiscRes.ChooseNamePicker, this.pickersService.Pickers.Skip(1).Select(p => p.Picker.Name));

            dialogVM.Name = this.Picker.DisplayName;
            Ioc.Get <IWindowManager>().OpenDialog(dialogVM, this);

            if (dialogVM.DialogResult)
            {
                string newPickerName = dialogVM.Name;

                this.pickersService.SavePickerAs(newPickerName);
            }
        }