How to bind in XAML to a static property?

前端 未结 3 813
挽巷
挽巷 2021-01-25 02:47

I am trying to bind a static property of a different class to the Text Property of a TextBlock and can get the binding to work, but there\'s is no update to the Text Property wh

3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-25 03:39

    In case this helps anyone else out I figured I'd post my final solution which works quite well for my purpose.

    Since it turns out not to be possible without .NET 4.5 I ended up changing the property and methods to no longer be static and changed the class to a singleton then implemented INotfiyPropertyChanged and changed the XAML binding source to x:Static instead of creating an instance in Window.Resources.

提交回复
热议问题