XAML Binding on Dependency Property

前端 未结 1 798
谎友^
谎友^ 2021-01-21 20:01

I am currently working on a WPF TimePicker Control. The control inherits a TextBox and it has a MaskedTexProvider which displays a TimeSpan in the following format:

\"HH

相关标签:
1条回答
  • 2021-01-21 20:26

    When you use a DependencyProperty, you need to use it's implementation instead of your INotifyPropertyChanged style implementation for properties. This means no backing field (it's handled via the DP mechanisms), and using property changed callbacks for change handling or value coersion instead of doing it in the property setter.

    I recommend looking at the Dependency Property Overview on MSDN for details. In particular, you'll need to look at how to implement a Dependency Property as well as Callbacks and Validation.

    0 讨论(0)
提交回复
热议问题