开发者

DependencyProperty not updating BusyIndicator

I'm attempting to connect a IsBusy boolean property defined on my child window to a BusyIndicator provided by silverlight ria services codegen.

Here is the busy property:

    public bool IsBusy
    {
        get { return (bool)this.GetValue(IsBusyProperty); }
        set { this.SetValue(IsBusyProperty, value); }
    }

    public static readonly DependencyProperty IsBusyProperty = DependencyProperty.Register(
        "IsBusy", typeof(bool), typeof(FindPlant), new PropertyMetadata(false));

and here is it's use in XAML

<controls:ChildWindow xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  
           xmlns:my="clr-namespace:Locators.Controls"  
           x:Class="Locators.Views.FindPlant"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft开发者_如何学C.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="500" Height="600" 
           Title="Choose a plant...">
    <my:BusyIndicator x:Name="LoadingIndicator" IsBusy="{Binding Path=IsBusy}" >
       <!--... content omitted ...-->
    </my:BusyIndicator>
</controls:ChildWindow>

My second thought is that I haven't registered the DependencyProperty correctly. Can anybody comment on this? I'm looking for the most vanilla, un-extended XAML way to handle this.

I'm using SetValue to assign to the IsBusy property.

BTW, to anybody who suggests I bind to a datasource IsBusy property, I am collecting this data via a web service connecting to an ERP system.


I needed to implement INotifyPropertyChanged, otherwise it stays at the initial metadata value of null.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜