Setting a custom property within a WPF/Silverlight page

后端 未结 10 1230
萌比男神i
萌比男神i 2020-12-14 15:10

This sounds like it should be simple. I have a Page declared in XAML in the normal way (i.e. with "Add new item...") and it has a custom property. I\'

10条回答
  •  太阳男子
    2020-12-14 15:24

    You can work with normal property without Dependency property if you create a Base class for your Page.

    public class BaseWindow : Window
    {
       public string MyProperty { get; set; }
    }
    
    
    
    
    

    And it works even though MyProperty is not a Dependency or Attached.

提交回复
热议问题