Ble*_*ter 1 c# xaml windows-10 uwp
我有一个DownloadModel包含两个属性.我想在一个单独的节目中显示这两个属性的摘要TextBlock
<TextBlock Text="{x:Bind DownloadModel.Part1.Progress, Mode=OneWay}"/>
Run Code Online (Sandbox Code Playgroud)
有没有办法通过Download.Part1.Progress,Download.Part2.Progress然后一起显示两者的摘要TextBlock?
(如果有可能这样做Binding而不是x:Bind那样也会好的)
谢谢.
你实际上可以Run在里面使用TextBlock.你可以像这样使用它:
例如,我有这两个字符串:
private string FirstText = "This is the first text.";
private string SecondText = "This is the second text.";
Run Code Online (Sandbox Code Playgroud)
我在我的XAML中有这个:
<TextBlock Foreground="Black">
<Run Text="{x:Bind FirstText}"/>
<Run Text="{x:Bind SecondText}"/>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)
这就是应用程序的样子:
希望能帮助到你!