我正在尝试在使用 WPF 编写的 c# 表单中编辑源代码,并且在其中不直接声明属性,而是从下面的引用中使用,我从 WPF 表单中放置了一些行。
<Grid>
<StackPanel>
<Label>
<LocText ResourceIdentifierKey="CustomerName" Suffix=":"/>
</Label>
<TextBox HorizontalAlignment="Left" MinWidth="200" Text="{Binding Name}" />
<Label>
<LocText ResourceIdentifierKey="GroupCode" Suffix=":"/>
</Label>
<ComboBox HorizontalAlignment="Left" MinWidth="150" Text="{Binding GroupCode,Mode=TwoWay}"
ItemsSource="{Binding GroupCodes}" IsEditable="True"/>
<Label>
<LocText ResourceIdentifierKey="PhoneNumber" Suffix=":"/>
</Label>
<Common:MaskedTextBox HorizontalAlignment="Left" MinWidth="100" InputMask="{Binding PhoneNumberInputMask}"
PromptChar=" " UnmaskedText="{Binding PhoneNumber, Mode=TwoWay, UpdateSourceTrigger=LostFocus, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}" />
<Label>
<LocText ResourceIdentifierKey="Address" Suffix=":"/>
</Label>
<TextBox HorizontalAlignment="Left" MinWidth="200" MinHeight="55" Text="{Binding Address}"
AcceptsReturn="True" />
<Label>
<LocText ResourceIdentifierKey="Note" Suffix=":"/>
</Label>
<TextBox HorizontalAlignment="Left" MinWidth="200" MinHeight="55" Text="{Binding Note}"
AcceptsReturn="True" />
<CheckBox Margin="0,5,0,0" IsChecked="{Binding InternalAccount}">
<LocText ResourceIdentifierKey="InternalAccount"/>
</CheckBox>
<Button HorizontalAlignment="Left" Margin="0,10" MinWidth="70" Content="{Binding SaveCommand.Caption}"
Command="{Binding SaveCommand}" />
<Label Content="{Binding Error}" Foreground="Red" />
</StackPanel>
</Grid>
如何编辑属性?
例如,我想更改 Lable 的内容。