refactor: 重构设置窗口逻辑

This commit is contained in:
2025-01-29 02:43:45 +08:00
parent 38ce3b2071
commit 1a4ad9a18f
2 changed files with 5 additions and 10 deletions

View File

@@ -16,7 +16,8 @@
</Grid.ColumnDefinitions>
<Label Grid.Column="0">监听地址</Label>
<TextBox Grid.Column="1"
Text="{Binding ListenAddress}" />
Text="{Binding Item.ListenAddress}"
IsEnabled="False" />
</Grid>
<Grid Margin="4">
<Grid.ColumnDefinitions>
@@ -24,9 +25,10 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0">监听端口</Label>
<TextBox Grid.Column="1">
<TextBox Grid.Column="1"
IsEnabled="False">
<TextBox.Text>
<Binding Path="ListenPort" UpdateSourceTrigger="PropertyChanged">
<Binding Path="Item.ListenPort" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<rules:PortValidationRule />
</Binding.ValidationRules>