M.Azad
M.Azad

Reputation: 3763

How to find out my dependency property changed ?

I have a Dependency Property like this

public static readonly DependencyProperty ShowTooltipProperty =
 DependencyProperty.Register(
"ShowTooltip",
  typeof(bool),
  typeof(customtextbox),
  new FrameworkPropertyMetadata(false));
 public bool ShowTooltip
    {
        get
        { return (string)GetValue(ShowTooltipProperty);}
        set
        {SetValue(ShowTooltipProperty, value); }
 } 

I want when my property changed i call a method.How to i find out my property changed?

Upvotes: 1

Views: 162

Answers (1)

brunnerh
brunnerh

Reputation: 184441

There is an overload for FrameworkPropertyMetadata which allows you to specify a property changed callback.

Upvotes: 3

Related Questions