首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DependencyProperty未更新BusyIndicator

DependencyProperty未更新BusyIndicator
EN

Stack Overflow用户
提问于 2010-08-23 23:29:35
回答 1查看 442关注 0票数 0

我正在尝试将我的子窗口上定义的IsBusy布尔型属性连接到silverlight ria services codegen提供的BusyIndicator。

下面是busy属性:

代码语言:javascript
复制
    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));

下面是它在XAML中的用法

代码语言:javascript
复制
<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.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>

我的第二个想法是我没有正确地注册DependencyProperty。有人能对此发表评论吗?我正在寻找一种最普通的、未扩展的XAML方法来处理这个问题。

我使用SetValue为IsBusy属性赋值。

顺便说一句,对于任何建议我绑定到数据源IsBusy属性的人,我正在通过连接到ERP系统的web服务来收集这些数据。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-11-17 04:09:07

我需要实现INotifyPropertyChanged,否则它将停留在初始元数据值null。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3549053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档