-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
193 additions
and
34 deletions.
There are no files selected for viewing
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
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
8 changes: 2 additions & 6 deletions
8
...uderenajel/KefalurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel.Skia.Gtk/Hack.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
using Microsoft.Maui.Graphics.UnoAbstract; | ||
using Microsoft.UI.Xaml; | ||
using SamplesApp; | ||
|
||
namespace KefalurcilaybelJallbuderenajel.Skia.Gtk; | ||
|
||
public class Hack : IHack | ||
{ | ||
public FrameworkElement Create() | ||
{ | ||
return new GraphicsCanvasElement() | ||
{ | ||
Width = 200, | ||
Height = 100 | ||
}; | ||
return new HackElement(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...jel/KefalurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel.Skia.Gtk/HackElement.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Microsoft.Maui.Graphics.UnoAbstract; | ||
using SamplesApp; | ||
|
||
namespace KefalurcilaybelJallbuderenajel.Skia.Gtk; | ||
|
||
public partial class HackElement : GraphicsCanvasElement, IDrawableNotify | ||
{ | ||
} |
2 changes: 2 additions & 0 deletions
2
...KefalurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel.Skia.Gtk/HackInitializer.cs
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
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
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
8 changes: 2 additions & 6 deletions
8
...enajel/KefalurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel.Skia.WPF/Wpf/Hack.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
using Microsoft.Maui.Graphics.UnoAbstract; | ||
using Microsoft.UI.Xaml; | ||
using SamplesApp; | ||
|
||
namespace KefalurcilaybelJallbuderenajel.WPF; | ||
|
||
public class Hack : IHack | ||
{ | ||
public FrameworkElement Create() | ||
{ | ||
return new GraphicsCanvasElement() | ||
{ | ||
Width = 200, | ||
Height = 100 | ||
}; | ||
return new HackElement(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...KefalurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel.Skia.WPF/Wpf/HackElement.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Microsoft.Maui.Graphics.UnoAbstract; | ||
using SamplesApp; | ||
|
||
namespace KefalurcilaybelJallbuderenajel.WPF; | ||
|
||
public partial class HackElement : GraphicsCanvasElement, IDrawableNotify | ||
{ | ||
} |
2 changes: 2 additions & 0 deletions
2
...lurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel.Skia.WPF/Wpf/HackInitializer.cs
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
6 changes: 0 additions & 6 deletions
6
...llbuderenajel/KefalurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel/HackHelper.cs
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...belJallbuderenajel/KefalurcilaybelJallbuderenajel/KefalurcilaybelJallbuderenajel/IHack.cs
This file was deleted.
Oops, something went wrong.
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
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
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
45 changes: 45 additions & 0 deletions
45
...ajel/KefalurcilaybelJallbuderenajel/Microsoft.Maui.Graphics.UnoAbstract/GraphicsCanvas.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Microsoft.Maui.Graphics.UnoAbstract; | ||
|
||
public class GraphicsCanvas : Canvas, IDrawableNotify | ||
{ | ||
public GraphicsCanvas() | ||
{ | ||
SizeChanged += OnSizeChanged; | ||
var frameworkElement = HackHelper.Hack?.Create(); | ||
|
||
if (frameworkElement != null) | ||
{ | ||
IDrawableNotify drawableNotify = (IDrawableNotify) frameworkElement; | ||
drawableNotify.Draw += OnDraw; | ||
Children.Add(frameworkElement); | ||
FrameworkElement = frameworkElement; | ||
} | ||
else | ||
{ | ||
var textBlock = new TextBlock() | ||
{ | ||
Text = "Not Supported" | ||
}; | ||
|
||
FrameworkElement = textBlock; | ||
} | ||
} | ||
|
||
private FrameworkElement FrameworkElement { get; } | ||
|
||
private void OnDraw(object? sender, ICanvas e) | ||
{ | ||
Draw?.Invoke(this, e); | ||
} | ||
|
||
private void OnSizeChanged(object sender, SizeChangedEventArgs e) | ||
{ | ||
FrameworkElement.Width = e.NewSize.Width; | ||
FrameworkElement.Height = e.NewSize.Height; | ||
} | ||
|
||
public event EventHandler<ICanvas>? Draw; | ||
} |
6 changes: 6 additions & 0 deletions
6
...erenajel/KefalurcilaybelJallbuderenajel/Microsoft.Maui.Graphics.UnoAbstract/HackHelper.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Microsoft.Maui.Graphics.UnoAbstract; | ||
|
||
public static class HackHelper | ||
{ | ||
public static IHack? Hack { set; get; } | ||
} |
6 changes: 6 additions & 0 deletions
6
...jel/KefalurcilaybelJallbuderenajel/Microsoft.Maui.Graphics.UnoAbstract/IDrawableNotify.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Microsoft.Maui.Graphics.UnoAbstract; | ||
|
||
public interface IDrawableNotify | ||
{ | ||
event EventHandler<ICanvas>? Draw; | ||
} |
8 changes: 8 additions & 0 deletions
8
...llbuderenajel/KefalurcilaybelJallbuderenajel/Microsoft.Maui.Graphics.UnoAbstract/IHack.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Microsoft.UI.Xaml; | ||
|
||
namespace Microsoft.Maui.Graphics.UnoAbstract; | ||
|
||
public interface IHack | ||
{ | ||
FrameworkElement Create(); | ||
} |
48 changes: 48 additions & 0 deletions
48
...uderenajel/Microsoft.Maui.Graphics.UnoAbstract/Microsoft.Maui.Graphics.UnoAbstract.csproj
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) or '$(EnableWindowsTargeting)' == 'true'">$(TargetFrameworks);$(DotNetVersion)-windows10.0.19041</TargetFrameworks> | ||
<TargetFrameworks>$(TargetFrameworks);$(DotNetVersion);</TargetFrameworks> | ||
<TargetFrameworks Condition="'$(OverrideTargetFramework)'!=''">$(OverrideTargetFramework)</TargetFrameworks> | ||
<!-- Ensures the .xr.xml files are generated in a proper layout folder --> | ||
<GenerateLibraryLayout>true</GenerateLibraryLayout> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Uno.WinUI" /> | ||
<PackageReference Include="Microsoft.Maui.Graphics" /> | ||
</ItemGroup> | ||
<Choose> | ||
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'"> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.WindowsAppSDK" /> | ||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!-- | ||
If you encounter this error message: | ||
error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll. | ||
Please update to a newer .NET SDK in order to reference this assembly. | ||
This means that the two packages below must be aligned with the "build" version number of | ||
the "Microsoft.Windows.SDK.BuildTools" package above, and the "revision" version number | ||
must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref. | ||
--> | ||
<!-- <FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.22621.28" /> | ||
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.22621.28" /> --> | ||
</ItemGroup> | ||
</When> | ||
<Otherwise> | ||
<ItemGroup> | ||
<Content Include="Assets\**" /> | ||
<Page Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" /> | ||
<Compile Update="**\*.xaml.cs"> | ||
<DependentUpon>%(Filename)</DependentUpon> | ||
</Compile> | ||
<PriResource Include="**\*.resw" /> | ||
</ItemGroup> | ||
</Otherwise> | ||
</Choose> | ||
<ItemGroup> | ||
<UpToDateCheckInput Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" /> | ||
</ItemGroup> | ||
</Project> |
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
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