Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
swdev:dotnet:wpf:dependency_properties [2011/04/28 09:14]
smayr [Example 2]
swdev:dotnet:wpf:dependency_properties [2013/01/25 09:16] (current)
smayr [Example 1]
Line 57: Line 57:
     DependencyObject source, DependencyPropertyChangedEventArgs e)      DependencyObject source, DependencyPropertyChangedEventArgs e) 
   {   {
-       bool control = source as bool;+       Button control = source as Button;
    
        // Put some update logic here...        // Put some update logic here...
-       control = (bool)e.NewValue; +       control.IsCancel = (bool)e.NewValue; 
-       if (control == true)+       if (control.IsCancel == true)
        {        {
            // do something            // do something
Line 99: Line 99:
  
     // If employee id is greater than 1000 then make it 1000     // If employee id is greater than 1000 then make it 1000
-    static void EmpIdCallBack(DependencyObject d, +    static void EmpIdCallBack(DependencyObject d, DependencyPropertyChangedEventArgs args)
-        DependencyPropertyChangedEventArgs args)+
     {     {
         Employee emp = (Employee)d;         Employee emp = (Employee)d;