Skip to content

Instantly share code, notes, and snippets.

@thomaslevesque
Created March 12, 2014 18:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save thomaslevesque/e39a337ba90665e0543b to your computer and use it in GitHub Desktop.
private IDisposable _contentWatcher;
private void StartWatchingContent()
{
_contentWatcher = myControl.WatchProperty("Content", myControl_ContentChanged);
}
private void StopWatchingContent()
{
_contentWatcher.Dispose();
}
private void myControl_ContentChanged(object sender, DependencyPropertyChangedEventArgs e)
{
MessageBox.Show("Content has changed!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment