【发布时间】:2012-09-13 00:02:09
【问题描述】:
我在 wpf 中有一些代码,因为我使用了 busyindicator 并且我设置了 datatemplete 现在我的问题是我在我的应用程序中使用了 mvvm 模式,我想在上面使用 busyindicator 但我不知道如何在里面绑定文本块busyindicaor 数据模板。我的代码看起来像
<extended:BusyIndicator Name="_busyIndicator">
<extended:BusyIndicator.BusyContentTemplate>
<DataTemplate>
<StackPanel Margin="4">
<TextBlock Text="Downloading Email" FontWeight="Bold" HorizontalAlignment="Center" Name="Dhaval"/>
<StackPanel Margin="4">
<TextBlock Text="Downloading message 4/10..."/>
<ProgressBar Value="40" Height="15" x:Name="Progress_Dhaval"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</extended:BusyIndicator.BusyContentTemplate>
【问题讨论】:
-
在模板中绑定或者从模板中绑定完全一样,你只要写
Text="{Binding YourProperty}"=) -
在我编写普通绑定时它不起作用。
-
我在您的数据模板中看不到任何绑定
-
假设 textblock 文本属性现在已绑定......告诉我。
标签: c# wpf binding busyindicator