Skip to content

Instantly share code, notes, and snippets.

@atzimler
Created April 25, 2017 11:35
Show Gist options
  • Select an option

  • Save atzimler/5495a5628caf0c845ff5aec8f7d98edd to your computer and use it in GitHub Desktop.

Select an option

Save atzimler/5495a5628caf0c845ff5aec8f7d98edd to your computer and use it in GitHub Desktop.
public static readonly DependencyProperty AProperty =
DependencyProperty.Register(nameof(A),
typeof(int),
typeof(AddCalculation),
new PropertyMetadata(0, AddNumbers));
private static void AddNumbers(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ac = (AddCalculation)d;
ac.SetValue(ResultPropertyKey, ac.A + ac.B);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment