Skip to content

Commit

Permalink
chore: Remove IXamlType2 from Uno.WinUI, Tizen build
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Jun 7, 2022
1 parent 03cf67b commit 184e5f0
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
22 changes: 22 additions & 0 deletions src/Uno.UI.Runtime.Skia.Tizen/TizenHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
using Uno.Extensions.System;
using Windows.System.Profile.Internal;
using System.ComponentModel;
using Windows.UI.Core;
using Uno.UI.Xaml.Core;

namespace Uno.UI.Runtime.Skia
{
Expand Down Expand Up @@ -99,6 +101,26 @@ void CreateApp(ApplicationInitializationCallbackParams _)
_tizenApplication.Window.ScreenSize.Width,
_tizenApplication.Window.ScreenSize.Height));
WinUI.Application.StartWithArguments(CreateApp);
WUX.Window.Current.Activated += Current_Activated;
}

private void Current_Activated(object sender, WindowActivatedEventArgs e)
{
var xamlRoot = CoreServices.Instance
.ContentRootCoordinator?
.CoreWindowContentRoot?
.XamlRoot;

if (xamlRoot is null)
{
throw new InvalidOperationException("XamlRoot was not properly initialized");
}

xamlRoot.InvalidateRender += _tizenApplication!.Canvas.InvalidateRender;

// Force initial render
_tizenApplication!.Canvas.InvalidateRender();
WUX.Window.Current.Activated -= Current_Activated;
}
}
}
4 changes: 2 additions & 2 deletions src/Uno.UI.Runtime.Skia.Tizen/UnoCanvas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public UnoCanvas(EvasObject parent) : base(parent)
{
PaintSurface += UnoCanvas_PaintSurface;
Resized += UnoCanvas_Resized;

WUX.Window.InvalidateRender += () => Invalidate();
}

internal void InvalidateRender() => Invalidate();

private void UnoCanvas_Resized(object sender, EventArgs e)
{
var c = (SKCanvasView)sender;
Expand Down
1 change: 0 additions & 1 deletion src/Uno.UI.Runtime.Skia.Wpf/WpfHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,3 @@ private void InvalidateOverlays()
WpfCanvas? IWpfHost.NativeOverlayLayer => NativeOverlayLayer;
}
}
DesktopWindowXamlSource
8 changes: 8 additions & 0 deletions src/Uno.UI/UI/Xaml/Markup/IXamlType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ public partial interface IXamlType
/// </summary>
IXamlType BaseType { get; }

#if HAS_UNO_WINUI // In WUX this is in IXamlType2
/// <summary>
/// Gets the IXamlType for the boxed type of the XAML type.
/// Determination of this value is based on the underlying type for core types.
/// </summary>
IXamlType BoxedType { get; }
#endif

/// <summary>
/// Gets the IXamlMember information for the XAML content property of this IXamlType.
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion src/Uno.UI/UI/Xaml/Markup/IXamlType2.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace Windows.UI.Xaml.Markup;
#if !HAS_UNO_WINUI
namespace Windows.UI.Xaml.Markup;

/// <summary>
/// Provides the means to report XAML-type system specifics about XAML types. Using this interface contract,
Expand All @@ -12,3 +13,4 @@ public partial interface IXamlType2 : IXamlType
/// </summary>
IXamlType BoxedType { get; }
}
#endif

0 comments on commit 184e5f0

Please sign in to comment.