KeyBinding ausgebaut
This commit is contained in:
@@ -181,9 +181,6 @@ namespace BeWo.Services
|
||||
|
||||
private void Show(string title, Control control, WindowViewModel windowViewModel, BeWoWindowOptions options)
|
||||
{
|
||||
if(control.Focusable)
|
||||
control.Focus();
|
||||
|
||||
if (options.ShowAsModal)
|
||||
{
|
||||
var modal = _windowFactory.GetModalViewWindow(title, control, options.Height, options.Width);
|
||||
|
||||
@@ -16,17 +16,14 @@
|
||||
Background="{StaticResource ObjectEditBackgroundBrush}"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.InputBindings>
|
||||
<KeyBinding Key="Esc" Command="{Binding CancelCommand}" />
|
||||
</UserControl.InputBindings>
|
||||
<UserControl.Resources>
|
||||
<view:BeWoView.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="..\..\..\Styles\ModernOrangeBlack.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style BasedOn="{StaticResource PopupBlackLabel2}" TargetType="Label" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
</view:BeWoView.Resources>
|
||||
<Grid
|
||||
MaxWidth="700"
|
||||
Margin="3"
|
||||
|
||||
@@ -16,17 +16,14 @@
|
||||
Background="{StaticResource ObjectEditBackgroundBrush}"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.InputBindings>
|
||||
<KeyBinding Key="Esc" Command="{Binding CancelCommand}" />
|
||||
</UserControl.InputBindings>
|
||||
<UserControl.Resources>
|
||||
<view:BeWoView.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="..\..\..\Styles\ModernOrangeBlack.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<Style BasedOn="{StaticResource PopupBlackLabel2}" TargetType="Label" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
</view:BeWoView.Resources>
|
||||
<Grid
|
||||
MaxWidth="700"
|
||||
Margin="3"
|
||||
@@ -126,7 +123,7 @@
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="100"
|
||||
Command="{Binding CancelCommand}"
|
||||
Command="ApplicationCommands.Close"
|
||||
Visibility="Visible">
|
||||
Abbrechen
|
||||
</Button>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<view:BeWoView
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
x:Class="BeWo.View.Detail.AI.AiPromptbausteinPromptView2"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -9,6 +8,7 @@
|
||||
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
|
||||
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:view="clr-namespace:BeWo.View"
|
||||
xmlns:viewmodel="clr-namespace:BeWo.ViewModel.View.Administration"
|
||||
x:Name="root"
|
||||
Width="500"
|
||||
@@ -16,7 +16,7 @@
|
||||
Background="{StaticResource ObjectEditBackgroundBrush}"
|
||||
Focusable="True">
|
||||
<UserControl.InputBindings>
|
||||
<KeyBinding Key="Esc" Command="{Binding CancelCommand}" />
|
||||
<KeyBinding Key="Esc" Command="ApplicationCommands.Close" />
|
||||
</UserControl.InputBindings>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
@@ -110,7 +110,7 @@
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="100"
|
||||
Command="{Binding CancelCommand, ElementName=root}"
|
||||
Command="ApplicationCommands.Close"
|
||||
Visibility="Collapsed">
|
||||
Abbrechen
|
||||
</Button>
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
Background="{StaticResource ObjectEditBackgroundBrush}"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.InputBindings>
|
||||
<KeyBinding Key="Esc" Command="{Binding CancelCommand}" />
|
||||
</UserControl.InputBindings>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@@ -213,15 +210,14 @@
|
||||
Margin="0,19,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button Width="100" Command="{Binding CancelCommand}">
|
||||
<Button Width="100" Command="ApplicationCommands.Close">
|
||||
Abbrechen
|
||||
</Button>
|
||||
<Button
|
||||
Width="100"
|
||||
Command="{Binding SaveCommand}"
|
||||
Content="{Binding AcceptButtonText}"
|
||||
Visibility="Visible">
|
||||
</Button>
|
||||
Visibility="Visible" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
TextOptions.TextFormattingMode="Display"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
WindowStyle="None">
|
||||
<Window.InputBindings>
|
||||
<KeyBinding Key="Esc" Command="ApplicationCommands.Close" />
|
||||
</Window.InputBindings>
|
||||
<Window.DataContext>
|
||||
<view:WindowViewModel />
|
||||
</Window.DataContext>
|
||||
|
||||
@@ -253,6 +253,11 @@ namespace BeWo.View.Windows
|
||||
{
|
||||
if (!ServiceFacade.IsWaiting() && _WaitLayer != null)
|
||||
EndWaiting();
|
||||
|
||||
if (rootGroupBox.Content is IInputElement element && element.Focusable)
|
||||
{
|
||||
Keyboard.Focus(element);
|
||||
}
|
||||
}
|
||||
|
||||
private void CommandBinding_Close_Executed(object sender, ExecutedRoutedEventArgs e)
|
||||
|
||||
@@ -305,6 +305,9 @@ namespace BeWo.ViewModel
|
||||
|
||||
public override void UpdateByDataContract(AiPromptbausteinFolderDC pDataContract)
|
||||
{
|
||||
if(IsNew)
|
||||
IsNew = false;
|
||||
|
||||
DataContract = pDataContract;
|
||||
|
||||
Title = pDataContract.Title;
|
||||
|
||||
@@ -166,6 +166,9 @@ namespace BeWo.ViewModel
|
||||
|
||||
public override void UpdateByDataContract(AiPromptbausteinPromptDC pDataContract)
|
||||
{
|
||||
if (IsNew)
|
||||
IsNew = false;
|
||||
|
||||
Title = pDataContract.Title;
|
||||
Description = pDataContract.Description;
|
||||
ParentFolderOid = pDataContract.ParentFolderOid;
|
||||
|
||||
@@ -137,6 +137,9 @@ namespace BeWo.ViewModel
|
||||
|
||||
public override void UpdateByDataContract(AiPromptbausteinRoutineDC pDataContract)
|
||||
{
|
||||
if (IsNew)
|
||||
IsNew = false;
|
||||
|
||||
DataContract = pDataContract;
|
||||
|
||||
Title = pDataContract.Title;
|
||||
|
||||
@@ -15,40 +15,6 @@ namespace BeWo.Service.BusinessLogic
|
||||
{
|
||||
public override IDCEntityMapper<AiPromptbausteinFolder, AiPromptbausteinFolderDC> Mapper => MapperFactory.AiPromptbausteinFolder;
|
||||
|
||||
public override AiPromptbausteinFolderDC Insert(AiPromptbausteinFolderDC dc)
|
||||
{
|
||||
var canEdit = dc.CanEdit;
|
||||
var canAddFolder = dc.CanAddFolder;
|
||||
var canAddPrompt = dc.CanAddPrompt;
|
||||
var canAddRoutine = dc.CanAddRoutine;
|
||||
|
||||
var dc2 = base.Insert(dc);
|
||||
|
||||
dc2.CanEdit = canEdit;
|
||||
dc2.CanAddFolder = canAddFolder;
|
||||
dc2.CanAddPrompt = canAddPrompt;
|
||||
dc2.CanAddRoutine = canAddRoutine;
|
||||
|
||||
return dc2;
|
||||
}
|
||||
|
||||
public override AiPromptbausteinFolderDC Update(AiPromptbausteinFolderDC dc)
|
||||
{
|
||||
var canEdit = dc.CanEdit;
|
||||
var canAddFolder = dc.CanAddFolder;
|
||||
var canAddPrompt = dc.CanAddPrompt;
|
||||
var canAddRoutine = dc.CanAddRoutine;
|
||||
|
||||
var dc2 = base.Update(dc);
|
||||
|
||||
dc2.CanEdit = canEdit;
|
||||
dc2.CanAddFolder = canAddFolder;
|
||||
dc2.CanAddPrompt = canAddPrompt;
|
||||
dc2.CanAddRoutine = canAddRoutine;
|
||||
|
||||
return dc2;
|
||||
}
|
||||
|
||||
public override void Deactivate(AiPromptbausteinFolderDC dc)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
|
||||
Reference in New Issue
Block a user