Skip to content

Commit

Permalink
EditorCanvas has a Win2D canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
iconstudio committed Oct 3, 2023
1 parent 5806b3f commit 61f025b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Editor/TestEditor/Infrastructures/EditorCanvas.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="TestEditor.EditorCanvas"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestEditor"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
x:Class="TestEditor.EditorCanvas"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestEditor"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:canvas="using:Microsoft.Graphics.Canvas.UI.Xaml"
mc:Ignorable="d"
DataContext="{Binding RelativeSource={RelativeSource Self}}">

<Grid>
<Grid
HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
MinHeight="226" Padding="5">

</Grid>
<canvas:CanvasControl x:Name="Canvas"
Draw="{Binding Draw}">
</canvas:CanvasControl>
</Grid>
</UserControl>
6 changes: 6 additions & 0 deletions Editor/TestEditor/Infrastructures/EditorCanvas.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
using Microsoft.Graphics.Canvas.UI.Xaml;

using Windows.Foundation;

namespace TestEditor
{
public sealed partial class EditorCanvas : UserControl
{
public TypedEventHandler<CanvasControl, CanvasDrawEventArgs> Draw { get; set; }

public EditorCanvas()
{
InitializeComponent();
Expand Down

0 comments on commit 61f025b

Please sign in to comment.