Can I bind a WPF control to a field's property?

前端 未结 3 1094
闹比i
闹比i 2020-12-11 18:43

Because I needed to split some functionality between classes, I\'ve arrived at the following situation

xaml code



        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-11 19:30

    You can't yet (in WPF Version 4.5 you can bind to a static property). But you can create your property in App.xaml.cs

    public partial class App : Application
    {
        public bool MyBoolean { get; set; }
    }
    

    and bind from everywhere.

    
    

提交回复
热议问题