Created
October 1, 2015 19:04
-
-
Save SebastianStehle/4e04c78102849cc4763a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class CanvasControlWrapper : ICanvasControl | |
{ | |
public event EventHandler<CanvasDrawEventArgs> Draw; | |
private void OnDraw(CanvasDrawEventArgs e) | |
{ | |
Draw?.Invoke(this, e); | |
} | |
public CanvasControlWrapper(CanvasControl canvasControl) | |
{ | |
canvasControl.Draw += (sender, args) => | |
{ | |
OnDraw(args); | |
}; | |
} | |
} | |
class Win2DRenderer | |
{ | |
private void Canvas_Draw(object sender, CanvasDrawEventArgs args) | |
{ | |
Render(args.DrawingSession); | |
} | |
private void Render(CanvasDrawingSession session) | |
{ | |
if (layout != null) | |
{ | |
session.Transform = transform; | |
// Render it | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment