Skip to content

Instantly share code, notes, and snippets.

@kg
Forked from jwatte/Single Reactive Property
Last active December 13, 2015 19:28
Show Gist options
  • Save kg/4962353 to your computer and use it in GitHub Desktop.
Save kg/4962353 to your computer and use it in GitHub Desktop.
public class DrawingFeature : Feature {
private Drawing drawing_;
public event EventHandler DrawingChanged;
private NonBlockingMutex inDrawingChanged_;
protected void OnDrawingChanged()
{
using (inDrawingChanged_.AcquireOrThrow()) {
if (DrawingChanged != null) {
DrawingChanged(this, EventArgs.Empty);
}
OnFeatureChanged();
}
}
public Drawing Drawing {
get
{
return drawing_;
}
set
{
drawing_ = value;
OnDrawingChanged();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment