我正在尝试做一个按钮,它有一个变量的内容。有没有办法让按钮的内容变成RichTextBox,或者有没有更好的方法来尝试一下?我只能为此目的编辑XAML代码,不能更改后面的C#代码。
我的RichTextBox是一个从外部引入的变量,需要按钮内容来做同样的事情。
<RichTextBox Height="30" Width="300" xmlns:custom="clr-namespace:Tecan.VisionX.TouchTools.RUP.AttachedProperties;assembly=Tecan.VisionX.TouchTools.RUP" custom:AttachedUIProperties.VariableName="XYZ" custom:AttachedUIProperties.KeyboardMode="None" Margin="0,0,0,0"/>
<RadioButton x:Name="ABC" Content="(***I want this to be an outside variable***)" xmlns:custom="clr-namespace:Tecan.VisionX.TouchTools.RUP.AttachedProperties;assembly=Tecan.VisionX.TouchTools.RUP" custom:AttachedUIProperties.VariableName="ABC" Margin="35,175,0,0"/>发布于 2020-12-29 00:20:53
我建议你创建一个自定义的用户控件。这个控件应该有一个富文本框和一个单选按钮。然后,您应该创建一个usercontrol,然后使用内容的依赖属性。
https://stackoverflow.com/questions/65479666
复制相似问题