Permalink
Browse files

Made SilverlightCanvas implement ICanvas

  • Loading branch information...
1 parent b06a01a commit cd785cd588a277520084d92888dd0454042b8285 @praeclarum committed May 18, 2012
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/SilverlightGraphicsCanvas.cs
@@ -59,7 +59,7 @@ public class SilverlightGraphicsCanvas : Canvas, ICanvas
int _drawCount;
DateTime _lastThrottleTime = DateTime.Now;
- public CanvasDelegate Delegate { get; set; }
+ public CanvasContent Content { get; set; }
public SilverlightGraphicsCanvas()
{
@@ -194,7 +194,7 @@ void DrawTick(object sender, DispatcherTimerTickEventArgs e)
return;
}
- var del = Delegate;
+ var del = Content;
if (del == null) return;
if (_graphics == null) {
@@ -333,8 +333,8 @@ void SilverlightGraphicsCanvas_PointerPressed(DispatcherTimerTickEventArgs sende
_activeTouches[handle] = touch;
- if (Delegate != null) {
- Delegate.TouchesBegan(new[] { touch });
+ if (Content != null) {
+ Content.TouchesBegan(new[] { touch });
}
}
@@ -366,8 +366,8 @@ void SilverlightGraphicsCanvas_PointerMoved(DispatcherTimerTickEventArgs sender,
touch.CanvasLocation = loc;
touch.Time = DateTime.Now;
- if (Delegate != null) {
- Delegate.TouchesMoved (new[] { touch });
+ if (Content != null) {
+ Content.TouchesMoved (new[] { touch });
}
}
}
@@ -383,8 +383,8 @@ void SilverlightGraphicsCanvas_PointerReleased(object sender, PointerEventArgs e
var touch = _activeTouches[handle];
_activeTouches.Remove(handle);
- if (Delegate != null) {
- Delegate.TouchesEnded(new[] { touch });
+ if (Content != null) {
+ Content.TouchesEnded(new[] { touch });
}
}
}
@@ -398,8 +398,8 @@ void SilverlightGraphicsCanvas_PointerCanceled (DispatcherTimerTickEventArgs sen
var touch = _activeTouches[handle];
_activeTouches.Remove (handle);
- if (Delegate != null) {
- Delegate.TouchesCancelled (new[] { touch });
+ if (Content != null) {
+ Content.TouchesCancelled (new[] { touch });
}
}
}
@@ -413,8 +413,8 @@ void SilverlightGraphicsCanvas_PointerExited (DispatcherTimerTickEventArgs sende
var touch = _activeTouches[handle];
_activeTouches.Remove (handle);
- if (Delegate != null) {
- Delegate.TouchesCancelled (new[] { touch });
+ if (Content != null) {
+ Content.TouchesCancelled (new[] { touch });
}
}
}

0 comments on commit cd785cd

Please sign in to comment.