Skip to content

Commit

Permalink
Made SilverlightCanvas implement ICanvas
Browse files Browse the repository at this point in the history
  • Loading branch information
praeclarum committed May 18, 2012
1 parent b06a01a commit cd785cd
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/SilverlightGraphicsCanvas.cs
Expand Up @@ -59,7 +59,7 @@ public class SilverlightGraphicsCanvas : Canvas, ICanvas
int _drawCount; int _drawCount;
DateTime _lastThrottleTime = DateTime.Now; DateTime _lastThrottleTime = DateTime.Now;


public CanvasDelegate Delegate { get; set; } public CanvasContent Content { get; set; }


public SilverlightGraphicsCanvas() public SilverlightGraphicsCanvas()
{ {
Expand Down Expand Up @@ -194,7 +194,7 @@ void DrawTick(object sender, DispatcherTimerTickEventArgs e)
return; return;
} }


var del = Delegate; var del = Content;
if (del == null) return; if (del == null) return;


if (_graphics == null) { if (_graphics == null) {
Expand Down Expand Up @@ -333,8 +333,8 @@ void SilverlightGraphicsCanvas_PointerPressed(DispatcherTimerTickEventArgs sende


_activeTouches[handle] = touch; _activeTouches[handle] = touch;


if (Delegate != null) { if (Content != null) {
Delegate.TouchesBegan(new[] { touch }); Content.TouchesBegan(new[] { touch });
} }
} }


Expand Down Expand Up @@ -366,8 +366,8 @@ void SilverlightGraphicsCanvas_PointerMoved(DispatcherTimerTickEventArgs sender,
touch.CanvasLocation = loc; touch.CanvasLocation = loc;
touch.Time = DateTime.Now; touch.Time = DateTime.Now;


if (Delegate != null) { if (Content != null) {
Delegate.TouchesMoved (new[] { touch }); Content.TouchesMoved (new[] { touch });
} }
} }
} }
Expand All @@ -383,8 +383,8 @@ void SilverlightGraphicsCanvas_PointerReleased(object sender, PointerEventArgs e
var touch = _activeTouches[handle]; var touch = _activeTouches[handle];
_activeTouches.Remove(handle); _activeTouches.Remove(handle);


if (Delegate != null) { if (Content != null) {
Delegate.TouchesEnded(new[] { touch }); Content.TouchesEnded(new[] { touch });
} }
} }
} }
Expand All @@ -398,8 +398,8 @@ void SilverlightGraphicsCanvas_PointerCanceled (DispatcherTimerTickEventArgs sen
var touch = _activeTouches[handle]; var touch = _activeTouches[handle];
_activeTouches.Remove (handle); _activeTouches.Remove (handle);


if (Delegate != null) { if (Content != null) {
Delegate.TouchesCancelled (new[] { touch }); Content.TouchesCancelled (new[] { touch });
} }
} }
} }
Expand All @@ -413,8 +413,8 @@ void SilverlightGraphicsCanvas_PointerExited (DispatcherTimerTickEventArgs sende
var touch = _activeTouches[handle]; var touch = _activeTouches[handle];
_activeTouches.Remove (handle); _activeTouches.Remove (handle);


if (Delegate != null) { if (Content != null) {
Delegate.TouchesCancelled (new[] { touch }); Content.TouchesCancelled (new[] { touch });
} }
} }
} }
Expand Down

0 comments on commit cd785cd

Please sign in to comment.