C# 如何更改文本块中的跨距文本?
如何更改C# 如何更改文本块中的跨距文本?,c#,xaml,uwp,C#,Xaml,Uwp,如何更改span文本,例如,如果我有如下XAML代码: <text block x:name="tb1"> <span x:name="span1">this is the first span/> <span x:name="span2">this is the span I want to change</span.> </text> 但是他们没有帮助。使用Run在Span中显示文本。下
span
文本,例如,如果我有如下XAML代码:
<text block x:name="tb1">
<span x:name="span1">this is the first span/>
<span x:name="span2">this is the span I want to change</span.>
</text>
但是他们没有帮助。使用
Run
在Span
中显示文本。下面是一个代码示例
<TextBlock>
<Span>
<Run Name="MyText1" Text="My Text 1"/>
</Span>
</TextBlock>
要了解有关TextBlock
的更多信息,请执行以下操作:
<TextBlock>
<Span>
<Run Name="MyText1" Text="My Text 1"/>
</Span>
</TextBlock>
MyText1.Text = "Changed Text";