mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
修复了脚本语言中构造器赋值的 bug
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
|
||||
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
|
||||
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
|
||||
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
|
||||
d:DataContext="{d:DesignInstance vm:ScriptNodeControlViewModel}"
|
||||
mc:Ignorable="d"
|
||||
MinWidth="50">
|
||||
@@ -56,7 +57,17 @@
|
||||
<Button Content="执行" Margin="3,0,1,0" Command="{Binding CommandExecuting}" Height="17.2"></Button>
|
||||
</StackPanel>
|
||||
<themes:MethodDetailsControl Grid.Row="1" x:Name="MethodDetailsControl" MethodDetails="{Binding NodeModel.MethodDetails}" NodeViewModel="{Binding}"/>
|
||||
<TextBox Grid.Row="2" MinHeight="20" MinWidth="100" MaxWidth="270" TextWrapping="Wrap" AcceptsReturn="True" IsEnabled="{Binding IsEnabledOnView}" Text="{Binding Script}"></TextBox>
|
||||
<!--<TextBox Grid.Row="2" MinHeight="20" MinWidth="100" TextWrapping="Wrap" AcceptsReturn="True" IsEnabled="{Binding IsEnabledOnView}" Text="{Binding Script}"></TextBox>-->
|
||||
|
||||
<avalonEdit:TextEditor Grid.Row="2"
|
||||
x:Name="codeEditor"
|
||||
FontFamily="Consolas"
|
||||
FontSize="12"
|
||||
SyntaxHighlighting="C#"
|
||||
TextChanged="codeEditor_TextChanged"
|
||||
ShowLineNumbers="True"
|
||||
Margin="10"/>
|
||||
|
||||
<Grid Grid.Row="3" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50"/>
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace Serein.Workbench.Node.View
|
||||
DataContext = viewModel;
|
||||
viewModel.NodeModel.DisplayName = "[脚本节点]";
|
||||
InitializeComponent();
|
||||
codeEditor.Text = viewModel.Script ?? string.Empty; // 更新代码编辑器内容
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +97,11 @@ namespace Serein.Workbench.Node.View
|
||||
return [];
|
||||
}
|
||||
|
||||
private void codeEditor_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.Script = codeEditor.Text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user