UI - Rename folders and layers in a dialog to avoid hotkey issues

UI - Fixed renaming an effect executing twice, requiring two undo-actions to undo it
UI - Always disable editor hotkeys when typing in any input
This commit is contained in:
Robert committed 2023-04-19 16:03:57 +02:00
1 parent 0b5866a2b8
commit 192b4f0df2
20 files changed
+166 -147

No files matched your search

@@ -8,7 +8,7 @@
x:DataType="contentDialogs:LayerEffectRenameViewModel">
<StackPanel>
<StackPanel.KeyBindings>
<KeyBinding Gesture="Enter" Command="{CompiledBinding Confirm}" />
<KeyBinding Gesture="Enter" Command="{CompiledBinding Enter}" />
</StackPanel.KeyBindings>
<TextBox Name="NameTextBox" Text="{CompiledBinding LayerEffectName}" Watermark="Layer effect name" />
</StackPanel>
@@ -26,5 +26,4 @@ public partial class LayerEffectRenameView : ReactiveUserControl<LayerEffectRena
NameTextBox.SelectAll();
NameTextBox.Focus();
}
}
@@ -22,6 +22,7 @@ public class LayerEffectRenameViewModel : ContentDialogViewModelBase
_layerEffectName = layerEffect.Name;
Confirm = ReactiveCommand.Create(ExecuteConfirm, ValidationContext.Valid);
Enter = ReactiveCommand.Create(() => ContentDialog?.Hide(ContentDialogResult.Primary), Confirm.CanExecute);
this.ValidationRule(vm => vm.LayerEffectName, categoryName => !string.IsNullOrWhiteSpace(categoryName), "You must specify a valid name");
}
@@ -32,6 +33,7 @@ public class LayerEffectRenameViewModel : ContentDialogViewModelBase
}
public ReactiveCommand<Unit, Unit> Confirm { get; }
public ReactiveCommand<Unit, Unit> Enter { get; }
private void ExecuteConfirm()
{