[Editor] Update script editor bindings

This commit is contained in:
Nicolas Musset 2024-02-29 14:44:45 +01:00
Родитель 2f5059432f
Коммит ae4250010e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5D113F041FA3C820
2 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -7,11 +7,12 @@
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:sd="http://schemas.stride3d.net/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" FocusManager.FocusedElement="{Binding ElementName=CodeEditor}">
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:ScriptEditorViewModel}"
FocusManager.FocusedElement="{Binding ElementName=CodeEditor}">
<i:Interaction.Behaviors>
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Save" Command="{Binding Editor.SaveDocumentCommand}" />
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Save" Command="{Binding SaveDocumentCommand}" />
</i:Interaction.Behaviors>
<Grid DataContext="{Binding Editor}" d:DataContext="{d:DesignInstance local:ScriptEditorViewModel}">
<Grid>
<local:SimpleCodeTextEditor x:Name="CodeEditor" x:FieldModifier="private" FontSize="{Binding Code.EditorFontSize}" ContextActionsIcon="{StaticResource Bulb}" />
</Grid>
</UserControl>

Просмотреть файл

@ -1,4 +1,4 @@
<UserControl x:Class="Stride.Assets.Presentation.AssetEditors.VisualScriptEditor.VisualScriptEditorView"
<UserControl x:Class="Stride.Assets.Presentation.AssetEditors.VisualScriptEditor.VisualScriptEditorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -13,7 +13,7 @@
xmlns:sd="http://schemas.stride3d.net/xaml/presentation"
Focusable="True"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:VisualScriptEditorViewModel}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@ -227,9 +227,9 @@
</ResourceDictionary>
</UserControl.Resources>
<i:Interaction.Behaviors>
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Delete" Command="{Binding Editor.VisibleMethod.DeleteSelectionCommand}" />
<sd:CommandBindingBehavior RoutedCommand="ApplicationCommands.Delete" Command="{Binding VisibleMethod.DeleteSelectionCommand}" />
</i:Interaction.Behaviors>
<Grid DataContext="{Binding Editor}" d:DataContext="{d:DesignInstance local:VisualScriptEditorViewModel}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>