diff --git a/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets b/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
index b077c57f7e..a9b30bac85 100644
--- a/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
+++ b/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
@@ -59,6 +59,12 @@
+
+
+
+
+
+
@@ -99,6 +105,11 @@
$(DefineConstants);MACCATALYST;IOS
+
+
+ $(DefineConstants);TIZEN
+
+
@@ -120,4 +131,8 @@
+
+
+
+
diff --git a/.nuspec/Microsoft.Maui.Controls.SingleProject.props b/.nuspec/Microsoft.Maui.Controls.SingleProject.props
index 52df01095c..2e565e39a9 100644
--- a/.nuspec/Microsoft.Maui.Controls.SingleProject.props
+++ b/.nuspec/Microsoft.Maui.Controls.SingleProject.props
@@ -16,4 +16,10 @@
<_MauiUsingDefaultRuntimeIdentifier>true
+
+
+
+
+
+
diff --git a/.nuspec/Microsoft.Maui.Controls.SingleProject.targets b/.nuspec/Microsoft.Maui.Controls.SingleProject.targets
index 9f2e22d371..484bfb0e70 100644
--- a/.nuspec/Microsoft.Maui.Controls.SingleProject.targets
+++ b/.nuspec/Microsoft.Maui.Controls.SingleProject.targets
@@ -22,6 +22,10 @@
false
$(PlatformsProjectFolder)Windows\
$([MSBuild]::EnsureTrailingSlash('$(WindowsProjectFolder)'))
+
+ false
+ $(PlatformsProjectFolder)Tizen\
+ $([MSBuild]::EnsureTrailingSlash('$(TizenProjectFolder)'))
@@ -29,6 +33,7 @@
+
@@ -57,6 +62,12 @@
<_SingleProjectWindowsExcludes>$(WindowsProjectFolder)/**/.*/**
+
+ $(TizenProjectFolder)tizen-manifest.xml
+ $(TizenProjectFolder)res
+ $(TizenProjectFolder)shared
+
+
<_MauiXamlToRemove
@@ -127,4 +141,4 @@
-
\ No newline at end of file
+
diff --git a/.nuspec/Microsoft.Maui.Resizetizer.targets b/.nuspec/Microsoft.Maui.Resizetizer.targets
index 6759cc6719..79c5eaf17a 100644
--- a/.nuspec/Microsoft.Maui.Resizetizer.targets
+++ b/.nuspec/Microsoft.Maui.Resizetizer.targets
@@ -33,6 +33,10 @@
AssemblyFile="$(_ResizetizerTaskAssemblyName)"
TaskName="Microsoft.Maui.Resizetizer.GenerateSplashStoryboard" />
+
+
@@ -76,6 +80,7 @@
<_ResizetizerPlatformIsmacOS Condition="'$(_ResizetizerPlatformIdentifier)' == 'macos'">True
<_ResizetizerPlatformIstvOS Condition="'$(_ResizetizerPlatformIdentifier)' == 'tvos'">True
<_ResizetizerPlatformIsWindows Condition="$(_ResizetizerPlatformIdentifier.Contains('windows')) == 'True'">True
+ <_ResizetizerPlatformIsTizen Condition="'$(_ResizetizerPlatformIdentifier)' == 'tizen'">True
False
@@ -90,9 +95,10 @@
<_ResizetizerIsiOSApp Condition="( '$(_ResizetizerPlatformIsiOS)' == 'True' OR '$(_ResizetizerPlatformIsMacCatalyst)' == 'True' ) And ('$(OutputType)' == 'Exe' Or '$(IsAppExtension)' == 'True')">True
<_ResizetizerIsWPFApp Condition="'$(IsApplication)' == 'True' And '$(NuGetRuntimeIdentifier)' == 'win' And '$(_ResizetizerPlatformIsWindows)' == 'True'">True
<_ResizetizerIsWindowsAppSdk Condition="('$(ProjectReunionWinUI)'=='True' Or '$(WindowsAppSDKWinUI)'=='True') And '$(_ResizetizerPlatformIsWindows)' == 'True' And ('$(OutputType)' == 'WinExe' Or '$(OutputType)' == 'Exe')">True
+ <_ResizetizerIsTizenApp Condition="'$(_ResizetizerPlatformIsTizen)' == 'True'">True
-
+
<_ResizetizerIsCompatibleApp>True
@@ -190,10 +196,29 @@
+
+
+ tizen
+
+
+ $(ResizetizeBeforeTargets);
+ PrepareResources;
+
+
+
+ $(ResizetizeAfterTargets);
+ ResizetizeCollectItems;
+
+
+
+ $(ProcessMauiFontsAfterTargets);
+ ResizetizeCollectItems;
+
+
+
-
@@ -295,6 +320,12 @@
+
+ <_MauiAssetItemMetadata>TizenTpkFileName
+
+
+
+
+
@@ -348,7 +380,7 @@
<_MauiSplashAssets Include="$(_MauiIntermediateSplashScreen)**\*" />
@@ -358,6 +390,11 @@
+
+
+
+
+
@@ -437,6 +474,11 @@
+
+
+
+
+
@@ -479,6 +521,13 @@
Images="@(MauiImage->Distinct())">
+
+
+
@@ -548,6 +597,20 @@
+
+
+ $([System.IO.Path]::GetFullPath('$(_MauiIntermediateImages)'))
+
+
+
+
+
+
+ $([MSBuild]::MakeRelative($(ResizetizerIntermediateOutputAbsolutePath), $([System.IO.Path]::GetFullPath('%(_ResizetizerCollectedImages.RelativeDir)'))))
+
+
+
+
@@ -602,4 +665,4 @@
-
\ No newline at end of file
+
diff --git a/Directory.Build.props b/Directory.Build.props
index 55301d5489..42d747e774 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -12,8 +12,12 @@
<_MauiTargetPlatformIsmacOS Condition="'$(_MauiTargetPlatformIdentifier)' == 'macos'">True
<_MauiTargetPlatformIstvOS Condition="'$(_MauiTargetPlatformIdentifier)' == 'tvos'">True
<_MauiTargetPlatformIsWindows Condition="$(_MauiTargetPlatformIdentifier.Contains('windows')) == 'True'">True
+ <_MauiTargetPlatformIsTizen Condition="'$(_MauiTargetPlatformIdentifier)' == 'tizen'">True
true
+ true
@@ -34,6 +38,7 @@
30.0
10.0.19041
10.0.20348
+ 6.5
@@ -41,6 +46,7 @@
net$(_MauiDotNetVersion)-ios;net$(_MauiDotNetVersion)-maccatalyst;net$(_MauiDotNetVersion)-android
net$(_MauiDotNetVersion)-windows$(WindowsTargetFrameworkVersion);net$(_MauiDotNetVersion)-windows$(Windows2TargetFrameworkVersion)
$(MauiPlatforms);$(WindowsMauiPlatforms)
+ $(MauiPlatforms);net$(_MauiDotNetVersion)-tizen
net$(_MauiDotNetVersion)-ios;net$(_MauiDotNetVersion)-android
diff --git a/Directory.Build.targets b/Directory.Build.targets
index e1c4eda5c7..dc0e3527e7 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -33,6 +33,10 @@
21.0
21.0
+
+ 6.5
+ 6.5
+
6.0.4
$(MicrosoftNETWorkloadEmscriptenManifest60300PackageVersion)
@@ -49,6 +50,7 @@
1.0.0-prerelease.22211.4
1.0.0-prerelease.22211.4
1.0.0-prerelease.22211.4
+ 0.6.0-pre1
@@ -60,5 +62,6 @@
$(DotNetVersionBand)
$(DotNetVersionBand)
$(DotNetVersionBand)
+ $(DotNetVersionBand)
diff --git a/eng/pipelines/common/provision.yml b/eng/pipelines/common/provision.yml
index 6fc8f5948b..937ae99787 100644
--- a/eng/pipelines/common/provision.yml
+++ b/eng/pipelines/common/provision.yml
@@ -107,6 +107,14 @@ steps:
displayName: 'Setup MSBuild Paths'
condition: eq(variables['provisioningVS'], 'true')
+ - pwsh: |
+ [xml] $fileXml = Get-Content "eng\Versions.props"
+ $DotNetVersionBand = $fileXml.SelectSingleNode("Project/PropertyGroup/DotNetVersionBand").InnerText
+ echo "Installing .NET $DotNetVersion"
+ Invoke-WebRequest 'https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.ps1' -OutFile 'workload-install.ps1'
+ .\workload-install.ps1 -t $DotNetVersion
+ displayName: 'Install Tizen'
+
# Prepare Both
- pwsh: ./build.ps1 --target provision
displayName: 'Cake Provision'
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Shipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Shipped.txt
new file mode 100644
index 0000000000..ab058de62d
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Shipped.txt
@@ -0,0 +1 @@
+#nullable enable
diff --git a/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Unshipped.txt b/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Unshipped.txt
new file mode 100644
index 0000000000..21bd2d4a2a
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/PublicAPI/net6.0-tizen/PublicAPI.Unshipped.txt
@@ -0,0 +1,63 @@
+#nullable enable
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.BlazorWebViewInitializedEventArgs() -> void
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs
+Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs.BlazorWebViewInitializingEventArgs() -> void
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebView() -> void
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebViewInitialized -> System.EventHandler?
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebViewInitializing -> System.EventHandler?
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.get -> string?
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.set -> void
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.UrlLoading -> System.EventHandler?
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewHandler() -> void
+Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewHandler(Microsoft.Maui.PropertyMapper? mapper) -> void
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.BlazorWebViewInitialized(Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs! args) -> void
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.BlazorWebViewInitializing(Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializingEventArgs! args) -> void
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.HostPage.get -> string?
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
+Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.UrlLoading(Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs! args) -> void
+Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder
+Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.ComponentType.get -> System.Type?
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.ComponentType.set -> void
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Parameters.get -> System.Collections.Generic.IDictionary?
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Parameters.set -> void
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.RootComponent() -> void
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Selector.get -> string?
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponent.Selector.set -> void
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
+Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection.RootComponentsCollection(Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore! jsComponents) -> void
+Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager
+Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager.TizenWebViewManager(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! blazorMauiWebViewHandler, Tizen.WebView.WebView! webview, System.IServiceProvider! provider, Microsoft.AspNetCore.Components.Dispatcher! dispatcher, Microsoft.Extensions.FileProviders.IFileProvider! fileProvider, Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore! jsComponents, string! contentRootRelativeToAppRoot, string! hostPageRelativePath) -> void
+override Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager.NavigateCore(System.Uri! absoluteUri) -> void
+override Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager.SendMessage(string! message) -> void
+Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer
+Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer.WebViewContainer(ElmSharp.EvasObject! parent) -> void
+Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer.WebView.get -> Tizen.WebView.WebView!
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.Url.get -> System.Uri!
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.get -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.set -> void
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.CancelLoad = 2 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenExternally = 0 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenInWebView = 1 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
+Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions
+override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.CreatePlatformView() -> Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer!
+override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.ConnectHandler(Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer! platformView) -> void
+override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.DisconnectHandler(Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer! platformView) -> void
+static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapHostPage(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
+static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapRootComponents(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
+static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
+static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddMauiBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder!
+static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewMapper -> Microsoft.Maui.PropertyMapper!
+virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
+~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Tizen.WebView.WebView
diff --git a/src/BlazorWebView/src/Maui/Tizen/BlazorWebViewHandler.Tizen.cs b/src/BlazorWebView/src/Maui/Tizen/BlazorWebViewHandler.Tizen.cs
new file mode 100644
index 0000000000..8e5f94930a
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/Tizen/BlazorWebViewHandler.Tizen.cs
@@ -0,0 +1,192 @@
+using System;
+using System.IO;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Maui;
+using Microsoft.Maui.Dispatching;
+using Microsoft.Maui.Handlers;
+using Tizen.WebView;
+using TChromium = Tizen.WebView.Chromium;
+using TWebView = Tizen.WebView.WebView;
+
+namespace Microsoft.AspNetCore.Components.WebView.Maui
+{
+ ///
+ /// The Tizen for .
+ ///
+ public partial class BlazorWebViewHandler : ViewHandler
+ {
+ private const string AppOrigin = "http://0.0.0.0/";
+ private const string BlazorInitScript = @"
+ window.__receiveMessageCallbacks = [];
+ window.__dispatchMessageCallback = function(message) {
+ window.__receiveMessageCallbacks.forEach(function(callback) { callback(message); });
+ };
+ window.external = {
+ sendMessage: function(message) {
+ window.BlazorHandler.postMessage(message);
+ },
+ receiveMessage: function(callback) {
+ window.__receiveMessageCallbacks.push(callback);
+ }
+ };
+
+ Blazor.start();
+
+ (function () {
+ window.onpageshow = function(event) {
+ if (event.persisted) {
+ window.location.reload();
+ }
+ };
+ })();
+ ";
+
+ private TizenWebViewManager? _webviewManager;
+ private WebViewExtensions.InterceptRequestCallback? _interceptRequestCallback;
+
+ private TWebView NativeWebView => PlatformView.WebView;
+
+ private bool RequiredStartupPropertiesSet =>
+ //_webview != null &&
+ HostPage != null &&
+ Services != null;
+
+ ///
+ protected override WebViewContainer CreatePlatformView()
+ {
+ TChromium.Initialize();
+ MauiApplication.Current.Terminated += (s, e) => TChromium.Shutdown();
+
+ return new WebViewContainer(NativeParent!);
+ }
+
+ ///
+ protected override void ConnectHandler(WebViewContainer platformView)
+ {
+ _interceptRequestCallback = OnRequestInterceptCallback;
+ NativeWebView.LoadFinished += OnLoadFinished;
+ NativeWebView.AddJavaScriptMessageHandler("BlazorHandler", PostMessageFromJS);
+ NativeWebView.SetInterceptRequestCallback(_interceptRequestCallback);
+ NativeWebView.GetSettings().JavaScriptEnabled = true;
+ }
+
+ ///
+ protected override void DisconnectHandler(WebViewContainer platformView)
+ {
+ NativeWebView.LoadFinished -= OnLoadFinished;
+ base.DisconnectHandler(platformView);
+ }
+
+ private void PostMessageFromJS(JavaScriptMessage message)
+ {
+ if (message is null)
+ {
+ throw new ArgumentNullException(nameof(message));
+ }
+
+ if (message.Name.Equals("BlazorHandler", StringComparison.Ordinal))
+ {
+ _webviewManager!.MessageReceivedInternal(new Uri(NativeWebView.Url), message.GetBodyAsString());
+ }
+ }
+
+ private void StartWebViewCoreIfPossible()
+ {
+ if (!RequiredStartupPropertiesSet ||
+ _webviewManager != null)
+ {
+ return;
+ }
+ if (PlatformView == null)
+ {
+ throw new InvalidOperationException($"Can't start {nameof(BlazorWebView)} without platform web view instance.");
+ }
+
+ // We assume the host page is always in the root of the content directory, because it's
+ // unclear there's any other use case. We can add more options later if so.
+ var contentRootDir = Path.GetDirectoryName(HostPage!) ?? string.Empty;
+ var hostPageRelativePath = Path.GetRelativePath(contentRootDir, HostPage!);
+
+ var fileProvider = VirtualView.CreateFileProvider(contentRootDir);
+
+ _webviewManager = new TizenWebViewManager(
+ this,
+ NativeWebView,
+ Services!,
+ new MauiDispatcher(Services!.GetRequiredService()),
+ fileProvider,
+ VirtualView.JSComponents,
+ contentRootDir,
+ hostPageRelativePath);
+
+ StaticContentHotReloadManager.AttachToWebViewManagerIfEnabled(_webviewManager);
+
+ VirtualView.BlazorWebViewInitializing(new BlazorWebViewInitializingEventArgs());
+ VirtualView.BlazorWebViewInitialized(new BlazorWebViewInitializedEventArgs
+ {
+ WebView = NativeWebView,
+ });
+
+ if (RootComponents != null)
+ {
+ foreach (var rootComponent in RootComponents)
+ {
+ // Since the page isn't loaded yet, this will always complete synchronously
+ _ = rootComponent.AddToWebViewManagerAsync(_webviewManager);
+ }
+ }
+ _webviewManager.Navigate("/");
+ }
+
+ private void OnRequestInterceptCallback(IntPtr context, IntPtr request, IntPtr userdata)
+ {
+ if (request == IntPtr.Zero)
+ {
+ return;
+ }
+
+ var url = NativeWebView.GetInterceptRequestUrl(request);
+
+ if (url.StartsWith(AppOrigin))
+ {
+ var allowFallbackOnHostPage = url.EndsWith("/");
+ url = QueryStringHelper.RemovePossibleQueryString(url);
+ if (_webviewManager!.TryGetResponseContentInternal(url, allowFallbackOnHostPage, out var statusCode, out var statusMessage, out var content, out var headers))
+ {
+ var header = $"HTTP/1.0 200 OK\r\n";
+ foreach (var item in headers)
+ {
+ header += $"{item.Key}:{item.Value}\r\n";
+ }
+ header += "\r\n";
+
+ using (MemoryStream memstream = new MemoryStream())
+ {
+ content.CopyTo(memstream);
+ var body = memstream.ToArray();
+ NativeWebView.SetInterceptRequestResponse(request, header, body, (uint)body.Length);
+ }
+ return;
+ }
+ }
+
+ NativeWebView.IgnoreInterceptRequest(request);
+ }
+
+ private void OnLoadFinished(object? sender, EventArgs e)
+ {
+ NativeWebView.SetFocus(true);
+ var url = NativeWebView.Url;
+
+ if (url == AppOrigin)
+ NativeWebView.Eval(BlazorInitScript);
+ }
+
+ internal IFileProvider CreateFileProvider(string contentRootDir)
+ {
+ return new TizenMauiAssetFileProvider(contentRootDir);
+ }
+
+ }
+}
diff --git a/src/BlazorWebView/src/Maui/Tizen/TizenMauiAssetFileProvider.cs b/src/BlazorWebView/src/Maui/Tizen/TizenMauiAssetFileProvider.cs
new file mode 100644
index 0000000000..dd5824fa32
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/Tizen/TizenMauiAssetFileProvider.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Primitives;
+using Tizen.Applications;
+
+namespace Microsoft.AspNetCore.Components.WebView.Maui
+{
+ ///
+ /// A minimal implementation of an IFileProvider to be used by the BlazorWebView and WebViewManager types.
+ ///
+ internal sealed class TizenMauiAssetFileProvider : IFileProvider
+ {
+ private readonly string _resDir;
+
+ public TizenMauiAssetFileProvider(string contentRootDir)
+ {
+ _resDir = Path.Combine(Application.Current.DirectoryInfo.Resource, contentRootDir);
+ }
+
+ public IDirectoryContents GetDirectoryContents(string subpath)
+ => new TizenMauiAssetDirectoryContents(Path.Combine(_resDir, subpath));
+
+ public IFileInfo GetFileInfo(string subpath)
+ => new TizenMauiAssetFileInfo(Path.Combine(_resDir, subpath));
+
+ public IChangeToken? Watch(string filter)
+ => null;
+
+ private sealed class TizenMauiAssetFileInfo : IFileInfo
+ {
+ private readonly string _filePath;
+
+ public TizenMauiAssetFileInfo(string filePath)
+ {
+ _filePath = filePath;
+
+ Name = Path.GetFileName(_filePath);
+
+ var fileInfo = new FileInfo(_filePath);
+ Exists = fileInfo.Exists;
+ Length = Exists ? fileInfo.Length : -1;
+ }
+
+ public bool Exists { get; }
+ public long Length { get; }
+ public string PhysicalPath { get; } = null!;
+ public string Name { get; }
+ public DateTimeOffset LastModified { get; } = DateTimeOffset.FromUnixTimeSeconds(0);
+ public bool IsDirectory => false;
+
+ public Stream CreateReadStream()
+ => File.OpenRead(_filePath);
+ }
+
+ // This is never used by BlazorWebView or WebViewManager
+ private sealed class TizenMauiAssetDirectoryContents : IDirectoryContents
+ {
+ public TizenMauiAssetDirectoryContents(string filePath)
+ {
+ }
+
+ public bool Exists => false;
+
+ public IEnumerator GetEnumerator()
+ => throw new NotImplementedException();
+
+ IEnumerator IEnumerable.GetEnumerator()
+ => throw new NotImplementedException();
+ }
+ }
+}
diff --git a/src/BlazorWebView/src/Maui/Tizen/TizenWebViewManager.cs b/src/BlazorWebView/src/Maui/Tizen/TizenWebViewManager.cs
new file mode 100644
index 0000000000..967fe158ca
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/Tizen/TizenWebViewManager.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text.Encodings.Web;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.Extensions.FileProviders;
+using TWebView = Tizen.WebView.WebView;
+
+namespace Microsoft.AspNetCore.Components.WebView.Maui
+{
+ ///
+ /// An implementation of that uses the Tizen WebView browser control
+ /// to render web content.
+ ///
+ public class TizenWebViewManager : WebViewManager
+ {
+ private const string AppOrigin = "http://0.0.0.0/";
+
+ private readonly BlazorWebViewHandler _blazorMauiWebViewHandler;
+ private readonly TWebView _webview;
+ private readonly string _contentRootRelativeToAppRoot;
+
+ ///
+ /// Initializes a new instance of
+ ///
+ /// The .
+ /// A wrapper to access platform-specific WebView APIs.
+ /// The for the application.
+ /// A instance instance that can marshal calls to the required thread or sync context.
+ /// Provides static content to the webview.
+ /// Describes configuration for adding, removing, and updating root components from JavaScript code.
+ /// Path to the directory containing application content files.
+ /// Path to the host page within the fileProvider.
+ public TizenWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, TWebView webview, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
+ : base(provider, dispatcher, new Uri(AppOrigin), fileProvider, jsComponents, hostPageRelativePath)
+ {
+ _blazorMauiWebViewHandler = blazorMauiWebViewHandler ?? throw new ArgumentNullException(nameof(blazorMauiWebViewHandler));
+ _webview = webview ?? throw new ArgumentNullException(nameof(webview));
+ _contentRootRelativeToAppRoot = contentRootRelativeToAppRoot;
+
+ }
+
+ internal bool TryGetResponseContentInternal(string uri, bool allowFallbackOnHostPage, out int statusCode, out string statusMessage, out Stream content, out IDictionary headers)
+ {
+ var defaultResult = TryGetResponseContent(uri, allowFallbackOnHostPage, out statusCode, out statusMessage, out content, out headers);
+ var hotReloadedResult = StaticContentHotReloadManager.TryReplaceResponseContent(_contentRootRelativeToAppRoot, uri, ref statusCode, ref content, headers);
+ return defaultResult || hotReloadedResult;
+ }
+
+
+ ///
+ protected override void NavigateCore(Uri absoluteUri)
+ {
+ _webview.LoadUrl(absoluteUri.ToString());
+ }
+
+ ///
+ protected override void SendMessage(string message)
+ {
+ var messageJSStringLiteral = JavaScriptEncoder.Default.Encode(message);
+ _webview.Eval($"__dispatchMessageCallback(\"{messageJSStringLiteral}\")");
+ }
+
+ internal void MessageReceivedInternal(Uri uri, string message)
+ {
+ MessageReceived(uri, message);
+ }
+ }
+}
diff --git a/src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs b/src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs
new file mode 100644
index 0000000000..52b3a3423f
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs
@@ -0,0 +1,42 @@
+using System;
+using Tizen.UIExtensions.ElmSharp;
+using ElmSharp;
+using TWebView = Tizen.WebView.WebView;
+
+namespace Microsoft.AspNetCore.Components.WebView.Maui
+{
+ ///
+ /// A Tizen WebView browser control container.
+ ///
+ public class WebViewContainer : WidgetLayout
+ {
+
+ ///
+ /// A Tizen WebView.
+ ///
+ public TWebView WebView { get; }
+
+ ///
+ /// Initializes a new instance of
+ ///
+ /// The .
+ public WebViewContainer(EvasObject parent) : base(parent)
+ {
+ WebView = new TWebView(parent);
+ SetContent(WebView);
+ AllowFocus(true);
+ Focused += OnFocused;
+ Unfocused += OnUnfocused;
+ }
+
+ void OnFocused(object? sender, EventArgs e)
+ {
+ WebView.SetFocus(true);
+ }
+
+ void OnUnfocused(object? sender, EventArgs e)
+ {
+ WebView.SetFocus(false);
+ }
+ }
+}
diff --git a/src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs b/src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs
new file mode 100644
index 0000000000..4150989f10
--- /dev/null
+++ b/src/BlazorWebView/src/Maui/Tizen/WebViewExtensions.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Runtime.InteropServices;
+using TWebView = Tizen.WebView.WebView;
+
+namespace Microsoft.AspNetCore.Components.WebView.Maui
+{
+ ///
+ /// WebViewExtension
+ ///
+ internal static class WebViewExtensions
+ {
+ public const string ChromiumEwk = "libchromium-ewk.so";
+
+ public static void SetInterceptRequestCallback(this TWebView webView, InterceptRequestCallback callback)
+ {
+ var context = webView.GetContext();
+ var handleField = context.GetType().GetField("_handle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var contextHandle = (IntPtr?)handleField?.GetValue(context);
+ if (contextHandle != null)
+ ewk_context_intercept_request_callback_set(contextHandle.Value, callback, IntPtr.Zero);
+ }
+
+ public static void SetInspectorStart(this TWebView webView, uint port)
+ {
+ var context = webView.GetContext();
+ var handleField = context.GetType().GetField("_handle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+ var contextHandle = (IntPtr?)handleField?.GetValue(context);
+ if (contextHandle != null)
+ ewk_context_inspector_server_start(contextHandle.Value, port);
+ }
+
+ public static bool SetInterceptRequestResponse(this TWebView webView, IntPtr request, string header, byte[] body, uint length)
+ {
+ return ewk_intercept_request_response_set(request, header, body, length);
+ }
+
+ public static bool IgnoreInterceptRequest(this TWebView webView, IntPtr request)
+ {
+ return ewk_intercept_request_ignore(request);
+ }
+
+ public static string GetInterceptRequestUrl(this TWebView webView, IntPtr request)
+ {
+ return Marshal.PtrToStringAnsi(_ewk_intercept_request_url_get(request)) ?? string.Empty;
+ }
+
+ [DllImport(ChromiumEwk)]
+ internal static extern IntPtr ewk_view_context_get(IntPtr obj);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void InterceptRequestCallback(IntPtr context, IntPtr request, IntPtr userData);
+
+ [DllImport(ChromiumEwk)]
+ internal static extern void ewk_context_intercept_request_callback_set(IntPtr context, InterceptRequestCallback callback, IntPtr userData);
+
+ [DllImport(ChromiumEwk, EntryPoint = "ewk_intercept_request_url_get")]
+ internal static extern IntPtr _ewk_intercept_request_url_get(IntPtr request);
+
+ [DllImport(ChromiumEwk, EntryPoint = "ewk_intercept_request_http_method_get")]
+ internal static extern IntPtr _ewk_intercept_request_http_method_get(IntPtr request);
+
+ internal static string ewk_intercept_request_http_method_get(IntPtr request)
+ {
+ return Marshal.PtrToStringAnsi(_ewk_intercept_request_http_method_get(request)) ?? string.Empty;
+ }
+
+ [DllImport(ChromiumEwk)]
+ public static extern uint ewk_context_inspector_server_start(IntPtr context, uint port);
+
+ [DllImport(ChromiumEwk)]
+ internal static extern bool ewk_intercept_request_ignore(IntPtr request);
+
+ [DllImport(ChromiumEwk)]
+ internal static extern bool ewk_intercept_request_response_set(IntPtr request, string header, string body, uint length);
+
+ [DllImport(ChromiumEwk)]
+ internal static extern bool ewk_intercept_request_response_set(IntPtr request, string header, byte[] body, uint length);
+ }
+}
diff --git a/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializedEventArgs.cs b/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializedEventArgs.cs
index e8d124cac0..a7de76a6af 100644
--- a/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializedEventArgs.cs
+++ b/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializedEventArgs.cs
@@ -13,6 +13,8 @@ using WebView2Control = Microsoft.UI.Xaml.Controls.WebView2;
using AWebView = Android.Webkit.WebView;
#elif IOS || MACCATALYST
using WebKit;
+#elif TIZEN
+using TWebView = Tizen.WebView.WebView;
#endif
namespace Microsoft.AspNetCore.Components.WebView
@@ -39,6 +41,11 @@ namespace Microsoft.AspNetCore.Components.WebView
/// the default values to allow further configuring additional options.
///
public WKWebView WebView { get; internal set; }
+#elif TIZEN
+ ///
+ /// Gets the instance that was initialized.
+ ///
+ public TWebView WebView { get; internal set; }
#endif
}
}
diff --git a/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializingEventArgs.cs b/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializingEventArgs.cs
index dc11d075e8..f14ccd6564 100644
--- a/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializingEventArgs.cs
+++ b/src/BlazorWebView/src/SharedSource/BlazorWebViewInitializingEventArgs.cs
@@ -12,6 +12,8 @@ using WebView2Control = Microsoft.UI.Xaml.Controls.WebView2;
using AWebView = Android.Webkit.WebView;
#elif IOS || MACCATALYST
using WebKit;
+#elif TIZEN
+using TWebView = Tizen.WebView.WebView;
#endif
namespace Microsoft.AspNetCore.Components.WebView
diff --git a/src/Compatibility/ControlGallery/src/Core/Startup.cs b/src/Compatibility/ControlGallery/src/Core/Startup.cs
index 2c0044972a..ffd97ef433 100644
--- a/src/Compatibility/ControlGallery/src/Core/Startup.cs
+++ b/src/Compatibility/ControlGallery/src/Core/Startup.cs
@@ -4,6 +4,7 @@ using Microsoft.Maui;
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Compatibility.Hosting;
using Microsoft.Maui.Controls.Hosting;
+using Microsoft.Maui.Devices;
using Microsoft.Maui.Hosting;
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery
@@ -41,6 +42,12 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery
effects.AddCompatibilityEffects(AppDomain.CurrentDomain.GetAssemblies());
});
+ if (DeviceInfo.Platform == DevicePlatform.Tizen)
+ {
+ //Some controls still need to use legacy renderers on Tizen.
+ builder.UseMauiCompatibility();
+ }
+
DependencyService.Register(AppDomain.CurrentDomain.GetAssemblies());
return builder;
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/BorderEffect.cs b/src/Compatibility/ControlGallery/src/Tizen/BorderEffect.cs
similarity index 69%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/BorderEffect.cs
rename to src/Compatibility/ControlGallery/src/Tizen/BorderEffect.cs
index 786ad812e7..66d95efcbd 100644
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/BorderEffect.cs
+++ b/src/Compatibility/ControlGallery/src/Tizen/BorderEffect.cs
@@ -1,12 +1,13 @@
using System.ComponentModel;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen;
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+using Microsoft.Maui.Controls.Platform;
using ElmSharp;
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.Tizen;
-using Xamarin.Forms.Platform.Tizen;
using EColor = ElmSharp.Color;
[assembly: ExportEffect(typeof(BorderEffect), "BorderEffect")]
-namespace Xamarin.Forms.ControlGallery.Tizen
+namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
{
public class BorderEffect : PlatformEffect
{
diff --git a/src/Compatibility/ControlGallery/src/Tizen/Compatibility.ControlGallery.Tizen.csproj b/src/Compatibility/ControlGallery/src/Tizen/Compatibility.ControlGallery.Tizen.csproj
new file mode 100644
index 0000000000..41ea8acb66
--- /dev/null
+++ b/src/Compatibility/ControlGallery/src/Tizen/Compatibility.ControlGallery.Tizen.csproj
@@ -0,0 +1,38 @@
+
+
+
+ $(_MauiDotNetTfm)-tizen
+ Exe
+ Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
+ Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
+ false
+ disable
+
+
+ 0612
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Compatibility/ControlGallery/src/Tizen/ControlGallery.Tizen.cs b/src/Compatibility/ControlGallery/src/Tizen/ControlGallery.Tizen.cs
new file mode 100644
index 0000000000..c8c6b95594
--- /dev/null
+++ b/src/Compatibility/ControlGallery/src/Tizen/ControlGallery.Tizen.cs
@@ -0,0 +1,32 @@
+using ElmSharp;
+using Tizen.Applications;
+using Tizen.NET.MaterialComponents;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues;
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Handlers;
+using Microsoft.Maui.Hosting;
+using Microsoft.Maui.Platform;
+
+namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
+{
+ class MainApplication : MauiApplication
+ {
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ MaterialComponents.Init(DirectoryInfo.Resource);
+ }
+
+ static void Main(string[] args)
+ {
+ var app = new MainApplication();
+ FormsMaps.Init("HERE", "write-your-API-key-here");
+ //FormsMaterial.Init();
+ app.Run(args);
+ }
+ }
+}
diff --git a/src/Compatibility/ControlGallery/src/Tizen/DisposeLabelRenderer.cs b/src/Compatibility/ControlGallery/src/Tizen/DisposeLabelRenderer.cs
new file mode 100644
index 0000000000..a56b2ce2a2
--- /dev/null
+++ b/src/Compatibility/ControlGallery/src/Tizen/DisposeLabelRenderer.cs
@@ -0,0 +1,22 @@
+using Microsoft.Maui.Controls.Compatibility;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen;
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+
+[assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))]
+namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
+{
+#pragma warning disable CS0618 // Type or member is obsolete
+ public class DisposeLabelRenderer : LabelRenderer
+#pragma warning disable CS0618 // Type or member is obsolete
+ {
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ ((DisposeLabel)Element).SendRendererDisposed();
+ }
+ base.Dispose(disposing);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Tizen/DisposePageRenderer.cs b/src/Compatibility/ControlGallery/src/Tizen/DisposePageRenderer.cs
new file mode 100644
index 0000000000..9067c3f1e6
--- /dev/null
+++ b/src/Compatibility/ControlGallery/src/Tizen/DisposePageRenderer.cs
@@ -0,0 +1,22 @@
+using Microsoft.Maui.Controls.Compatibility;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen;
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+
+[assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))]
+namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
+{
+#pragma warning disable CS0618 // Type or member is obsolete
+ public class DisposePageRenderer : PageRenderer
+#pragma warning disable CS0618 // Type or member is obsolete
+ {
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ ((DisposePage)Element).SendRendererDisposed();
+ }
+ base.Dispose(disposing);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/PlatformSpecificCoreGalleryFactory.cs b/src/Compatibility/ControlGallery/src/Tizen/PlatformSpecificCoreGalleryFactory.cs
similarity index 57%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/PlatformSpecificCoreGalleryFactory.cs
rename to src/Compatibility/ControlGallery/src/Tizen/PlatformSpecificCoreGalleryFactory.cs
index 04d6275344..12a0d7aadd 100644
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/PlatformSpecificCoreGalleryFactory.cs
+++ b/src/Compatibility/ControlGallery/src/Tizen/PlatformSpecificCoreGalleryFactory.cs
@@ -1,12 +1,13 @@
using System;
using System.Collections.Generic;
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.Tizen;
-using Xamarin.Forms.Controls;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Compatibility;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen;
+using Microsoft.Maui.Controls.Internals;
[assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))]
-namespace Xamarin.Forms.ControlGallery.Tizen
+namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
{
public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory
{
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/RegistrarValidationService.cs b/src/Compatibility/ControlGallery/src/Tizen/RegistrarValidationService.cs
similarity index 65%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/RegistrarValidationService.cs
rename to src/Compatibility/ControlGallery/src/Tizen/RegistrarValidationService.cs
index 57ae24f7e0..1d029d5eec 100644
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/RegistrarValidationService.cs
+++ b/src/Compatibility/ControlGallery/src/Tizen/RegistrarValidationService.cs
@@ -1,10 +1,11 @@
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.Tizen;
-using Xamarin.Forms.Controls;
-using Xamarin.Forms.Platform.Tizen;
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Compatibility;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen;
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+using Microsoft.Maui.Controls.Internals;
[assembly: Dependency(typeof(RegistrarValidationService))]
-namespace Xamarin.Forms.ControlGallery.Tizen
+namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
{
public class RegistrarValidationService : IRegistrarValidationService
{
diff --git a/src/Compatibility/ControlGallery/src/Tizen/SampleNativeControl.cs b/src/Compatibility/ControlGallery/src/Tizen/SampleNativeControl.cs
new file mode 100644
index 0000000000..e2c11508fa
--- /dev/null
+++ b/src/Compatibility/ControlGallery/src/Tizen/SampleNativeControl.cs
@@ -0,0 +1,27 @@
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Compatibility;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen;
+using Microsoft.Maui.Controls.Compatibility.ControlGallery.Issues.Helpers;
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Platform;
+using ELabel = ElmSharp.Label;
+
+[assembly: Dependency(typeof(SampleNativeControl))]
+namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.Tizen
+{
+ public class SampleNativeControl : ISampleNativeControl
+ {
+ public View View
+ {
+ get
+ {
+ var label = new ELabel(CoreAppExtensions.MainWindow)
+ {
+ Text = "Sample Native Control"
+ };
+ return label.ToView();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/FlowerBuds.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/FlowerBuds.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/FlowerBuds.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/FlowerBuds.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Fruits.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/Fruits.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Fruits.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/Fruits.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Icon-Small.png b/src/Compatibility/ControlGallery/src/Tizen/res/Icon-Small.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Icon-Small.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/Icon-Small.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Icon.png b/src/Compatibility/ControlGallery/src/Tizen/res/Icon.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Icon.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/Icon.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Intranet-icon.png b/src/Compatibility/ControlGallery/src/Tizen/res/Intranet-icon.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Intranet-icon.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/Intranet-icon.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Legumes.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/Legumes.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Legumes.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/Legumes.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Vegetables.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/Vegetables.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/Vegetables.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/Vegetables.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/about.png b/src/Compatibility/ControlGallery/src/Tizen/res/about.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/about.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/about.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/bank.png b/src/Compatibility/ControlGallery/src/Tizen/res/bank.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/bank.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/bank.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/bell.png b/src/Compatibility/ControlGallery/src/Tizen/res/bell.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/bell.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/bell.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/blog.png b/src/Compatibility/ControlGallery/src/Tizen/res/blog.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/blog.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/blog.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/books.png b/src/Compatibility/ControlGallery/src/Tizen/res/books.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/books.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/books.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/booksflyout.png b/src/Compatibility/ControlGallery/src/Tizen/res/booksflyout.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/booksflyout.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/booksflyout.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/calculator.png b/src/Compatibility/ControlGallery/src/Tizen/res/calculator.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/calculator.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/calculator.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/card.png b/src/Compatibility/ControlGallery/src/Tizen/res/card.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/card.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/card.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/caret_r.png b/src/Compatibility/ControlGallery/src/Tizen/res/caret_r.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/caret_r.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/caret_r.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/coffee.png b/src/Compatibility/ControlGallery/src/Tizen/res/coffee.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/coffee.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/coffee.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/cover1.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/cover1.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/cover1.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/cover1.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/cover1small.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/cover1small.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/cover1small.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/cover1small.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/crimson.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/crimson.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/crimson.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/crimson.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/crimsonsmall.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/crimsonsmall.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/crimsonsmall.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/crimsonsmall.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/facebook.png b/src/Compatibility/ControlGallery/src/Tizen/res/facebook.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/facebook.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/facebook.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/favorite.png b/src/Compatibility/ControlGallery/src/Tizen/res/favorite.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/favorite.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/favorite.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/film.png b/src/Compatibility/ControlGallery/src/Tizen/res/film.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/film.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/film.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/filmflyout.png b/src/Compatibility/ControlGallery/src/Tizen/res/filmflyout.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/filmflyout.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/filmflyout.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/games.png b/src/Compatibility/ControlGallery/src/Tizen/res/games.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/games.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/games.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/gamesflyout.png b/src/Compatibility/ControlGallery/src/Tizen/res/gamesflyout.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/gamesflyout.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/gamesflyout.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/googleplus.png b/src/Compatibility/ControlGallery/src/Tizen/res/googleplus.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/googleplus.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/googleplus.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/grid.png b/src/Compatibility/ControlGallery/src/Tizen/res/grid.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/grid.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/grid.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/headphone.png b/src/Compatibility/ControlGallery/src/Tizen/res/headphone.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/headphone.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/headphone.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/headphoneflyout.png b/src/Compatibility/ControlGallery/src/Tizen/res/headphoneflyout.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/headphoneflyout.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/headphoneflyout.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/hm.png b/src/Compatibility/ControlGallery/src/Tizen/res/hm.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/hm.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/hm.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/hm_full.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/hm_full.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/hm_full.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/hm_full.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/home.png b/src/Compatibility/ControlGallery/src/Tizen/res/home.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/home.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/home.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/homeflyout.png b/src/Compatibility/ControlGallery/src/Tizen/res/homeflyout.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/homeflyout.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/homeflyout.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_pause.png b/src/Compatibility/ControlGallery/src/Tizen/res/ic_pause.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_pause.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/ic_pause.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_play.png b/src/Compatibility/ControlGallery/src/Tizen/res/ic_play.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_play.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/ic_play.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_share.png b/src/Compatibility/ControlGallery/src/Tizen/res/ic_share.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_share.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/ic_share.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_stop.png b/src/Compatibility/ControlGallery/src/Tizen/res/ic_stop.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ic_stop.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/ic_stop.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/instagram.png b/src/Compatibility/ControlGallery/src/Tizen/res/instagram.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/instagram.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/instagram.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/invalidimage.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/invalidimage.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/invalidimage.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/invalidimage.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/jet.png b/src/Compatibility/ControlGallery/src/Tizen/res/jet.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/jet.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/jet.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/lists.png b/src/Compatibility/ControlGallery/src/Tizen/res/lists.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/lists.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/lists.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/loop.png b/src/Compatibility/ControlGallery/src/Tizen/res/loop.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/loop.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/loop.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/menuIcon.png b/src/Compatibility/ControlGallery/src/Tizen/res/menuIcon.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/menuIcon.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/menuIcon.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/messages.png b/src/Compatibility/ControlGallery/src/Tizen/res/messages.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/messages.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/messages.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/newspaper.png b/src/Compatibility/ControlGallery/src/Tizen/res/newspaper.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/newspaper.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/newspaper.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/newspaperflyout.png b/src/Compatibility/ControlGallery/src/Tizen/res/newspaperflyout.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/newspaperflyout.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/newspaperflyout.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/notifications.png b/src/Compatibility/ControlGallery/src/Tizen/res/notifications.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/notifications.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/notifications.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/oasis.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/oasis.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/oasis.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/oasis.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/oasissmall.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/oasissmall.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/oasissmall.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/oasissmall.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/person.png b/src/Compatibility/ControlGallery/src/Tizen/res/person.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/person.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/person.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/photo.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/photo.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/photo.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/photo.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/profile.png b/src/Compatibility/ControlGallery/src/Tizen/res/profile.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/profile.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/profile.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ratchet.png b/src/Compatibility/ControlGallery/src/Tizen/res/ratchet.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ratchet.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/ratchet.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ratchet_full.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/ratchet_full.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/ratchet_full.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/ratchet_full.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/refresh.png b/src/Compatibility/ControlGallery/src/Tizen/res/refresh.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/refresh.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/refresh.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/reply.png b/src/Compatibility/ControlGallery/src/Tizen/res/reply.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/reply.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/reply.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/retweet.png b/src/Compatibility/ControlGallery/src/Tizen/res/retweet.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/retweet.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/retweet.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/scott.png b/src/Compatibility/ControlGallery/src/Tizen/res/scott.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/scott.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/scott.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/scott159.png b/src/Compatibility/ControlGallery/src/Tizen/res/scott159.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/scott159.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/scott159.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/search.png b/src/Compatibility/ControlGallery/src/Tizen/res/search.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/search.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/search.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/seth.png b/src/Compatibility/ControlGallery/src/Tizen/res/seth.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/seth.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/seth.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/slideout.png b/src/Compatibility/ControlGallery/src/Tizen/res/slideout.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/slideout.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/slideout.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/star.png b/src/Compatibility/ControlGallery/src/Tizen/res/star.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/star.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/star.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/tdl.png b/src/Compatibility/ControlGallery/src/Tizen/res/tdl.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/tdl.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/tdl.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/tdl_full.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/tdl_full.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/tdl_full.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/tdl_full.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/test.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/test.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/test.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/test.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/toolbar_close.png b/src/Compatibility/ControlGallery/src/Tizen/res/toolbar_close.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/toolbar_close.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/toolbar_close.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/tweet.png b/src/Compatibility/ControlGallery/src/Tizen/res/tweet.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/tweet.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/tweet.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/twitter.png b/src/Compatibility/ControlGallery/src/Tizen/res/twitter.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/twitter.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/twitter.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/twitternav.png b/src/Compatibility/ControlGallery/src/Tizen/res/twitternav.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/twitternav.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/twitternav.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/xamarinlogo.png b/src/Compatibility/ControlGallery/src/Tizen/res/xamarinlogo.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/xamarinlogo.png
rename to src/Compatibility/ControlGallery/src/Tizen/res/xamarinlogo.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/xamarinstore.jpg b/src/Compatibility/ControlGallery/src/Tizen/res/xamarinstore.jpg
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/res/xamarinstore.jpg
rename to src/Compatibility/ControlGallery/src/Tizen/res/xamarinstore.jpg
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/shared/res/Xamarin.Forms.ControlGallery.Tizen.png b/src/Compatibility/ControlGallery/src/Tizen/shared/res/Compatibility.ControlGallery.Tizen.png
similarity index 100%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/shared/res/Xamarin.Forms.ControlGallery.Tizen.png
rename to src/Compatibility/ControlGallery/src/Tizen/shared/res/Compatibility.ControlGallery.Tizen.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/tizen-manifest.xml b/src/Compatibility/ControlGallery/src/Tizen/tizen-manifest.xml
similarity index 53%
rename from src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/tizen-manifest.xml
rename to src/Compatibility/ControlGallery/src/Tizen/tizen-manifest.xml
index 6305605b28..e655844d17 100644
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/tizen-manifest.xml
+++ b/src/Compatibility/ControlGallery/src/Tizen/tizen-manifest.xml
@@ -1,9 +1,9 @@
-
+
-
-
- Xamarin.Forms.ControlGallery.Tizen.png
+
+
+ Compatibility.ControlGallery.Tizen.png
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/ControlGallery.Tizen.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/ControlGallery.Tizen.cs
deleted file mode 100644
index 5d29a47908..0000000000
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/ControlGallery.Tizen.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using ElmSharp;
-using Tizen.Applications;
-using Tizen.NET.MaterialComponents;
-using Xamarin.Forms;
-using Xamarin.Forms.Controls;
-using Xamarin.Forms.Platform.Tizen;
-
-namespace Xamarin.Forms.ControlGallery.Tizen
-{
- class MainApplication : FormsApplication
- {
- internal static EvasObject NativeParent { get; private set; }
- protected override void OnCreate()
- {
- base.OnCreate();
- MaterialComponents.Init(DirectoryInfo.Resource);
- NativeParent = MainWindow;
- LoadApplication(new App());
- }
-
- static void Main(string[] args)
- {
- var app = new MainApplication();
- FormsMaps.Init("HERE", "write-your-API-key-here");
- Forms.SetFlags("CollectionView_Experimental", "Shell_Experimental");
- Forms.Init(app);
- FormsMaterial.Init();
- app.Run(args);
- }
- }
-}
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/DisposeLabelRenderer.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/DisposeLabelRenderer.cs
deleted file mode 100644
index 27005a6701..0000000000
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/DisposeLabelRenderer.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.Tizen;
-using Xamarin.Forms.Controls;
-using Xamarin.Forms.Platform.Tizen;
-
-[assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))]
-namespace Xamarin.Forms.ControlGallery.Tizen
-{
- public class DisposeLabelRenderer : LabelRenderer
- {
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- ((DisposeLabel)Element).SendRendererDisposed();
- }
- base.Dispose(disposing);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/DisposePageRenderer.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/DisposePageRenderer.cs
deleted file mode 100644
index 942e3b9480..0000000000
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/DisposePageRenderer.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.Tizen;
-using Xamarin.Forms.Controls;
-using Xamarin.Forms.Platform.Tizen;
-
-[assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))]
-namespace Xamarin.Forms.ControlGallery.Tizen
-{
- public class DisposePageRenderer : PageRenderer
- {
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- ((DisposePage)Element).SendRendererDisposed();
- }
- base.Dispose(disposing);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/SampleNativeControl.cs b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/SampleNativeControl.cs
deleted file mode 100644
index 2d56a96fb8..0000000000
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/SampleNativeControl.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Xamarin.Forms;
-using Xamarin.Forms.ControlGallery.Tizen;
-using Xamarin.Forms.Controls.Issues.Helpers;
-using Xamarin.Forms.Platform.Tizen;
-using ELabel = ElmSharp.Label;
-
-[assembly: Dependency(typeof(SampleNativeControl))]
-namespace Xamarin.Forms.ControlGallery.Tizen
-{
- public class SampleNativeControl : ISampleNativeControl
- {
- public View View
- {
- get
- {
- var label = new ELabel(MainApplication.NativeParent)
- {
- Text = "Sample Native Control"
- };
- return label.ToView();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/Xamarin.Forms.ControlGallery.Tizen.csproj b/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/Xamarin.Forms.ControlGallery.Tizen.csproj
deleted file mode 100644
index 2896ae684d..0000000000
--- a/src/Compatibility/ControlGallery/src/Xamarin.Forms.ControlGallery.Tizen/Xamarin.Forms.ControlGallery.Tizen.csproj
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- Exe
- tizen40
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Compatibility/Core/src/AppHostBuilderExtensions.Tizen.cs b/src/Compatibility/Core/src/AppHostBuilderExtensions.Tizen.cs
new file mode 100644
index 0000000000..3142d9fcf9
--- /dev/null
+++ b/src/Compatibility/Core/src/AppHostBuilderExtensions.Tizen.cs
@@ -0,0 +1,55 @@
+using Microsoft.Maui.Hosting;
+using Microsoft.Maui.LifecycleEvents;
+using Microsoft.Maui.Controls.Compatibility;
+using Microsoft.Extensions.DependencyInjection;
+using TDeviceInfo = Tizen.UIExtensions.Common.DeviceInfo;
+
+namespace Microsoft.Maui.Controls.Compatibility.Hosting
+{
+ public static partial class AppHostBuilderExtensions
+ {
+ internal static MauiAppBuilder ConfigureCompatibilityLifecycleEvents(this MauiAppBuilder builder) =>
+ builder.ConfigureLifecycleEvents(events => events.AddTizen(OnConfigureLifeCycle));
+
+ static void OnConfigureLifeCycle(ITizenLifecycleBuilder tizen)
+ {
+ tizen.OnPreCreate((app) =>
+ {
+ // This is the initial Init to set up any system services registered by
+ // Forms.Init(). This happens before any UI has appeared.
+ // This creates a dummy MauiContext.
+
+ var services = MauiApplication.Current.Services;
+ MauiContext mauiContext = new MauiContext(services);
+ ActivationState state = new ActivationState(mauiContext);
+
+#pragma warning disable CS0612 // Type or member is obsolete
+ var options = services.GetService();
+ if (options == null)
+ {
+ options = new InitializationOptions(MauiApplication.Current)
+ {
+ DisplayResolutionUnit = TDeviceInfo.DisplayResolutionUnit.ToCompatibility(TDeviceInfo.ViewPortWidth)
+ };
+ }
+ else
+ {
+ options.Context = options.Context ?? MauiApplication.Current;
+ TDeviceInfo.DisplayResolutionUnit = options.DisplayResolutionUnit.ToDeviceInfo();
+ }
+ options.Flags |= InitializationFlags.SkipRenderers;
+ Forms.Init(state, options);
+#pragma warning disable CS0612 // Type or member is obsolete
+ })
+ .OnMauiContextCreated((mauiContext) =>
+ {
+ // This is the final Init that sets up the real context from the application.
+
+ var state = new ActivationState(mauiContext!);
+#pragma warning disable CS0612 // Type or member is obsolete
+ Forms.Init(state);
+#pragma warning disable CS0612 // Type or member is obsolete
+ });
+ }
+ }
+}
diff --git a/src/Compatibility/Core/src/AppHostBuilderExtensions.cs b/src/Compatibility/Core/src/AppHostBuilderExtensions.cs
index b221d8e0b1..6efb4d6f88 100644
--- a/src/Compatibility/Core/src/AppHostBuilderExtensions.cs
+++ b/src/Compatibility/Core/src/AppHostBuilderExtensions.cs
@@ -33,6 +33,23 @@ using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
using WebViewRenderer = Microsoft.Maui.Controls.Compatibility.Platform.iOS.WkWebViewRenderer;
using RadioButtonRenderer = Microsoft.Maui.Controls.Compatibility.Platform.iOS.Platform.DefaultRenderer;
using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.iOS.Platform.DefaultRenderer;
+#elif TIZEN
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+using Microsoft.Maui.Graphics.Skia;
+using BoxRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.BoxViewRenderer;
+using CollectionViewRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.StructuredItemsViewRenderer;
+using OpenGLViewRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
+using StreamImagesourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.StreamImageSourceHandler;
+using ImageLoaderSourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.UriImageSourceHandler;
+using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
+using FrameRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.FrameRenderer;
+using ImageRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.ImageRenderer;
+using EllipseRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.EllipseRenderer;
+using LineRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.LineRenderer;
+using PathRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.PathRenderer;
+using PolygonRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.PolygonRenderer;
+using PolylineRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.PolylineRenderer;
+using RectangleRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.SkiaSharp.RectangleRenderer;
#endif
namespace Microsoft.Maui.Controls.Compatibility.Hosting
@@ -89,11 +106,32 @@ namespace Microsoft.Maui.Controls.Compatibility.Hosting
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CS0612 // Type or member is obsolete
+#if TIZEN
+#pragma warning disable CS0618 // Type or member is obsolete
+#pragma warning disable CS0612 // Type or member is obsolete
+ handlers.TryAddCompatibilityRenderer(typeof(ContentView), typeof(LayoutRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(TabbedPage), typeof(TabbedPageRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(NavigationPage), typeof(NavigationPageRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(FlyoutPage), typeof(FlyoutPageRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(ListView), typeof(ListViewRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(Cell), typeof(CellRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(ImageCell), typeof(ImageCellRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(EntryCell), typeof(EntryCellRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(TextCell), typeof(TextCellRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(ViewCell), typeof(ViewCellRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(SwitchCell), typeof(SwitchCellRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(TableView), typeof(TableViewRenderer));
+ handlers.TryAddCompatibilityRenderer(typeof(Frame), typeof(FrameRenderer));
+#pragma warning disable CS0612 // Type or member is obsolete
+#pragma warning disable CS0618 // Type or member is obsolete
+#endif
// Shimmed renderers go directly to the registrar to load Image Handlers
Internals.Registrar.Registered.Register(typeof(FileImageSource), typeof(FileImageSourceHandler));
Internals.Registrar.Registered.Register(typeof(StreamImageSource), typeof(StreamImagesourceHandler));
Internals.Registrar.Registered.Register(typeof(UriImageSource), typeof(ImageLoaderSourceHandler));
+#if !TIZEN
Internals.Registrar.Registered.Register(typeof(FontImageSource), typeof(FontImageSourceHandler));
+#endif
Internals.Registrar.Registered.Register(typeof(Microsoft.Maui.EmbeddedFont), typeof(Microsoft.Maui.EmbeddedFontLoader));
#endif
diff --git a/src/Compatibility/Core/src/Compatibility.csproj b/src/Compatibility/Core/src/Compatibility.csproj
index 5a4a4beec9..635e411fb1 100644
--- a/src/Compatibility/Core/src/Compatibility.csproj
+++ b/src/Compatibility/Core/src/Compatibility.csproj
@@ -7,6 +7,7 @@
Android\
iOS\
Windows\
+ Tizen\
false
true
@@ -21,19 +22,15 @@
-
-
-
-
@@ -48,6 +45,7 @@
+
diff --git a/src/Compatibility/Core/src/Forms.cs b/src/Compatibility/Core/src/Forms.cs
index 3e288ebd19..9b4c24ec1a 100644
--- a/src/Compatibility/Core/src/Forms.cs
+++ b/src/Compatibility/Core/src/Forms.cs
@@ -1,4 +1,4 @@
-#if !(__ANDROID__ || __IOS__ || WINDOWS)
+#if !(__ANDROID__ || __IOS__ || WINDOWS || TIZEN)
using System;
using System.Collections.Generic;
using System.Text;
diff --git a/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs b/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs
index e89ea8313c..9c6fad5d85 100644
--- a/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs
+++ b/src/Compatibility/Core/src/MauiHandlersCollectionExtensions.cs
@@ -126,4 +126,4 @@ namespace Microsoft.Maui.Controls.Compatibility.Hosting
return effectsBuilder;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs b/src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs
new file mode 100644
index 0000000000..dab4452aaa
--- /dev/null
+++ b/src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs
@@ -0,0 +1,62 @@
+#pragma warning disable CS0612 // Type or member is obsolete
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+#pragma warning disable CS0612 // Type or member is obsolete
+using Microsoft.Maui.Graphics;
+using Rect = Microsoft.Maui.Graphics.Rect;
+using ERect = ElmSharp.Rect;
+using PlatformView = ElmSharp.EvasObject;
+
+namespace Microsoft.Maui.Controls.Compatibility
+{
+ public partial class RendererToHandlerShim : IPlatformViewHandler
+ {
+ protected override PlatformView CreatePlatformView()
+ {
+ return VisualElementRenderer.NativeView;
+ }
+
+ IVisualElementRenderer CreateRenderer(IView view)
+ {
+ return Internals.Registrar.Registered.GetHandlerForObject(view) ?? new DefaultRenderer();
+ }
+
+ public override Size GetDesiredSize(double widthConstraint, double heightConstraint)
+ {
+ if (VisualElementRenderer == null)
+ return Size.Zero;
+
+ // TODO. It is workaroud code, Controls.VisualElement.MeasureOverride implementation is wrong. it does not apply Height/WidthRequest
+ return VisualElementRenderer.Element.Measure(widthConstraint, heightConstraint).Request;
+ }
+
+ public override void UpdateValue(string property)
+ {
+ base.UpdateValue(property);
+ if (property == "Frame")
+ {
+ PlatformArrange(VisualElementRenderer.Element.Bounds);
+ }
+ }
+
+ public override void PlatformArrange(Rect frame)
+ {
+ base.PlatformArrange(frame);
+ VisualElementRenderer.UpdateLayout();
+ }
+
+ public override ERect GetPlatformContentGeometry()
+ {
+ return VisualElementRenderer?.GetNativeContentGeometry() ?? new ERect();
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ VisualElementRenderer?.Dispose();
+ VisualElementRenderer = null;
+ }
+ base.Dispose(disposing);
+ }
+ }
+}
diff --git a/src/Compatibility/Core/src/RendererToHandlerShim.cs b/src/Compatibility/Core/src/RendererToHandlerShim.cs
index 39cd804c61..11d9c74384 100644
--- a/src/Compatibility/Core/src/RendererToHandlerShim.cs
+++ b/src/Compatibility/Core/src/RendererToHandlerShim.cs
@@ -18,6 +18,13 @@ using static Microsoft.Maui.Controls.Compatibility.Platform.iOS.Platform;
using PlatformView = UIKit.UIView;
using Microsoft.Maui.Controls.Compatibility.Platform.iOS;
using ViewHandler = Microsoft.Maui.Handlers.ViewHandler;
+#elif TIZEN
+#pragma warning disable CS0612 // Type or member is obsolete
+using static Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Platform;
+#pragma warning disable CS0612 // Type or member is obsolete
+using PlatformView = ElmSharp.EvasObject;
+using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
+using ViewHandler = Microsoft.Maui.Handlers.ViewHandler;
#elif NETSTANDARD
using PlatformView = System.Object;
using ViewHandler = Microsoft.Maui.Handlers.ViewHandler;
diff --git a/src/Compatibility/Core/src/Tizen/Cells/CellRenderer.cs b/src/Compatibility/Core/src/Tizen/Cells/CellRenderer.cs
index 9d3b1b8260..9ef5ce2075 100644
--- a/src/Compatibility/Core/src/Tizen/Cells/CellRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Cells/CellRenderer.cs
@@ -3,6 +3,7 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public abstract class CellRenderer : IRegisterable
{
const string HeightProperty = "Height";
@@ -100,9 +101,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
var nativeSpan = new Native.Span();
nativeSpan.Text = span.Text;
- nativeSpan.ForegroundColor = span.TextColor.ToPlatform();
+ nativeSpan.ForegroundColor = span.TextColor.ToNative();
nativeSpan.FontAttributes = span.FontAttributes;
- nativeSpan.BackgroundColor = span.BackgroundColor.ToPlatform();
+ nativeSpan.BackgroundColor = span.BackgroundColor.ToNative();
nativeSpan.FontSize = span.FontSize;
nativeSpan.FontFamily = span.FontFamily;
return nativeSpan;
diff --git a/src/Compatibility/Core/src/Tizen/Cells/EntryCellRenderer.cs b/src/Compatibility/Core/src/Tizen/Cells/EntryCellRenderer.cs
index 62f4ecd19e..55ab30338c 100644
--- a/src/Compatibility/Core/src/Tizen/Cells/EntryCellRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Cells/EntryCellRenderer.cs
@@ -2,9 +2,11 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using ElmSharp;
+using XStackLayout = Microsoft.Maui.Controls.StackLayout;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class EntryCellRenderer : ViewCellRenderer
{
readonly Dictionary _cacheCandidate = new Dictionary();
@@ -33,7 +35,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
var entry = new Entry()
{
- HorizontalOptions = LayoutOptions.FillAndExpand,
+ HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.Center,
FontSize = -1,
};
@@ -42,7 +44,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
entry.SetBinding(InputView.KeyboardProperty, new Binding(EntryCell.KeyboardProperty.PropertyName));
entry.SetBinding(Entry.HorizontalTextAlignmentProperty, new Binding(EntryCell.HorizontalTextAlignmentProperty.PropertyName));
- var layout = new StackLayout()
+ var layout = new XStackLayout()
{
Orientation = StackOrientation.Horizontal,
Children = {
@@ -95,7 +97,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- return ((Color)value).IsDefault ? ThemeConstants.EntryCell.ColorClass.DefaultLabelColor : value;
+ return (value == null || ((Color)value).IsDefault) ? ThemeConstants.EntryCell.ColorClass.DefaultLabelColor : value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
diff --git a/src/Compatibility/Core/src/Tizen/Cells/ImageCellRenderer.cs b/src/Compatibility/Core/src/Tizen/Cells/ImageCellRenderer.cs
index 57b36327eb..d11c12561d 100644
--- a/src/Compatibility/Core/src/Tizen/Cells/ImageCellRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Cells/ImageCellRenderer.cs
@@ -3,6 +3,7 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class ImageCellRenderer : TextCellRenderer
{
public ImageCellRenderer() : this(ThemeManager.GetImageCellRendererStyle())
diff --git a/src/Compatibility/Core/src/Tizen/Cells/SwitchCellRenderer.cs b/src/Compatibility/Core/src/Tizen/Cells/SwitchCellRenderer.cs
index 53ac419f17..ff1475b201 100644
--- a/src/Compatibility/Core/src/Tizen/Cells/SwitchCellRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Cells/SwitchCellRenderer.cs
@@ -1,8 +1,10 @@
using System.Collections.Generic;
+using Microsoft.Maui.Devices;
using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class SwitchCellRenderer : CellRenderer
{
readonly Dictionary _cacheCandidate = new Dictionary();
diff --git a/src/Compatibility/Core/src/Tizen/Cells/TextCellRenderer.cs b/src/Compatibility/Core/src/Tizen/Cells/TextCellRenderer.cs
index 1e44d9a699..4c89702d5e 100644
--- a/src/Compatibility/Core/src/Tizen/Cells/TextCellRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Cells/TextCellRenderer.cs
@@ -3,6 +3,7 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class TextCellRenderer : CellRenderer
{
bool _groupMode = false;
diff --git a/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs b/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs
index 6acda7e5de..7351d27fe6 100644
--- a/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs
@@ -3,6 +3,7 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class ViewCellRenderer : CellRenderer
{
readonly Dictionary _cacheCandidate = new Dictionary();
@@ -98,7 +99,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
if (element is Button || element is Switch)
{
- var nativeView = Platform.GetRenderer(element).NativeView ?? null;
+ var nativeView = Platform.GetRenderer(element)?.NativeView ?? null;
if (nativeView != null)
{
nativeView.PropagateEvents = false;
diff --git a/src/Compatibility/Core/src/Tizen/Compatibility.Tizen.csproj b/src/Compatibility/Core/src/Tizen/Compatibility.Tizen.csproj
deleted file mode 100644
index 8a2e33b20d..0000000000
--- a/src/Compatibility/Core/src/Tizen/Compatibility.Tizen.csproj
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
- Tizen Backend for Xamarin.Forms
-
-
- tizen40
- Tizen
- v4.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Compatibility/Core/src/Tizen/Deserializer.cs b/src/Compatibility/Core/src/Tizen/Deserializer.cs
deleted file mode 100644
index a8e7a690ab..0000000000
--- a/src/Compatibility/Core/src/Tizen/Deserializer.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.IO.IsolatedStorage;
-using System.Runtime.Serialization;
-using System.Threading.Tasks;
-using System.Xml;
-
-namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
-{
- internal class Deserializer : Internals.IDeserializer
- {
- const string PropertyStoreFile = "PropertyStore.forms";
-
- public Task> DeserializePropertiesAsync() => Task.Factory.StartNew(DeserializeProperties);
-
- [RequiresUnreferencedCode(TrimmerConstants.SerializerTrimmerWarning)]
- IDictionary DeserializeProperties()
- {
- // Deserialize property dictionary to local storage
- // Make sure to use Internal
- using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
- {
- if (!store.FileExists(PropertyStoreFile))
- return null;
-
- using (IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile, System.IO.FileMode.Open, System.IO.FileAccess.Read))
- using (XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
- {
- if (stream.Length == 0)
- return null;
-
- try
- {
- var dcs = new DataContractSerializer(typeof(Dictionary));
- return (IDictionary)dcs.ReadObject(reader);
- }
- catch (Exception e)
- {
- Debug.WriteLine("Could not deserialize properties: " + e.Message);
- Internals.Log.Warning("Microsoft.Maui.Controls.Compatibility PropertyStore", $"Exception while reading Application properties: {e}");
- }
- }
- }
-
- return null;
- }
-
- [RequiresUnreferencedCode(TrimmerConstants.SerializerTrimmerWarning)]
- public Task SerializePropertiesAsync(IDictionary properties)
- {
- properties = new Dictionary(properties);
-
- // No need to write 0 properties if no file exists
- if (properties.Count <= 0)
- return Task.CompletedTask;
-
- return Task.Factory.StartNew(SerializeProperties, properties);
- }
-
- [RequiresUnreferencedCode(TrimmerConstants.SerializerTrimmerWarning)]
- void SerializeProperties(object properties)
- {
- using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
- {
- // No need to write 0 properties if no file exists
- if (properties.Count == 0 && !store.FileExists(PropertyStoreFile))
- {
- return;
- }
- using (IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile + ".tmp", System.IO.FileMode.OpenOrCreate))
- using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateBinaryWriter(stream))
- {
- try
- {
- var dcs = new DataContractSerializer(typeof(Dictionary));
- dcs.WriteObject(writer, properties);
- writer.Flush();
- }
- catch (Exception e)
- {
- Debug.WriteLine("Could not serialize properties: " + e.Message);
- Internals.Log.Warning("Microsoft.Maui.Controls.Compatibility PropertyStore", $"Exception while writing Application properties: {e}");
- return;
- }
- }
-
- try
- {
- if (store.FileExists(PropertyStoreFile))
- store.DeleteFile(PropertyStoreFile);
- store.MoveFile(PropertyStoreFile + ".tmp", PropertyStoreFile);
- }
- catch (Exception e)
- {
- Debug.WriteLine("Could not move new serialized property file over old: " + e.Message);
- Internals.Log.Warning("Microsoft.Maui.Controls.Compatibility PropertyStore", $"Exception while writing Application properties: {e}");
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/Tizen/DisplayResolutionUnit.cs b/src/Compatibility/Core/src/Tizen/DisplayResolutionUnit.cs
index fdd1138ffc..dd8925343d 100644
--- a/src/Compatibility/Core/src/Tizen/DisplayResolutionUnit.cs
+++ b/src/Compatibility/Core/src/Tizen/DisplayResolutionUnit.cs
@@ -1,4 +1,5 @@
using System;
+using TDisplayResolutionUnit = Tizen.UIExtensions.Common.DisplayResolutionUnit;
namespace Microsoft.Maui.Controls.Compatibility
{
@@ -50,4 +51,34 @@ namespace Microsoft.Maui.Controls.Compatibility
public double ViewportWidth { get; private set; } = -1;
}
+
+ public static class DisplayResolutionUnitConverter
+ {
+ public static DisplayResolutionUnit ToCompatibility(this TDisplayResolutionUnit unit, double width = 0) => unit switch
+ {
+ TDisplayResolutionUnit.DP => DisplayResolutionUnit.DP(),
+ TDisplayResolutionUnit.DeviceScaledDP => DisplayResolutionUnit.DP(true),
+ TDisplayResolutionUnit.Pixel => DisplayResolutionUnit.Pixel(),
+ TDisplayResolutionUnit.DeviceScaledPixel => DisplayResolutionUnit.Pixel(true),
+ TDisplayResolutionUnit.VP => DisplayResolutionUnit.VP(width),
+ _ => DisplayResolutionUnit.DP(),
+ };
+
+ public static TDisplayResolutionUnit ToDeviceInfo(this DisplayResolutionUnit unit)
+ {
+ if (unit.UseDP)
+ {
+ return unit.UseDeviceScale ? TDisplayResolutionUnit.DeviceScaledDP : TDisplayResolutionUnit.DP;
+ }
+ else if (unit.UseVP)
+ {
+ Tizen.UIExtensions.Common.DeviceInfo.ViewPortWidth = unit.ViewportWidth;
+ return TDisplayResolutionUnit.VP;
+ }
+ else
+ {
+ return unit.UseDeviceScale ? TDisplayResolutionUnit.DeviceScaledPixel : TDisplayResolutionUnit.Pixel;
+ }
+ }
+ }
}
diff --git a/src/Compatibility/Core/src/Tizen/DragGestureHandler.cs b/src/Compatibility/Core/src/Tizen/DragGestureHandler.cs
index 3608360e0e..dc1e4001ad 100644
--- a/src/Compatibility/Core/src/Tizen/DragGestureHandler.cs
+++ b/src/Compatibility/Core/src/Tizen/DragGestureHandler.cs
@@ -7,6 +7,7 @@ using EGestureType = ElmSharp.GestureLayer.GestureType;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class DragGestureHandler : GestureHandler
{
bool _isApi4;
@@ -84,7 +85,10 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
if (Renderer == null)
return;
- var arg = dragGestureRecognizer.SendDragStarting(Renderer.Element);
+ if (Renderer.Element is not View view)
+ return;
+
+ var arg = dragGestureRecognizer.SendDragStarting(view);
if (arg.Cancel)
return;
diff --git a/src/Compatibility/Core/src/Tizen/DropGestureHandler.cs b/src/Compatibility/Core/src/Tizen/DropGestureHandler.cs
index f9c03d5650..13b73ae158 100644
--- a/src/Compatibility/Core/src/Tizen/DropGestureHandler.cs
+++ b/src/Compatibility/Core/src/Tizen/DropGestureHandler.cs
@@ -6,6 +6,7 @@ using EGestureType = ElmSharp.GestureLayer.GestureType;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class DropGestureHandler : GestureHandler
{
bool _isApi4;
@@ -103,7 +104,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
if (currentStateData.DataPackage == null || currentStateData.AcceptedOperation == DataPackageOperation.None)
return false;
- Device.BeginInvokeOnMainThread(async () =>
+ Application.Current?.Dispatcher.Dispatch(async () =>
{
if (Recognizer is DropGestureRecognizer dropRecognizer && dropRecognizer.AllowDrop)
await dropRecognizer.SendDrop(new DropEventArgs(currentStateData.DataPackage.View));
diff --git a/src/Compatibility/Core/src/Tizen/EmbeddedFontLoader.cs b/src/Compatibility/Core/src/Tizen/EmbeddedFontLoader.cs
index 00d57405c5..09d16a7cba 100644
--- a/src/Compatibility/Core/src/Tizen/EmbeddedFontLoader.cs
+++ b/src/Compatibility/Core/src/Tizen/EmbeddedFontLoader.cs
@@ -1,49 +1,7 @@
-using System;
-using System.IO;
-using ElmSharp;
-using Tizen.Common;
-using IOPath = System.IO.Path;
-using TApplication = Tizen.Applications.Application;
-
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
- public class EmbeddedFontLoader : IEmbeddedFontLoader, IRegisterable
+ public class CompatibilityEmbeddedFontLoader : EmbeddedFontLoader, IRegisterable
{
- const string _fontCacheFolderName = "fonts";
-
- public DirectoryInfo FontCacheDirectory { get; private set; }
-
- public EmbeddedFontLoader()
- {
- FontCacheDirectory = Directory.CreateDirectory(IOPath.Combine(TApplication.Current.DirectoryInfo.Data, _fontCacheFolderName));
- Utility.AppendGlobalFontPath(FontCacheDirectory.FullName);
- }
-
- public (bool success, string filePath) LoadFont(EmbeddedFont font)
- {
- var filePath = IOPath.Combine(FontCacheDirectory.FullName, font.FontName);
- if (File.Exists(filePath))
- return (true, filePath);
- try
- {
- using (var fileStream = File.Create(filePath))
- {
- font.ResourceStream.CopyTo(fileStream);
- }
-
- if (DotnetUtil.TizenAPIVersion > 5)
- {
- FontExtensions.FontReinit();
- }
-
- return (true, filePath);
- }
- catch (Exception ex)
- {
- Log.Error(ex.Message);
- File.Delete(filePath);
- }
- return (false, null);
- }
+ //Provide compatibilityEmveddedFontLoader (implements IRegisterable) for static registar
}
}
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/Tizen/ExportCellAttribute.cs b/src/Compatibility/Core/src/Tizen/ExportCellAttribute.cs
deleted file mode 100644
index fd6844112e..0000000000
--- a/src/Compatibility/Core/src/Tizen/ExportCellAttribute.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace Microsoft.Maui.Controls.Compatibility
-{
- [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
- public sealed class ExportCellAttribute : HandlerAttribute
- {
- public ExportCellAttribute(Type handler, Type target) : base(handler, target)
- {
- }
- }
-}
diff --git a/src/Compatibility/Core/src/Tizen/ExportHandlerAttribute.cs b/src/Compatibility/Core/src/Tizen/ExportHandlerAttribute.cs
deleted file mode 100644
index 17a126abb3..0000000000
--- a/src/Compatibility/Core/src/Tizen/ExportHandlerAttribute.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace Microsoft.Maui.Controls.Compatibility
-{
- [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
- public sealed class ExportHandlerAttribute : HandlerAttribute
- {
- public ExportHandlerAttribute(Type handler, Type target) : base(handler, target)
- {
- }
- }
-}
diff --git a/src/Compatibility/Core/src/Tizen/ExportImageSourceHandlerAttribute.cs b/src/Compatibility/Core/src/Tizen/ExportImageSourceHandlerAttribute.cs
deleted file mode 100644
index fb680b156e..0000000000
--- a/src/Compatibility/Core/src/Tizen/ExportImageSourceHandlerAttribute.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace Microsoft.Maui.Controls.Compatibility
-{
- [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
- public sealed class ExportImageSourceHandlerAttribute : HandlerAttribute
- {
- public ExportImageSourceHandlerAttribute(Type handler, Type target) : base(handler, target)
- {
- }
- }
-}
diff --git a/src/Compatibility/Core/src/Tizen/ExportRendererAttribute.cs b/src/Compatibility/Core/src/Tizen/ExportRendererAttribute.cs
deleted file mode 100644
index f07feb8da8..0000000000
--- a/src/Compatibility/Core/src/Tizen/ExportRendererAttribute.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
-
-namespace Microsoft.Maui.Controls.Compatibility
-{
- [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
- public sealed class ExportRendererAttribute : HandlerAttribute
- {
- TargetIdiom Target { get; set; }
-
- public ExportRendererAttribute(Type handler, Type target) : this(handler, target, null)
- {
- }
-
- public ExportRendererAttribute(Type handler, Type target, Type[] supportedVisuals) : base(handler, target, supportedVisuals)
- {
- }
-
- public ExportRendererAttribute(Type handler, Type target, TargetIdiom targetIdiom) : this(handler, target, null, targetIdiom)
- {
- }
-
- public ExportRendererAttribute(Type handler, Type target, Type[] supportedVisuals, TargetIdiom targetIdiom) : base(handler, target, supportedVisuals)
- {
- Target = targetIdiom;
- }
-
- public override bool ShouldRegister()
- {
- if (Target == TargetIdiom.Unsupported)
- return true;
-
- return (Target == Device.Idiom);
- }
- }
-}
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/AccessibilityExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/AccessibilityExtensions.cs
index e1e025ff2d..31d5923c59 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/AccessibilityExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/AccessibilityExtensions.cs
@@ -2,6 +2,7 @@ using ElmSharp.Accessible;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete]
public static class AccessibilityExtensions
{
public static string SetAccessibilityName(this IAccessibleObject Control, Element Element, string _defaultAccessibilityName = null)
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/BrushExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/BrushExtensions.cs
index 17f2980eaf..4d641e206c 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/BrushExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/BrushExtensions.cs
@@ -2,6 +2,7 @@ using System;
using System.Linq;
using SkiaSharp;
using SkiaSharp.Views.Tizen;
+using Microsoft.Maui.Graphics;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
@@ -82,7 +83,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
public static SKColor ToSolidColor(this SolidColorBrush solidColorBrush)
{
- return solidColorBrush.Color != Color.Default ? solidColorBrush.Color.ToPlatform().ToSKColor() : SKColor.Empty;
+ return solidColorBrush.Color.IsDefault() ? SKColor.Empty : solidColorBrush.Color.ToNative().ToSKColor();
}
static SKShader CreateLinearGradient(LinearGradientBrush linearGradientBrush, SKRect pathBounds)
@@ -90,7 +91,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
var startPoint = new SKPoint(pathBounds.Left + (float)linearGradientBrush.StartPoint.X * pathBounds.Width, pathBounds.Top + (float)linearGradientBrush.StartPoint.Y * pathBounds.Height);
var endPoint = new SKPoint(pathBounds.Left + (float)linearGradientBrush.EndPoint.X * pathBounds.Width, pathBounds.Top + (float)linearGradientBrush.EndPoint.Y * pathBounds.Height);
var orderedGradientStops = linearGradientBrush.GradientStops.OrderBy(x => x.Offset).ToList();
- var gradientColors = orderedGradientStops.Select(x => x.Color.ToPlatform().ToSKColor()).ToArray();
+ var gradientColors = orderedGradientStops.Select(x => x.Color.ToNative().ToSKColor()).ToArray();
var gradientColorPos = orderedGradientStops.Select(x => x.Offset).ToArray();
return SKShader.CreateLinearGradient(startPoint, endPoint, gradientColors, gradientColorPos, SKShaderTileMode.Clamp);
}
@@ -100,7 +101,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
var center = new SKPoint((float)radialGradientBrush.Center.X * pathBounds.Width + pathBounds.Left, (float)radialGradientBrush.Center.Y * pathBounds.Height + pathBounds.Top);
var radius = (float)radialGradientBrush.Radius * Math.Max(pathBounds.Height, pathBounds.Width);
var orderedGradientStops = radialGradientBrush.GradientStops.OrderBy(x => x.Offset).ToList();
- var gradientColors = orderedGradientStops.Select(x => x.Color.ToPlatform().ToSKColor()).ToArray();
+ var gradientColors = orderedGradientStops.Select(x => x.Color.ToNative().ToSKColor()).ToArray();
var gradientColorPos = orderedGradientStops.Select(x => x.Offset).ToArray();
return SKShader.CreateRadialGradient(center, radius, gradientColors, gradientColorPos, SKShaderTileMode.Clamp);
}
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs
index 0a5e12f52a..0f86966258 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/ColorExtensions.cs
@@ -1,3 +1,4 @@
+using Microsoft.Maui.Graphics;
using EColor = ElmSharp.Color;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
@@ -11,25 +12,25 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
/// The Microsoft.Maui.Controls.Compatibility.Color instance which will be converted to a ElmSharp.Color
public static EColor ToNative(this Color c)
{
- if (c.IsDefault)
+ if (c == null)
{
// Trying to convert the default color, this may result in black color.
return EColor.Default;
}
else
{
- return new EColor((int)(255.0 * c.R), (int)(255.0 * c.G), (int)(255.0 * c.B), (int)(255.0 * c.A));
+ return new EColor((int)(255.0 * c.Red), (int)(255.0 * c.Green), (int)(255.0 * c.Blue), (int)(255.0 * c.Alpha));
}
}
public static Color WithAlpha(this Color color, double alpha)
{
- return new Color(color.R, color.G, color.B, (int)(255 * alpha));
+ return new Color(color.Red, color.Green, color.Blue, (int)(255 * alpha));
}
public static Color WithPremultiplied(this Color color, double alpha)
{
- return new Color((int)(color.R * alpha), (int)(color.G * alpha), (int)(color.B * alpha), color.A);
+ return new Color((int)(color.Red * alpha), (int)(color.Green * alpha), (int)(color.Blue * alpha), color.Alpha);
}
///
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs
index 2d293ce5e3..fb54025692 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/DensityIndependentPixelExtensions.cs
@@ -1,3 +1,5 @@
+using Microsoft.Maui.Graphics;
+using Rect = Microsoft.Maui.Graphics.Rect;
using ERect = ElmSharp.Rect;
using ESize = ElmSharp.Size;
@@ -8,12 +10,12 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
///
public static class DensityIndependentPixelExtensions
{
- public static Rectangle ToDP(this ERect rect)
+ public static Rect ToDP(this ERect rect)
{
- return new Rectangle(Forms.ConvertToScaledDP(rect.X), Forms.ConvertToScaledDP(rect.Y), Forms.ConvertToScaledDP(rect.Width), Forms.ConvertToScaledDP(rect.Height));
+ return new Rect(Forms.ConvertToScaledDP(rect.X), Forms.ConvertToScaledDP(rect.Y), Forms.ConvertToScaledDP(rect.Width), Forms.ConvertToScaledDP(rect.Height));
}
- public static ERect ToPixel(this Rectangle rect)
+ public static ERect ToPixel(this Rect rect)
{
return new ERect(Forms.ConvertToScaledPixel(rect.X), Forms.ConvertToScaledPixel(rect.Y), Forms.ConvertToScaledPixel(rect.Width), Forms.ConvertToScaledPixel(rect.Height));
}
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/FontExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/FontExtensions.cs
deleted file mode 100644
index 74d485f18d..0000000000
--- a/src/Compatibility/Core/src/Tizen/Extensions/FontExtensions.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System.Runtime.InteropServices;
-using Microsoft.Maui.Controls.Compatibility.Core;
-using Microsoft.Maui.Controls.Compatibility.Internals;
-
-namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
-{
- public static class FontExtensions
- {
- public static string ToNativeFontFamily(this string self)
- {
- if (string.IsNullOrEmpty(self))
- return null;
-
- var cleansedFont = CleanseFontName(self);
- int index = cleansedFont.LastIndexOf('-');
- if (index != -1)
- {
- string font = cleansedFont.Substring(0, index);
- string style = cleansedFont.Substring(index + 1);
- return $"{font}:style={style}";
- }
- else
- {
- return cleansedFont;
- }
- }
-
- static string CleanseFontName(string fontName)
- {
- //First check Alias
- var (hasFontAlias, fontPostScriptName) = FontRegistrar.HasFont(fontName);
- if (hasFontAlias)
- return fontPostScriptName;
- var fontFile = FontFile.FromString(fontName);
-
- if (!string.IsNullOrWhiteSpace(fontFile.Extension))
- {
- var (hasFont, _) = FontRegistrar.HasFont(fontFile.FileNameWithExtension());
- if (hasFont)
- return fontFile.PostScriptName;
- }
- else
- {
- foreach (var ext in FontFile.Extensions)
- {
- var formated = fontFile.FileNameWithExtension(ext);
- var (hasFont, filePath) = FontRegistrar.HasFont(formated);
- if (hasFont)
- return fontFile.PostScriptName;
- }
- }
- return fontFile.PostScriptName;
- }
-
- public static void FontReinit()
- {
- evas_font_reinit();
- }
-
- [DllImport("libelementary.so.1")]
- static extern void evas_font_reinit();
- }
-}
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs
index c9319e18cd..ceb0487636 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/GeometryExtensions.cs
@@ -1,7 +1,9 @@
using System.Collections.Generic;
using SkiaSharp;
-using Microsoft.Maui.Controls.Compatibility.Shapes;
-using FormsRectangle = Microsoft.Maui.Controls.Compatibility.Rectangle;
+using Microsoft.Maui.Controls.Shapes;
+using Rect = Microsoft.Maui.Graphics.Rect;
+using Point = Microsoft.Maui.Graphics.Point;
+
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
@@ -9,7 +11,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
public static SKPath ToSKPath(this Geometry geometry)
{
+#pragma warning disable IL2026
return geometry == null ? MakePath(geometry) : MakePath((dynamic)geometry);
+#pragma warning disable IL2026
}
static SKPath MakePath(Geometry geometry)
@@ -34,7 +38,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
static SKPath MakePath(RectangleGeometry rectangleGeometry)
{
var path = new SKPath();
- FormsRectangle rect = rectangleGeometry.Rect;
+ Rect rect = rectangleGeometry.Rect;
path.AddRect(new SKRect(
Forms.ConvertToScaledPixel(rect.Left),
@@ -66,7 +70,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
foreach (Geometry child in geometryGroup.Children)
{
+#pragma warning disable IL2026
SKPath childPath = MakePath((dynamic)child);
+#pragma warning disable IL2026
path.AddPath(childPath);
}
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/KeyboardExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/KeyboardExtensions.cs
index 25ca64110e..d07cbba0ed 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/KeyboardExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/KeyboardExtensions.cs
@@ -1,5 +1,4 @@
using ElmSharp;
-using Microsoft.Maui.Controls.Compatibility.Internals;
using EEntry = ElmSharp.Entry;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
@@ -66,7 +65,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
public static void UpdateKeyboard(this Native.IEntry control, Keyboard keyboard, bool isSpellCheckEnabled, bool isTextPredictionEnabled)
{
- control.Keyboard = keyboard.ToPlatform();
+ control.Keyboard = keyboard.ToNative();
if (keyboard is CustomKeyboard customKeyboard)
{
(control as EEntry).AutoCapital = customKeyboard.Flags.ToAutoCapital();
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/NativeBindingExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/NativeBindingExtensions.cs
index 4fca4515e3..a833dd5bf9 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/NativeBindingExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/NativeBindingExtensions.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
-using Microsoft.Maui.Controls.Compatibility.Internals;
+using Microsoft.Maui.Controls.Internals;
using EObject = ElmSharp.EvasObject;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/PageExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/PageExtensions.cs
index d0c6c756d3..6d777e438e 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/PageExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/PageExtensions.cs
@@ -3,6 +3,7 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility
{
+ [Obsolete]
public static class PageExtensions
{
public static EvasObject CreateEvasObject(this Page page, EvasObject parent, bool hasAlpha = false)
@@ -33,6 +34,7 @@ namespace Microsoft.Maui.Controls.Compatibility
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public static class PageExtensions
{
public static EvasObject CreateEvasObject(this ContentPage page, EvasObject parent, bool hasAlpha = false)
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/PlatformConfigurationExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/PlatformConfigurationExtensions.cs
index 2f674573c8..088e7f4e27 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/PlatformConfigurationExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/PlatformConfigurationExtensions.cs
@@ -1,4 +1,4 @@
-using CurrentPlatform = Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.Tizen;
+using CurrentPlatform = Microsoft.Maui.Controls.PlatformConfiguration.Tizen;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/TextAlignmentExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/TextAlignmentExtensions.cs
index 276d0fc574..7abde6d2c2 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/TextAlignmentExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/TextAlignmentExtensions.cs
@@ -1,3 +1,5 @@
+using Microsoft.Extensions.Logging;
+
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
public static class TextAlignmentExtensions
@@ -16,9 +18,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
return Native.TextAlignment.End;
default:
- Log.Warn("Warning: unrecognized HorizontalTextAlignment value {0}. " +
+ Application.Current?.FindMauiContext()?.CreateLogger()?.LogWarning("Warning: unrecognized HorizontalTextAlignment value {0}. " +
"Expected: {Start|Center|End}.", alignment);
- Log.Debug("Falling back to platform's default settings.");
+ Application.Current?.FindMauiContext()?.CreateLogger()?.LogDebug("Falling back to platform's default settings.");
return Native.TextAlignment.Auto;
}
}
diff --git a/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs b/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs
index 7649bc12c4..63805730a7 100644
--- a/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs
+++ b/src/Compatibility/Core/src/Tizen/Extensions/TransformExtensions.cs
@@ -1,5 +1,5 @@
using SkiaSharp;
-using Microsoft.Maui.Controls.Compatibility.Shapes;
+using Microsoft.Maui.Controls.Shapes;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
diff --git a/src/Compatibility/Core/src/Tizen/Forms.cs b/src/Compatibility/Core/src/Tizen/Forms.cs
index cd214025da..529d8c97c5 100644
--- a/src/Compatibility/Core/src/Tizen/Forms.cs
+++ b/src/Compatibility/Core/src/Tizen/Forms.cs
@@ -7,12 +7,14 @@ using System.Reflection;
using ElmSharp;
using ElmSharp.Wearable;
using Tizen.Applications;
-using Microsoft.Maui.Controls.Compatibility.Internals;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
-using Microsoft.Maui.Controls.Compatibility.Shapes;
-using DeviceOrientation = Microsoft.Maui.Controls.Compatibility.Internals.DeviceOrientation;
+using Microsoft.Maui.Controls.Shapes;
+using Microsoft.Maui.Devices;
using ELayout = ElmSharp.Layout;
using TSystemInfo = Tizen.System.Information;
+using Size = Microsoft.Maui.Graphics.Size;
+using Color = Microsoft.Maui.Graphics.Color;
namespace Microsoft.Maui.Controls.Compatibility
{
@@ -29,11 +31,12 @@ namespace Microsoft.Maui.Controls.Compatibility
Lightweight,
}
+ [Obsolete]
public class InitializationOptions
{
public CoreApplication Context { get; set; }
public bool UseDeviceIndependentPixel { get; set; }
- public bool UseSkiaSharp { get; set; }
+ public bool UseSkiaSharp { get; set; } = true;
public HandlerAttribute[] Handlers { get; set; }
public Dictionary> CustomHandlers { get; set; } // for static registers
public Assembly[] Assemblies { get; set; }
@@ -51,6 +54,9 @@ namespace Microsoft.Maui.Controls.Compatibility
public string Name;
public ExportEffectAttribute[] Effects;
}
+ public InitializationOptions()
+ {
+ }
public InitializationOptions(CoreApplication application)
{
@@ -80,7 +86,11 @@ namespace Microsoft.Maui.Controls.Compatibility
}
}
+#pragma warning disable CS0618 // Type or member is obsolete
+#pragma warning disable CS0612 // Type or member is obsolete
public static class Forms
+#pragma warning disable CS0612 // Type or member is obsolete
+#pragma warning disable CS0618 // Type or member is obsolete
{
static Lazy s_profile = new Lazy(() =>
{
@@ -137,92 +147,41 @@ namespace Microsoft.Maui.Controls.Compatibility
return ThemeManager.GetBaseScale(s_deviceType.Value);
});
- class TizenDeviceInfo : DeviceInfo
+ static Lazy s_scalingFactor = new Lazy(() =>
{
- readonly Size pixelScreenSize;
+ int width = 0;
+ int height = 0;
- readonly Size scaledScreenSize;
+ TSystemInfo.TryGetValue("http://tizen.org/feature/screen.width", out width);
+ TSystemInfo.TryGetValue("http://tizen.org/feature/screen.height", out height);
- readonly double scalingFactor;
-
- readonly string profile;
-
- public override Size PixelScreenSize
+ var scalingFactor = 1.0; // scaling is disabled, we're using pixels as Xamarin's geometry units
+ if (DisplayResolutionUnit.UseVP && DisplayResolutionUnit.ViewportWidth > 0)
{
- get
- {
- return this.pixelScreenSize;
- }
+ scalingFactor = width / DisplayResolutionUnit.ViewportWidth;
}
-
- public override Size ScaledScreenSize
+ else
{
- get
+ if (DisplayResolutionUnit.UseDP)
{
- return this.scaledScreenSize;
+ scalingFactor = s_dpi.Value / 160.0;
}
- }
- public Size PhysicalScreenSize { get; }
-
- public override double ScalingFactor
- {
- get
+ if (DisplayResolutionUnit.UseDeviceScale)
{
- return this.scalingFactor;
- }
- }
-
- public string Profile
- {
- get
- {
- return this.profile;
- }
- }
-
- public TizenDeviceInfo()
- {
- int width = 0;
- int height = 0;
-
- TSystemInfo.TryGetValue("http://tizen.org/feature/screen.width", out width);
- TSystemInfo.TryGetValue("http://tizen.org/feature/screen.height", out height);
-
- var physicalScale = s_dpi.Value / 160.0;
- PhysicalScreenSize = new Size(width / physicalScale, height / physicalScale);
-
- scalingFactor = 1.0; // scaling is disabled, we're using pixels as Xamarin's geometry units
- if (DisplayResolutionUnit.UseVP && DisplayResolutionUnit.ViewportWidth > 0)
- {
- scalingFactor = width / DisplayResolutionUnit.ViewportWidth;
- }
- else
- {
- if (DisplayResolutionUnit.UseDP)
+ var portraitSize = Math.Min(PhysicalScreenSize.Width, PhysicalScreenSize.Height);
+ if (portraitSize > 2000)
{
- scalingFactor = s_dpi.Value / 160.0;
+ scalingFactor *= 4;
}
-
- if (DisplayResolutionUnit.UseDeviceScale)
+ else if (portraitSize > 1000)
{
- var portraitSize = Math.Min(PhysicalScreenSize.Width, PhysicalScreenSize.Height);
- if (portraitSize > 2000)
- {
- scalingFactor *= 4;
- }
- else if (portraitSize > 1000)
- {
- scalingFactor *= 2.5;
- }
+ scalingFactor *= 2.5;
}
}
-
- pixelScreenSize = new Size(width, height);
- scaledScreenSize = new Size(width / scalingFactor, height / scalingFactor);
- profile = s_profile.Value;
}
- }
+ return scalingFactor;
+ });
static StaticRegistrarStrategy s_staticRegistrarStrategy = StaticRegistrarStrategy.None;
@@ -232,6 +191,12 @@ namespace Microsoft.Maui.Controls.Compatibility
public static event EventHandler ViewInitialized;
+ public static IMauiContext MauiContext
+ {
+ get;
+ internal set;
+ }
+
public static CoreApplication Context
{
get;
@@ -262,8 +227,6 @@ namespace Microsoft.Maui.Controls.Compatibility
private set;
}
- public static DeviceOrientation NaturalOrientation { get; } = GetDeviceOrientation();
-
public static StaticRegistrarStrategy StaticRegistrarStrategy => s_staticRegistrarStrategy;
public static PlatformType PlatformType => s_platformType;
@@ -274,11 +237,11 @@ namespace Microsoft.Maui.Controls.Compatibility
public static bool UseFastLayout { get; private set; }
- public static DisplayResolutionUnit DisplayResolutionUnit { get; private set; }
+ public static DisplayResolutionUnit DisplayResolutionUnit { get; private set; } = DisplayResolutionUnit.Pixel();
public static int ScreenDPI => s_dpi.Value;
- public static Size PhysicalScreenSize => (Device.info as TizenDeviceInfo).PhysicalScreenSize;
+ public static Size PhysicalScreenSize => DeviceDisplay.MainDisplayInfo.GetScaledScreenSize();
internal static TizenTitleBarVisibility TitleBarVisibility
{
@@ -286,23 +249,6 @@ namespace Microsoft.Maui.Controls.Compatibility
private set;
}
- static DeviceOrientation GetDeviceOrientation()
- {
- int width = 0;
- int height = 0;
- TSystemInfo.TryGetValue("http://tizen.org/feature/screen.width", out width);
- TSystemInfo.TryGetValue("http://tizen.org/feature/screen.height", out height);
-
- if (height >= width)
- {
- return DeviceOrientation.Portrait;
- }
- else
- {
- return DeviceOrientation.Landscape;
- }
- }
-
internal static void SendViewInitialized(this VisualElement self, EvasObject nativeView)
{
EventHandler viewInitialized = Forms.ViewInitialized;
@@ -316,6 +262,8 @@ namespace Microsoft.Maui.Controls.Compatibility
}
}
+ public static bool IsInitializedRenderers { get; private set; }
+
public static void SetTitleBarVisibility(TizenTitleBarVisibility visibility)
{
TitleBarVisibility = visibility;
@@ -384,41 +332,32 @@ namespace Microsoft.Maui.Controls.Compatibility
}
}
- public static void Init(CoreApplication application)
- {
- Init(application, false);
- }
+ [Obsolete]
+ public static void Init(IActivationState activationState) => Init(activationState.Context);
- public static void Init(CoreApplication application, bool useDeviceIndependentPixel)
- {
- DisplayResolutionUnit = DisplayResolutionUnit.FromInit(useDeviceIndependentPixel);
- SetupInit(application);
- }
+ [Obsolete]
+ public static void Init(IActivationState activationState, InitializationOptions options) => Init(activationState.Context, options);
- public static void Init(CoreApplication application, DisplayResolutionUnit unit)
+ [Obsolete]
+ public static void Init(IMauiContext context, InitializationOptions options = null)
{
- DisplayResolutionUnit = unit ?? DisplayResolutionUnit.Pixel();
- SetupInit(application);
- }
-
- public static void Init(InitializationOptions options)
- {
- if (options == null)
+ if (options != null && options.DisplayResolutionUnit != null)
{
- throw new ArgumentException("Must be set options", nameof(options));
+ DisplayResolutionUnit = options.DisplayResolutionUnit;
}
-
- DisplayResolutionUnit = options.DisplayResolutionUnit ?? DisplayResolutionUnit.FromInit(options.UseDeviceIndependentPixel);
- SetupInit(options.Context, options);
+ SetupInit(context, options);
}
- static void SetupInit(CoreApplication application, InitializationOptions options = null)
+ [Obsolete]
+ static void SetupInit(IMauiContext context, InitializationOptions options = null)
{
- Context = application;
+ MauiContext = context;
+ Context = options?.Context ?? MauiApplication.Current;
+ NativeParent = context.GetNativeParent();
+ Registrar.RegisterRendererToHandlerShim(RendererToHandlerShim.CreateShim);
if (!IsInitialized)
{
- Internals.Log.Listeners.Add(new XamarinLogListener());
if (System.Threading.SynchronizationContext.Current == null)
{
TizenSynchronizationContext.Initialize();
@@ -429,73 +368,51 @@ namespace Microsoft.Maui.Controls.Compatibility
Utility.AppendGlobalFontPath(@"/usr/share/fonts");
}
- Device.PlatformServices = new TizenPlatformServices();
- if (Device.info != null)
+ Device.DefaultRendererAssembly = typeof(Forms).Assembly;
+
+ if (options?.Flags.HasFlag(InitializationFlags.SkipRenderers) != true)
+ RegisterCompatRenderers(options);
+
+ if (options != null)
{
- ((TizenDeviceInfo)Device.info).Dispose();
- Device.info = null;
+ s_platformType = options.PlatformType;
+ s_useMessagingCenter = options.UseMessagingCenter;
+ UseSkiaSharp = options.UseSkiaSharp;
+ UseFastLayout = options.UseFastLayout;
}
- Device.Info = new Forms.TizenDeviceInfo();
+ Application.AccentColor = GetAccentColor();
+ ExpressionSearch.Default = new TizenExpressionSearch();
- if (!Forms.IsInitialized)
+ if (Context is WatchApplication)
+ s_platformType = PlatformType.Lightweight;
+
+ IsInitialized = true;
+ }
+
+ [Obsolete]
+ internal static void RegisterCompatRenderers(InitializationOptions maybeOptions = null)
+ {
+ if (!IsInitializedRenderers)
{
- if (options != null)
+ IsInitializedRenderers = true;
+ if (maybeOptions != null)
{
- s_platformType = options.PlatformType;
- s_useMessagingCenter = options.UseMessagingCenter;
- UseSkiaSharp = options.UseSkiaSharp;
- UseFastLayout = options.UseFastLayout;
+ var options = maybeOptions;
+ var handlers = options.Handlers;
+ var flags = options.Flags;
+ var effectScopes = options.EffectScopes;
+
+ //TODO: ExportCell?
+ //TODO: ExportFont
// renderers
- if (options.Handlers != null)
+ if (handlers != null)
{
- Registrar.RegisterRenderers(options.Handlers);
- }
- else
- {
- // static registrar
- if (options.StaticRegistarStrategy != StaticRegistrarStrategy.None)
- {
- s_staticRegistrarStrategy = options.StaticRegistarStrategy;
- StaticRegistrar.RegisterHandlers(options.CustomHandlers);
-
- if (options.StaticRegistarStrategy == StaticRegistrarStrategy.All)
- {
- Registrar.RegisterAll(new Type[]
- {
- typeof(ExportRendererAttribute),
- typeof(ExportImageSourceHandlerAttribute),
- typeof(ExportCellAttribute),
- typeof(ExportHandlerAttribute),
- typeof(ExportFontAttribute)
- });
-
- if (UseSkiaSharp)
- RegisterSkiaSharpRenderers();
- }
- }
- else
- {
- Registrar.RegisterAll(new Type[]
- {
- typeof(ExportRendererAttribute),
- typeof(ExportImageSourceHandlerAttribute),
- typeof(ExportCellAttribute),
- typeof(ExportHandlerAttribute),
- typeof(ExportFontAttribute)
- });
-
- if (UseSkiaSharp)
- RegisterSkiaSharpRenderers();
-
- if (UseFastLayout)
- Registrar.Registered.Register(typeof(Layout), typeof(FastLayoutRenderer));
- }
+ Registrar.RegisterRenderers(handlers);
}
// effects
- var effectScopes = options.EffectScopes;
if (effectScopes != null)
{
for (var i = 0; i < effectScopes.Length; i++)
@@ -506,28 +423,19 @@ namespace Microsoft.Maui.Controls.Compatibility
}
// css
- Registrar.RegisterStylesheets(options.Flags);
+ Registrar.RegisterStylesheets(flags);
}
else
{
- Registrar.RegisterAll(new Type[]
- {
+ // Only need to do this once
+ Registrar.RegisterAll(new[] {
typeof(ExportRendererAttribute),
- typeof(ExportImageSourceHandlerAttribute),
typeof(ExportCellAttribute),
- typeof(ExportHandlerAttribute),
+ typeof(ExportImageSourceHandlerAttribute),
typeof(ExportFontAttribute)
});
}
}
-
- Color.SetAccent(GetAccentColor(profile));
- ExpressionSearch.Default = new TizenExpressionSearch();
-
- if (application is WatchApplication)
- s_platformType = PlatformType.Lightweight;
-
- IsInitialized = true;
}
static void RegisterSkiaSharpRenderers()
@@ -545,26 +453,23 @@ namespace Microsoft.Maui.Controls.Compatibility
Registrar.Registered.Register(typeof(Shapes.Rectangle), typeof(Platform.Tizen.SkiaSharp.RectangleRenderer));
}
- static Color GetAccentColor(string profile)
+ static Color GetAccentColor()
{
// On Windows Phone, this is the complementary color chosen by the user.
// Good Windows Phone applications use this as part of their styling to provide a native look and feel.
// On iOS and Android this instance is set to a contrasting color that is visible on the default
// background but is not the same as the default text color.
- switch (profile)
- {
- case "mobile":
- // [Tizen_3.0]Basic_Interaction_GUI_[REF].xlsx Theme 001 (Default) 1st HSB: 188 70 80
- return Color.FromRgba(61, 185, 204, 255);
- case "tv":
- return Color.FromRgba(15, 15, 15, 230);
- case "wearable":
- // Theme A (Default) 1st HSB: 207 75 16
- return Color.FromRgba(10, 27, 41, 255);
- default:
- return Color.Black;
- }
+ if (DeviceInfo.Idiom == DeviceIdiom.Phone)
+ // [Tizen_3.0]Basic_Interaction_GUI_[REF].xlsx Theme 001 (Default) 1st HSB: 188 70 80
+ return Color.FromRgba(61, 185, 204, 255);
+ else if (DeviceInfo.Idiom == DeviceIdiom.TV)
+ return Color.FromRgba(15, 15, 15, 230);
+ else if (DeviceInfo.Idiom == DeviceIdiom.Watch)
+ // Theme A (Default) 1st HSB: 207 75 16
+ return Color.FromRgba(10, 27, 41, 255);
+ else
+ return Color.FromRgb(0, 0, 0);
}
///
@@ -591,7 +496,7 @@ namespace Microsoft.Maui.Controls.Compatibility
///
public static int ConvertToScaledPixel(double dp)
{
- return (int)Math.Round(dp * Device.Info.ScalingFactor);
+ return (int)Math.Round(dp * s_scalingFactor.Value);
}
///
@@ -604,7 +509,9 @@ namespace Microsoft.Maui.Controls.Compatibility
///
public static double ConvertToScaledDP(int pixel)
{
- return pixel / Device.Info.ScalingFactor;
+ if (pixel == int.MaxValue)
+ return double.PositiveInfinity;
+ return pixel / s_scalingFactor.Value;
}
///
@@ -617,7 +524,9 @@ namespace Microsoft.Maui.Controls.Compatibility
///
public static double ConvertToScaledDP(double pixel)
{
- return pixel / Device.Info.ScalingFactor;
+ if (pixel == double.PositiveInfinity)
+ return double.PositiveInfinity;
+ return pixel / s_scalingFactor.Value;
}
///
@@ -660,7 +569,7 @@ namespace Microsoft.Maui.Controls.Compatibility
{
Elementary.Initialize();
Elementary.ThemeOverlay();
- var window = new PreloadedWindow();
+ var window = new Microsoft.Maui.Controls.Compatibility.Platform.Tizen.PreloadedWindow();
TSystemInfo.TryGetValue("http://tizen.org/feature/screen.width", out int width);
TSystemInfo.TryGetValue("http://tizen.org/feature/screen.height", out int height);
}
diff --git a/src/Compatibility/Core/src/Tizen/FormsApplication.cs b/src/Compatibility/Core/src/Tizen/FormsApplication.cs
index 593437afae..330de47c62 100644
--- a/src/Compatibility/Core/src/Tizen/FormsApplication.cs
+++ b/src/Compatibility/Core/src/Tizen/FormsApplication.cs
@@ -7,20 +7,23 @@ using ElmSharp;
using ElmSharp.Wearable;
using Tizen.Applications;
using Tizen.Common;
-using Microsoft.Maui.Controls.Compatibility.Internals;
+using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native;
-using DeviceOrientation = Microsoft.Maui.Controls.Compatibility.Internals.DeviceOrientation;
+using Microsoft.Maui.Devices;
+using EWindow = ElmSharp.Window;
using ELayout = ElmSharp.Layout;
-using Specific = Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.TizenSpecific.Application;
+using EDisplayRotation = ElmSharp.DisplayRotation;
+using Specific = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.Application;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class FormsApplication : CoreUIApplication
{
ITizenPlatform _platform;
Application _application;
- Window _window;
+ EWindow _window;
bool _useBezelInteration;
protected FormsApplication()
@@ -31,7 +34,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
/// Gets the main window or null if it's not set.
///
/// The main window or null.
- public Window MainWindow
+ public EWindow MainWindow
{
get
{
@@ -67,20 +70,20 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
Environment.SetEnvironmentVariable("XDG_DATA_HOME", Current.DirectoryInfo.Data);
}
- var type = typeof(Window);
+ var type = typeof(EWindow);
// Use reflection to avoid breaking compatibility. ElmSharp.Window.CreateWindow() is has been added since API6.
var methodInfo = type.GetMethod("CreateWindow", BindingFlags.NonPublic | BindingFlags.Static);
- Window window = null;
+ EWindow window = null;
if (methodInfo != null)
{
- window = (Window)methodInfo.Invoke(null, new object[] { "FormsWindow" });
+ window = (EWindow)methodInfo.Invoke(null, new object[] { "FormsWindow" });
BaseLayout = (ELayout)window.GetType().GetProperty("BaseLayout")?.GetValue(window);
BaseCircleSurface = (CircleSurface)window.GetType().GetProperty("BaseCircleSurface")?.GetValue(window);
Forms.CircleSurface = BaseCircleSurface;
}
else // in case of Xamarin Preload
{
- window = PreloadedWindow.GetInstance() ?? new Window("FormsWindow");
+ window = PreloadedWindow.GetInstance() ?? new EWindow("FormsWindow");
if (window is PreloadedWindow precreated)
{
BaseLayout = precreated.BaseLayout;
@@ -128,7 +131,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
if (null == MainWindow)
{
- throw new InvalidOperationException("MainWindow is not prepared. This method should be called in OnCreated().");
+ throw new InvalidOperationException("MainEWindow is not prepared. This method should be called in OnCreated().");
}
if (null == application)
@@ -192,7 +195,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
void InitializeWindow()
{
- Debug.Assert(MainWindow != null, "Window cannot be null");
+ Debug.Assert(MainWindow != null, "EWindow cannot be null");
MainWindow.Active();
MainWindow.Show();
@@ -217,20 +220,13 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
conformant.SetContent(BaseLayout);
}
- MainWindow.AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_90 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270;
+ MainWindow.AvailableRotations = EDisplayRotation.Degree_0 | EDisplayRotation.Degree_90 | EDisplayRotation.Degree_180 | EDisplayRotation.Degree_270;
MainWindow.Deleted += (s, e) =>
{
Exit();
};
- Device.Info.CurrentOrientation = MainWindow.GetDeviceOrientation();
-
- MainWindow.RotationChanged += (sender, e) =>
- {
- Device.Info.CurrentOrientation = MainWindow.GetDeviceOrientation();
- };
-
MainWindow.BackButtonPressed += (sender, e) =>
{
if (_platform != null)
@@ -275,25 +271,4 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
base.Exit();
}
}
- static class WindowExtension
- {
- public static DeviceOrientation GetDeviceOrientation(this Window window)
- {
- DeviceOrientation orientation = DeviceOrientation.Other;
- var isPortraitDevice = Forms.NaturalOrientation.IsPortrait();
- switch (window.Rotation)
- {
- case 0:
- case 180:
- orientation = isPortraitDevice ? DeviceOrientation.Portrait : DeviceOrientation.Landscape;
- break;
-
- case 90:
- case 270:
- orientation = isPortraitDevice ? DeviceOrientation.Landscape : DeviceOrientation.Portrait;
- break;
- }
- return orientation;
- }
- }
}
diff --git a/src/Compatibility/Core/src/Tizen/GestureDetector.cs b/src/Compatibility/Core/src/Tizen/GestureDetector.cs
index 6e41259bac..a5c7fca263 100644
--- a/src/Compatibility/Core/src/Tizen/GestureDetector.cs
+++ b/src/Compatibility/Core/src/Tizen/GestureDetector.cs
@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Microsoft.Maui.Devices;
using ElmSharp;
using EGestureType = ElmSharp.GestureLayer.GestureType;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
internal class GestureDetector
{
readonly IDictionary> _handlerCache;
diff --git a/src/Compatibility/Core/src/Tizen/GestureHandler.cs b/src/Compatibility/Core/src/Tizen/GestureHandler.cs
index 763523013d..0df0a99280 100644
--- a/src/Compatibility/Core/src/Tizen/GestureHandler.cs
+++ b/src/Compatibility/Core/src/Tizen/GestureHandler.cs
@@ -4,6 +4,7 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public abstract class GestureHandler : IGestureController, INotifyPropertyChanged, IRegisterable
{
public IGestureRecognizer Recognizer { get; private set; }
diff --git a/src/Compatibility/Core/src/Tizen/HandlerToRendererShim.cs b/src/Compatibility/Core/src/Tizen/HandlerToRendererShim.cs
new file mode 100644
index 0000000000..22489b74cd
--- /dev/null
+++ b/src/Compatibility/Core/src/Tizen/HandlerToRendererShim.cs
@@ -0,0 +1,196 @@
+using System;
+using System.ComponentModel;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.Platform;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Handlers;
+using Rect = Microsoft.Maui.Graphics.Rect;
+using ERect = ElmSharp.Rect;
+using EvasObject = ElmSharp.EvasObject;
+
+namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
+{
+#pragma warning disable CS0612 // Type or member is obsolete
+ public class HandlerToRendererShim : IVisualElementRenderer
+#pragma warning disable CS0612 // Type or member is obsolete
+ {
+ bool _disposed;
+
+ public HandlerToRendererShim(IPlatformViewHandler vh)
+ {
+ Compatibility.Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
+ ViewHandler = vh;
+ }
+
+ IPlatformViewHandler ViewHandler { get; }
+
+ public VisualElement Element { get; private set; }
+
+ public EvasObject NativeView => ViewHandler.ContainerView ?? ViewHandler.PlatformView;
+
+ public event EventHandler ElementChanged;
+ public event EventHandler ElementPropertyChanged;
+
+ public void Dispose()
+ {
+ if (!_disposed)
+ {
+ _disposed = true;
+ Platform.SetRenderer(Element, null);
+ ViewHandler.Dispose();
+ }
+ }
+
+ public void SetElement(VisualElement element)
+ {
+ var oldElement = Element;
+
+ if (oldElement != null)
+ {
+ oldElement.PropertyChanged -= OnElementPropertyChanged;
+ oldElement.BatchCommitted -= OnBatchCommitted;
+ }
+
+ if (element != null)
+ {
+ element.PropertyChanged += OnElementPropertyChanged;
+ element.BatchCommitted += OnBatchCommitted;
+ }
+
+ Element = element;
+ ((IView)element).Handler = ViewHandler;
+ Platform.SetRenderer(element, this);
+
+ if (ViewHandler.VirtualView != element)
+ ViewHandler.SetVirtualView((IView)element);
+
+ if (element.RealParent is IView view && view.Handler is IPlatformViewHandler nvh)
+ {
+ ViewHandler.SetParent(nvh);
+ }
+ else
+ {
+ ViewHandler.SetParent(new MockParentHandler(element.RealParent as VisualElement));
+ }
+
+ NativeView.Deleted += OnNativeDeleted;
+ ElementChanged?.Invoke(this, new VisualElementChangedEventArgs(oldElement, Element));
+ }
+
+ void OnBatchCommitted(object sender, EventArg e)
+ {
+ ViewHandler?.PlatformArrange(Element.Bounds);
+ }
+
+ void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ ElementPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(e.PropertyName));
+ }
+
+ void OnNativeDeleted(object sender, EventArgs e)
+ {
+ Dispose();
+ }
+
+ public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
+ {
+ return ViewHandler.GetDesiredSize(widthConstraint, heightConstraint);
+ }
+
+ public void SetElementSize(Size size)
+ {
+ Layout.LayoutChildIntoBoundingRegion(Element, new Rect(Element.X, Element.Y, size.Width, size.Height));
+ }
+
+ public void UpdateLayout()
+ {
+ ViewHandler.PlatformArrange(Element.Bounds);
+ }
+
+ public ERect GetNativeContentGeometry()
+ {
+ return NativeView.Geometry;
+ }
+
+ class MockParentHandler : IPlatformViewHandler
+ {
+
+ public MockParentHandler(VisualElement parent)
+ {
+ RealParent = parent;
+ }
+
+ VisualElement RealParent { get; }
+ IVisualElementRenderer Renderer => RealParent != null ? Platform.GetRenderer(RealParent) : null;
+ public EvasObject PlatformView => Renderer.NativeView;
+
+ public EvasObject ContainerView => PlatformView;
+
+ public IPlatformViewHandler Parent => null;
+
+ public IView VirtualView => Renderer.Element as IView;
+
+ public IMauiContext MauiContext => null;
+
+ object IElementHandler.PlatformView => PlatformView;
+
+ object IViewHandler.ContainerView => PlatformView;
+
+ bool IViewHandler.HasContainer { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
+
+ Maui.IElement IElementHandler.VirtualView => throw new NotImplementedException();
+
+ public void DisconnectHandler() { }
+
+ public void Dispose()
+ {
+ }
+
+ public Size GetDesiredSize(double widthConstraint, double heightConstraint)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ERect GetPlatformContentGeometry()
+ {
+ return Renderer?.GetNativeContentGeometry() ?? new ERect(0, 0, 0, 0);
+ }
+
+ public void PlatformArrange(Rect frame)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SetMauiContext(IMauiContext mauiContext)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SetParent(IPlatformViewHandler parent)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SetVirtualView(IView view)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void UpdateValue(string property)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SetVirtualView(Maui.IElement view)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void Invoke(string command, object args)
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ }
+}
diff --git a/src/Compatibility/Core/src/Tizen/IMEApplication.cs b/src/Compatibility/Core/src/Tizen/IMEApplication.cs
index d874fa78b3..96c07ef780 100644
--- a/src/Compatibility/Core/src/Tizen/IMEApplication.cs
+++ b/src/Compatibility/Core/src/Tizen/IMEApplication.cs
@@ -4,6 +4,7 @@ using Tizen.Uix.InputMethod;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class IMEApplication : FormsApplication
{
public EditorWindow EditorWindow
diff --git a/src/Compatibility/Core/src/Tizen/LightweightPlatform.cs b/src/Compatibility/Core/src/Tizen/LightweightPlatform.cs
index 357ae26b64..71e4046944 100644
--- a/src/Compatibility/Core/src/Tizen/LightweightPlatform.cs
+++ b/src/Compatibility/Core/src/Tizen/LightweightPlatform.cs
@@ -3,11 +3,13 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ElmSharp;
-using Microsoft.Maui.Controls.Compatibility.Internals;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Devices;
using EColor = ElmSharp.Color;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class LightweightPlatform : ITizenPlatform, INavigation, IDisposable
{
NavigationModel _navModel = new NavigationModel();
diff --git a/src/Compatibility/Core/src/Tizen/Log/XamarinLogListener.cs b/src/Compatibility/Core/src/Tizen/Log/XamarinLogListener.cs
deleted file mode 100644
index 5105ecf5ca..0000000000
--- a/src/Compatibility/Core/src/Tizen/Log/XamarinLogListener.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Microsoft.Maui.Controls.Compatibility.Internals;
-
-namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
-{
- internal class XamarinLogListener : LogListener
- {
- public XamarinLogListener()
- {
- }
-
- #region implemented abstract members of LogListener
-
- public override void Warning(string category, string message)
- {
- Log.Warn("[{0}] {1}", category, message);
- }
-
- #endregion
- }
-}
diff --git a/src/Compatibility/Core/src/Tizen/Native/BorderRectangle.cs b/src/Compatibility/Core/src/Tizen/Native/BorderRectangle.cs
index 13836a28d5..db0dcdb2c3 100644
--- a/src/Compatibility/Core/src/Tizen/Native/BorderRectangle.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/BorderRectangle.cs
@@ -35,7 +35,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
radius[2] = Math.Min(bottomLeft, maxR);
radius[3] = Math.Min(bottomRight, maxR);
- Point first = new Point(-1, -1);
+ Graphics.Point first = new Graphics.Point(-1, -1);
for (int i = 0; i <= radius[0]; i++)
{
int x = i;
diff --git a/src/Compatibility/Core/src/Tizen/Native/Button.cs b/src/Compatibility/Core/src/Tizen/Native/Button.cs
index 3e70f482dc..f53ecefb66 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Button.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Button.cs
@@ -3,7 +3,7 @@ using ElmSharp;
using EButton = ElmSharp.Button;
using EColor = ElmSharp.Color;
using ESize = ElmSharp.Size;
-using TSButtonStyle = Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.TizenSpecific.ButtonStyle;
+using TSButtonStyle = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.ButtonStyle;
#if __MATERIAL__
using Tizen.NET.MaterialComponents;
diff --git a/src/Compatibility/Core/src/Tizen/Native/CollectionView/CollectionView.cs b/src/Compatibility/Core/src/Tizen/Native/CollectionView/CollectionView.cs
index ac6bbf9f85..46dbbefb1d 100644
--- a/src/Compatibility/Core/src/Tizen/Native/CollectionView/CollectionView.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/CollectionView/CollectionView.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
+using Microsoft.Maui.Devices;
using ElmSharp;
using ElmSharp.Wearable;
using EBox = ElmSharp.Box;
@@ -332,7 +333,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
if (holder.State == ViewHolderState.Focused && FocusedItemScrollPosition != ScrollToPosition.MakeVisible)
{
- Device.BeginInvokeOnMainThread(() =>
+ Application.Current.Dispatcher.Dispatch(() =>
{
if (holder.State == ViewHolderState.Focused && _viewHolderIndexTable.TryGetValue(holder, out int itemIndex))
{
@@ -613,7 +614,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
Scroller.HorizontalStepSize = _layoutManager.GetScrollBlockSize();
Scroller.VerticalStepSize = _layoutManager.GetScrollBlockSize();
UpdateSnapPointsType(SnapPointsType);
- Device.BeginInvokeOnMainThread(SendScrolledEvent);
+ Application.Current.Dispatcher.Dispatch(SendScrolledEvent);
}
}
@@ -625,7 +626,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
if (!_requestLayoutItems)
{
_requestLayoutItems = true;
- Device.BeginInvokeOnMainThread(() =>
+ Application.Current.Dispatcher.Dispatch(() =>
{
_requestLayoutItems = false;
if (_adaptor != null && _layoutManager != null)
diff --git a/src/Compatibility/Core/src/Tizen/Native/CollectionView/EmptyItemAdaptor.cs b/src/Compatibility/Core/src/Tizen/Native/CollectionView/EmptyItemAdaptor.cs
index f0c8113df6..f194c7e3a6 100644
--- a/src/Compatibility/Core/src/Tizen/Native/CollectionView/EmptyItemAdaptor.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/CollectionView/EmptyItemAdaptor.cs
@@ -2,10 +2,12 @@ using System.Collections;
using System.Collections.Generic;
using ElmSharp;
using ESize = ElmSharp.Size;
-using XLabel = Microsoft.Maui.Controls.Compatibility.Label;
+using XLabel = Microsoft.Maui.Controls.Label;
+using XStackLayout = Microsoft.Maui.Controls.StackLayout;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
+ [System.Obsolete]
public class EmptyItemAdaptor : ItemTemplateAdaptor, IEmptyAdaptor
{
static DataTemplate s_defaultEmptyTemplate = new DataTemplate(typeof(EmptyView));
@@ -56,7 +58,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
var header = CreateHeaderView();
var footer = CreateFooterView();
- var layout = new StackLayout();
+ var layout = new XStackLayout();
if (header != null)
{
@@ -79,20 +81,20 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
native.Unrealize();
}
- class EmptyView : StackLayout
+ class EmptyView : XStackLayout
{
public EmptyView()
{
- HorizontalOptions = LayoutOptions.FillAndExpand;
- VerticalOptions = LayoutOptions.FillAndExpand;
+ HorizontalOptions = LayoutOptions.Fill;
+ VerticalOptions = LayoutOptions.Fill;
Children.Add(
new XLabel
{
Text = "No items found",
- VerticalOptions = LayoutOptions.CenterAndExpand,
- HorizontalOptions = LayoutOptions.CenterAndExpand,
- HorizontalTextAlignment = Microsoft.Maui.Controls.Compatibility.TextAlignment.Center,
- VerticalTextAlignment = Microsoft.Maui.Controls.Compatibility.TextAlignment.Center,
+ VerticalOptions = LayoutOptions.Center,
+ HorizontalOptions = LayoutOptions.Center,
+ HorizontalTextAlignment = Maui.TextAlignment.Center,
+ VerticalTextAlignment = Maui.TextAlignment.Center,
}
);
}
diff --git a/src/Compatibility/Core/src/Tizen/Native/CollectionView/GridLayoutManager.cs b/src/Compatibility/Core/src/Tizen/Native/CollectionView/GridLayoutManager.cs
index 28b3699108..595b532a45 100644
--- a/src/Compatibility/Core/src/Tizen/Native/CollectionView/GridLayoutManager.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/CollectionView/GridLayoutManager.cs
@@ -111,8 +111,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
int ItemSpacing => IsHorizontal ? HorizontalItemSpacing : VerticalItemSpacing;
- int ItemWidthConstraint => IsHorizontal ? _allocatedSize.Width * 100 : ColumnSize;
- int ItemHeightConstraint => IsHorizontal ? ColumnSize : _allocatedSize.Height * 100;
+ // It is a rule, if you want to fit with a content natural size, constraint should be infinity
+ int ItemWidthConstraint => IsHorizontal ? int.MaxValue : ColumnSize;
+ int ItemHeightConstraint => IsHorizontal ? ColumnSize : int.MaxValue;
int ColumnSize
{
@@ -404,7 +405,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
public int GetVisibleItemIndex(int x, int y)
{
int index = 0;
- if (x < 0 || y < 0)
+ if (x < 0 || y < 0 || _accumulatedItemSizes == null)
return index;
if (_scrollCanvasSize.Width < x || _scrollCanvasSize.Height < y)
return CollectionView.Count - 1;
diff --git a/src/Compatibility/Core/src/Tizen/Native/CollectionView/IndicatorView.cs b/src/Compatibility/Core/src/Tizen/Native/CollectionView/IndicatorView.cs
index 7680b996c9..593c4a6984 100644
--- a/src/Compatibility/Core/src/Tizen/Native/CollectionView/IndicatorView.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/CollectionView/IndicatorView.cs
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
+using Microsoft.Maui.Devices;
using ElmSharp;
+using Index = ElmSharp.Index;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
diff --git a/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs b/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs
index 7444dbcd09..9c0e8ea7df 100644
--- a/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/CollectionView/ItemTemplateAdaptor.cs
@@ -4,10 +4,13 @@ using System.Collections.Generic;
using System.Globalization;
using ElmSharp;
using ESize = ElmSharp.Size;
-using XLabel = Microsoft.Maui.Controls.Compatibility.Label;
+using XLabel = Microsoft.Maui.Controls.Label;
+using XColor = Microsoft.Maui.Graphics.Color;
+using XStackLayout = Microsoft.Maui.Controls.StackLayout;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
+ [Obsolete]
public class ItemDefaultTemplateAdaptor : ItemTemplateAdaptor
{
class ToTextConverter : IValueConverter
@@ -26,13 +29,13 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
var label = new XLabel
{
- TextColor = Color.Black,
+ TextColor = XColor.FromRgb(0,0,0),
};
label.SetBinding(XLabel.TextProperty, new Binding(".", converter: new ToTextConverter()));
- return new StackLayout
+ return new XStackLayout
{
- BackgroundColor = Color.White,
+ BackgroundColor = XColor.FromRgb(255, 255, 255),
Padding = 30,
Children =
{
@@ -43,6 +46,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
}
}
+ [Obsolete]
public class ItemTemplateAdaptor : ItemAdaptor
{
Dictionary _nativeFormsTable = new Dictionary();
@@ -182,7 +186,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
if (_dataBindedViewTable.TryGetValue(this[index], out View createdView) && createdView != null)
{
- return createdView.Measure(Forms.ConvertToScaledDP(widthConstraint), Forms.ConvertToScaledDP(heightConstraint), MeasureFlags.IncludeMargins).Request.ToPixel();
+ return createdView.Measure(Forms.ConvertToScaledDP(widthConstraint), Forms.ConvertToScaledDP(heightConstraint), MeasureFlags.IncludeMargins).Request.ToEFLPixel();
}
View view = null;
@@ -200,18 +204,18 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
if (Count > index)
view.BindingContext = this[index];
var request = view.Measure(Forms.ConvertToScaledDP(widthConstraint), Forms.ConvertToScaledDP(heightConstraint), MeasureFlags.IncludeMargins).Request;
- return request.ToPixel();
+ return request.ToEFLPixel();
}
}
public override ESize MeasureHeader(int widthConstraint, int heightConstraint)
{
- return _headerCache?.Measure(Forms.ConvertToScaledDP(widthConstraint), Forms.ConvertToScaledDP(heightConstraint)).Request.ToPixel() ?? new ESize(0, 0);
+ return _headerCache?.Measure(Forms.ConvertToScaledDP(widthConstraint), Forms.ConvertToScaledDP(heightConstraint)).Request.ToEFLPixel() ?? new ESize(0, 0);
}
public override ESize MeasureFooter(int widthConstraint, int heightConstraint)
{
- return _footerCache?.Measure(Forms.ConvertToScaledDP(widthConstraint), Forms.ConvertToScaledDP(heightConstraint)).Request.ToPixel() ?? new ESize(0, 0);
+ return _footerCache?.Measure(Forms.ConvertToScaledDP(widthConstraint), Forms.ConvertToScaledDP(heightConstraint)).Request.ToEFLPixel() ?? new ESize(0, 0);
}
public override void UpdateViewState(EvasObject view, ViewHolderState state)
diff --git a/src/Compatibility/Core/src/Tizen/Native/CollectionView/LinearLayoutManager.cs b/src/Compatibility/Core/src/Tizen/Native/CollectionView/LinearLayoutManager.cs
index 414cf3b8ea..d5e32d2b9b 100644
--- a/src/Compatibility/Core/src/Tizen/Native/CollectionView/LinearLayoutManager.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/CollectionView/LinearLayoutManager.cs
@@ -100,8 +100,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
}
}
- int ItemWidthConstraint => IsHorizontal ? _allocatedSize.Width * 100 : _allocatedSize.Width;
- int ItemHeightConstraint => IsHorizontal ? _allocatedSize.Height : _allocatedSize.Height * 100;
+ // It is a rule, if you want to fit with a content natural size, constraint should be infinity
+ int ItemWidthConstraint => IsHorizontal ? int.MaxValue : _allocatedSize.Width;
+ int ItemHeightConstraint => IsHorizontal ? _allocatedSize.Height : int.MaxValue;
int FooterSize => IsHorizontal ? _footerSize.Width : _footerSize.Height;
int HeaderSize => IsHorizontal ? _headerSize.Width : _headerSize.Height;
diff --git a/src/Compatibility/Core/src/Tizen/Native/DateTimePickerDialog.cs b/src/Compatibility/Core/src/Tizen/Native/DateTimePickerDialog.cs
index 11ddcb5c1a..03234ecf48 100644
--- a/src/Compatibility/Core/src/Tizen/Native/DateTimePickerDialog.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/DateTimePickerDialog.cs
@@ -1,4 +1,5 @@
using System;
+using Microsoft.Maui.Devices;
using ElmSharp;
using EButton = ElmSharp.Button;
diff --git a/src/Compatibility/Core/src/Tizen/Native/Dialog.cs b/src/Compatibility/Core/src/Tizen/Native/Dialog.cs
index 3bad6f74af..10c4f292cf 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Dialog.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Dialog.cs
@@ -1,4 +1,5 @@
using System;
+using Microsoft.Maui.Devices;
using ElmSharp;
using EButton = ElmSharp.Button;
using EColor = ElmSharp.Color;
@@ -56,7 +57,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
///
/// Occurs whenever the dialog is first displayed.
///
- public event EventHandler Shown;
+ public event EventHandler DialogShown;
///
/// Gets or sets the title of the dialog
@@ -194,7 +195,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
public new void Show()
{
base.Show();
- Shown?.Invoke(this, EventArgs.Empty);
+ DialogShown?.Invoke(this, EventArgs.Empty);
}
///
@@ -301,7 +302,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
// Adds a handler for the Shown event.
// In effect, registers this instance to be affected by the hardware back key presses.
- Shown += (s, e) =>
+ DialogShown += (s, e) =>
{
OnShown();
};
diff --git a/src/Compatibility/Core/src/Tizen/Native/EditfieldEntry.cs b/src/Compatibility/Core/src/Tizen/Native/EditfieldEntry.cs
index a2d20154e6..b66ab8f583 100644
--- a/src/Compatibility/Core/src/Tizen/Native/EditfieldEntry.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/EditfieldEntry.cs
@@ -1,4 +1,5 @@
using System;
+using Microsoft.Maui.Devices;
using ElmSharp;
using EColor = ElmSharp.Color;
using ELayout = ElmSharp.Layout;
diff --git a/src/Compatibility/Core/src/Tizen/Native/Entry.cs b/src/Compatibility/Core/src/Tizen/Native/Entry.cs
index 4a914642ab..27579173d3 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Entry.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Entry.cs
@@ -105,11 +105,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
var old = _span.Text;
_span.Text = value;
ApplyTextAndStyle();
- Device.StartTimer(TimeSpan.FromTicks(1), () =>
- {
- OnTextChanged(old, value);
- return false;
- });
+ Application.Current.Dispatcher.DispatchDelayed(TimeSpan.FromTicks(1), () => OnTextChanged(old, value));
}
}
}
diff --git a/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs b/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs
index bcd12ec388..ce3841aac8 100644
--- a/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/FlyoutPage.cs
@@ -1,6 +1,7 @@
using System;
using ElmSharp;
-using Microsoft.Maui.Controls.Compatibility.Internals;
+using Microsoft.Maui.Devices;
+using Microsoft.Maui.Controls.Internals;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
@@ -127,12 +128,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
// in case of the screen rotation we may need to update the choice between split
// and popover behaviors and reconfigure the layout
- Device.Info.PropertyChanged += (s, e) =>
+ DeviceDisplay.MainDisplayInfoChanged += (s, e) =>
{
- if (e.PropertyName == nameof(Device.Info.CurrentOrientation))
- {
- UpdateFlyoutLayoutBehavior();
- }
+ UpdateFlyoutLayoutBehavior();
};
}
@@ -352,7 +350,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
// Screen orientation affects those 2 behaviors
if (behavior == FlyoutLayoutBehavior.SplitOnLandscape || behavior == FlyoutLayoutBehavior.SplitOnPortrait)
{
- var orientation = Device.Info.CurrentOrientation;
+ var orientation = DeviceDisplay.MainDisplayInfo.Orientation;
if ((orientation.IsLandscape() && behavior == FlyoutLayoutBehavior.SplitOnLandscape) || (orientation.IsPortrait() && behavior == FlyoutLayoutBehavior.SplitOnPortrait))
{
diff --git a/src/Compatibility/Core/src/Tizen/Native/ListView.cs b/src/Compatibility/Core/src/Tizen/Native/ListView.cs
index 7e75e82bd3..e504d3711b 100644
--- a/src/Compatibility/Core/src/Tizen/Native/ListView.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/ListView.cs
@@ -3,7 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using ElmSharp;
-using Microsoft.Maui.Controls.Compatibility.Internals;
+using Microsoft.Maui.Controls.Internals;
using EColor = ElmSharp.Color;
using ERect = ElmSharp.Rect;
using EScroller = ElmSharp.Scroller;
@@ -25,6 +25,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
/// Whenever element disappears from visible space its content is destroyed for time being.
/// This is carried out by so called Cell Handlers.
///
+ [Obsolete]
public class ListView : GenList
{
///
@@ -293,7 +294,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
GenListItem item = GetItemContext(cell)?.Item as GenListItem;
if (item != null)
- this.ScrollTo(item, position.ToPlatform(), animated);
+ this.ScrollTo(item, position.ToNative(), animated);
}
///
diff --git a/src/Compatibility/Core/src/Tizen/Native/Span.cs b/src/Compatibility/Core/src/Tizen/Native/Span.cs
index 8ce1b31ed4..2b663171c9 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Span.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Span.cs
@@ -1,7 +1,7 @@
using System;
using System.Text;
using EColor = ElmSharp.Color;
-using Specific = Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.TizenSpecific;
+using Specific = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
@@ -257,10 +257,10 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
string ConvertTags(string text)
{
- return text.Replace("&", "&")
- .Replace("<", "<")
- .Replace(">", ">")
- .Replace(Environment.NewLine, "
");
+ return text.Replace("&", "&", StringComparison.Ordinal)
+ .Replace("<", "<", StringComparison.Ordinal)
+ .Replace(">", ">", StringComparison.Ordinal)
+ .Replace(Environment.NewLine, "
", StringComparison.Ordinal);
}
public string GetStyle()
diff --git a/src/Compatibility/Core/src/Tizen/Native/TableView.cs b/src/Compatibility/Core/src/Tizen/Native/TableView.cs
index 21162287e3..3b9621bf0b 100644
--- a/src/Compatibility/Core/src/Tizen/Native/TableView.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/TableView.cs
@@ -5,6 +5,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
///
/// Extends the ListView class to provide TableView class implementation.
///
+ [System.Obsolete]
public class TableView : ListView, ITableView
{
@@ -44,7 +45,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
///
/// Sets the section title.
///
- void AddSectionTitle(string title, Color textColor)
+ void AddSectionTitle(string title, Graphics.Color textColor)
{
Cell cell = new SectionCell()
{
diff --git a/src/Compatibility/Core/src/Tizen/Native/TitleViewPage.cs b/src/Compatibility/Core/src/Tizen/Native/TitleViewPage.cs
index 460befafd3..3697632d90 100644
--- a/src/Compatibility/Core/src/Tizen/Native/TitleViewPage.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/TitleViewPage.cs
@@ -3,13 +3,14 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native
{
+ [Obsolete]
public class TitleViewPage : Native.Box
{
Native.Page _page = null;
View _titleView = null;
bool _hasNavigationBar = true;
- public TitleViewPage(EvasObject parent, Microsoft.Maui.Controls.Compatibility.Page page, View titleView) : base(parent)
+ public TitleViewPage(EvasObject parent, Microsoft.Maui.Controls.Page page, View titleView) : base(parent)
{
_page = Platform.GetOrCreateRenderer(page).NativeView as Native.Page;
_titleView = titleView;
diff --git a/src/Compatibility/Core/src/Tizen/Native/Watch/FormsWatchLayout.cs b/src/Compatibility/Core/src/Tizen/Native/Watch/FormsWatchLayout.cs
index 1ec60ad485..9d2e9972cc 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Watch/FormsWatchLayout.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Watch/FormsWatchLayout.cs
@@ -1,3 +1,4 @@
+using Microsoft.Maui.Devices;
using ElmSharp;
using EColor = ElmSharp.Color;
@@ -7,8 +8,8 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.Watch
{
public FormsWatchLayout(EvasObject parent) : base(parent)
{
- if (Device.Idiom != TargetIdiom.Watch)
- Log.Error($"{0} is only supported on TargetIdiom.Watch : {1}", this, Device.Idiom);
+ if (DeviceInfo.Idiom != DeviceIdiom.Watch)
+ Log.Error($"{0} is only supported on TargetIdiom.Watch : {1}", this, DeviceInfo.Idiom);
}
}
diff --git a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchButton.cs b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchButton.cs
index 70ecd2137e..6bde527a75 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchButton.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchButton.cs
@@ -1,6 +1,6 @@
using System;
using ElmSharp;
-using Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.TizenSpecific;
+using Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific;
using ESize = ElmSharp.Size;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.Watch
diff --git a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchDateTimePickerDialog.cs b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchDateTimePickerDialog.cs
index ea7e4e6cdc..891b0a6129 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchDateTimePickerDialog.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchDateTimePickerDialog.cs
@@ -3,7 +3,7 @@ using ElmSharp;
using ElmSharp.Wearable;
using EButton = ElmSharp.Button;
using ELayout = ElmSharp.Layout;
-using Specific = Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.TizenSpecific.Application;
+using Specific = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.Application;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.Watch
{
diff --git a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchListView.cs b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchListView.cs
index 72dc5ff9ee..c0a365e0a7 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchListView.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchListView.cs
@@ -5,6 +5,7 @@ using ElmSharp.Wearable;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.Watch
{
+ [Obsolete]
public class WatchListView : Native.ListView, IRotaryActionWidget, IRotaryInteraction
{
CircleGenList _circleGenList;
diff --git a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchTableView.cs b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchTableView.cs
index 63b8e626ca..65ff1e120f 100644
--- a/src/Compatibility/Core/src/Tizen/Native/Watch/WatchTableView.cs
+++ b/src/Compatibility/Core/src/Tizen/Native/Watch/WatchTableView.cs
@@ -3,6 +3,7 @@ using ElmSharp.Wearable;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.Watch
{
+ [System.Obsolete]
public class WatchTableView : WatchListView, ITableView
{
static readonly SectionCellRenderer _sectionCellRenderer = new SectionCellRenderer();
@@ -34,7 +35,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.Watch
return base.GetCellRenderer(cell, isGroup);
}
- void AddSectionTitle(string title, Color textColor)
+ void AddSectionTitle(string title, Graphics.Color textColor)
{
Cell cell = new SectionCell()
{
diff --git a/src/Compatibility/Core/src/Tizen/NativeBindingService.cs b/src/Compatibility/Core/src/Tizen/NativeBindingService.cs
index adfc61627c..a4d7cc87b1 100644
--- a/src/Compatibility/Core/src/Tizen/NativeBindingService.cs
+++ b/src/Compatibility/Core/src/Tizen/NativeBindingService.cs
@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
-using Microsoft.Maui.Controls.Compatibility.Internals;
-using Microsoft.Maui.Controls.Compatibility.Xaml.Internals;
+using Microsoft.Maui.Controls.Xaml.Internals;
using EObject = ElmSharp.EvasObject;
@@ -11,6 +10,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
[UnconditionalSuppressMessage ("Trimming", "IL2075", Justification = TrimmerConstants.NativeBindingService)]
public bool TrySetBinding(object target, string propertyName, BindingBase binding)
{
+ Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
var view = target as EObject;
if (view == null)
return false;
@@ -22,6 +22,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
public bool TrySetBinding(object target, BindableProperty property, BindingBase binding)
{
+ Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
var view = target as EObject;
if (view == null)
return false;
@@ -31,6 +32,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
public bool TrySetValue(object target, BindableProperty property, object value)
{
+ Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
var view = target as EObject;
if (view == null)
return false;
diff --git a/src/Compatibility/Core/src/Tizen/NativeValueConverterService.cs b/src/Compatibility/Core/src/Tizen/NativeValueConverterService.cs
index 7b22f3bf55..274b9cf5a5 100644
--- a/src/Compatibility/Core/src/Tizen/NativeValueConverterService.cs
+++ b/src/Compatibility/Core/src/Tizen/NativeValueConverterService.cs
@@ -1,6 +1,5 @@
using System;
-using Microsoft.Maui.Controls.Compatibility.Internals;
-using Microsoft.Maui.Controls.Compatibility.Xaml.Internals;
+using Microsoft.Maui.Controls.Xaml.Internals;
using EObject = ElmSharp.EvasObject;
@@ -10,6 +9,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
public bool ConvertTo(object value, Type toType, out object nativeValue)
{
+ Hosting.MauiAppBuilderExtensions.CheckForCompatibility();
nativeValue = null;
if ((value is EObject) && toType.IsAssignableFrom(typeof(View)))
{
diff --git a/src/Compatibility/Core/src/Tizen/NativeViewWrapper.cs b/src/Compatibility/Core/src/Tizen/NativeViewWrapper.cs
index 32a4251aa6..3aee745950 100644
--- a/src/Compatibility/Core/src/Tizen/NativeViewWrapper.cs
+++ b/src/Compatibility/Core/src/Tizen/NativeViewWrapper.cs
@@ -5,7 +5,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
public delegate ESize? MeasureDelegate(NativeViewWrapperRenderer renderer, int availableWidth, int availableHeight);
+#pragma warning disable CS0618 // Type or member is obsolete
public class NativeViewWrapper : View
+#pragma warning disable CS0618 // Type or member is obsolete
{
public NativeViewWrapper(EvasObject obj, MeasureDelegate measureDelegate = null)
{
diff --git a/src/Compatibility/Core/src/Tizen/PanGestureHandler.cs b/src/Compatibility/Core/src/Tizen/PanGestureHandler.cs
index c6c90f60f4..8a3213fa1f 100644
--- a/src/Compatibility/Core/src/Tizen/PanGestureHandler.cs
+++ b/src/Compatibility/Core/src/Tizen/PanGestureHandler.cs
@@ -4,6 +4,7 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class PanGestureHandler : GestureHandler
{
int _currentPanGestureId;
diff --git a/src/Compatibility/Core/src/Tizen/PinchGestureHandler.cs b/src/Compatibility/Core/src/Tizen/PinchGestureHandler.cs
index 3e7cbf8bc4..a5888f2935 100644
--- a/src/Compatibility/Core/src/Tizen/PinchGestureHandler.cs
+++ b/src/Compatibility/Core/src/Tizen/PinchGestureHandler.cs
@@ -4,9 +4,10 @@ using ElmSharp;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class PinchGestureHandler : GestureHandler
{
- Point _currentScalePoint;
+ Graphics.Point _currentScalePoint;
int _previousPinchRadius;
double _originalPinchScale;
@@ -26,7 +27,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
var geometry = Platform.GetRenderer(sender).NativeView.Geometry;
var zoomData = (GestureLayer.ZoomData)data;
- _currentScalePoint = new Point((zoomData.X - geometry.X) / (double)geometry.Width, (zoomData.Y - geometry.Y) / (double)geometry.Height);
+ _currentScalePoint = new Graphics.Point((zoomData.X - geometry.X) / (double)geometry.Width, (zoomData.Y - geometry.Y) / (double)geometry.Height);
_originalPinchScale = sender.Scale;
_previousPinchRadius = zoomData.Radius;
(Recognizer as IPinchGestureController)?.SendPinchStarted(sender, _currentScalePoint);
diff --git a/src/Compatibility/Core/src/Tizen/Platform.cs b/src/Compatibility/Core/src/Tizen/Platform.cs
index c89281a4e9..0ef8670bf9 100644
--- a/src/Compatibility/Core/src/Tizen/Platform.cs
+++ b/src/Compatibility/Core/src/Tizen/Platform.cs
@@ -5,20 +5,28 @@ using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using ElmSharp;
-using Microsoft.Maui.Controls.Compatibility.Internals;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Handlers;
-[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.Compatibility.Material")]
+[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.Material")]
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public static class Platform
{
internal static readonly BindableProperty RendererProperty = BindableProperty.CreateAttached("Renderer", typeof(IVisualElementRenderer), typeof(Platform), default(IVisualElementRenderer),
propertyChanged: (bindable, oldvalue, newvalue) =>
{
- var ve = bindable as VisualElement;
- if (ve != null && newvalue == null)
- ve.IsPlatformEnabled = false;
+ var view = bindable as VisualElement;
+ if (view != null)
+ view.IsPlatformEnabled = newvalue != null;
+
+ if (bindable is IView mauiView)
+ {
+ if (mauiView.Handler == null && newvalue is IVisualElementRenderer ver)
+ mauiView.Handler = new RendererToHandlerShim(ver);
+ }
});
public static IVisualElementRenderer GetRenderer(BindableObject bindable)
@@ -43,14 +51,58 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
internal static IVisualElementRenderer CreateRenderer(VisualElement element)
{
- IVisualElementRenderer renderer = Forms.GetHandlerForObject(element) ?? new DefaultRenderer();
+ IVisualElementRenderer renderer = null;
+
+ if (renderer == null)
+ {
+ IViewHandler handler = null;
+
+ //TODO: Handle this with AppBuilderHost
+ try
+ {
+ handler = Forms.MauiContext.Handlers.GetHandler(element.GetType()) as IViewHandler;
+ handler.SetMauiContext(Forms.MauiContext);
+ }
+ catch
+ {
+ // TODO define better catch response or define if this is needed?
+ }
+
+ if (handler == null)
+ {
+ renderer = Forms.GetHandlerForObject(element) ?? new DefaultRenderer();
+ }
+ // This means the only thing registered is the RendererToHandlerShim
+ // Which is only used when you are running a .NET MAUI app
+ // This indicates that the user hasn't registered a specific handler for this given type
+ else if (handler is RendererToHandlerShim shim)
+ {
+ renderer = shim.VisualElementRenderer;
+
+ if (renderer == null)
+ {
+ renderer = Forms.GetHandlerForObject(element) ?? new DefaultRenderer();
+ }
+ }
+ else if (handler is IVisualElementRenderer ver)
+ renderer = ver;
+ else if (handler is IPlatformViewHandler vh)
+ {
+ if (element.Parent is IView view && view.Handler is IPlatformViewHandler nvh)
+ {
+ vh.SetParent(nvh);
+ }
+ renderer = new HandlerToRendererShim(vh);
+ element.Handler = handler;
+ }
+ }
renderer.SetElement(element);
return renderer;
}
internal static ITizenPlatform CreatePlatform(EvasObject parent)
{
- if (Forms.PlatformType == PlatformType.Lightweight || Forms.Flags.Contains(Flags.LightweightPlatformExperimental))
+ if (Forms.PlatformType == PlatformType.Lightweight)
{
return new LightweightPlatform(parent);
}
@@ -63,10 +115,13 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
widthConstraint = widthConstraint <= -1 ? double.PositiveInfinity : widthConstraint;
heightConstraint = heightConstraint <= -1 ? double.PositiveInfinity : heightConstraint;
- double width = !double.IsPositiveInfinity(widthConstraint) ? widthConstraint : Int32.MaxValue;
- double height = !double.IsPositiveInfinity(heightConstraint) ? heightConstraint : Int32.MaxValue;
+ var renderView = GetRenderer(view);
+ if (renderView == null || renderView.NativeView == null)
+ {
+ return (view is IView iView) ? new SizeRequest(iView.Handler.GetDesiredSize(widthConstraint, heightConstraint)) : new SizeRequest(Graphics.Size.Zero);
+ }
- return Platform.GetRenderer(view).GetDesiredSize(width, height);
+ return renderView.GetDesiredSize(widthConstraint, heightConstraint);
}
}
@@ -87,6 +142,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
public EvasObject RootNativeView { get; private set; }
}
+ [Obsolete]
public class DefaultPlatform : BindableObject, ITizenPlatform, INavigation
{
NavigationModel _navModel = new NavigationModel();
@@ -179,11 +235,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
((Application)Page.RealParent).NavigationProxy.Inner = this;
- Device.StartTimer(TimeSpan.Zero, () =>
- {
- CurrentPageController?.SendAppearing();
- return false;
- });
+ Application.Current.Dispatcher.DispatchDelayed(TimeSpan.Zero, () => CurrentPageController?.SendAppearing());
}
public bool SendBackButtonPressed()
@@ -281,7 +333,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
async Task INavigation.PushModalAsync(Page modal, bool animated)
{
var previousPage = CurrentPageController;
- Device.BeginInvokeOnMainThread(() => previousPage?.SendDisappearing());
+ Application.Current.Dispatcher.Dispatch(() => previousPage?.SendDisappearing());
_navModel.PushModal(modal);
diff --git a/src/Compatibility/Core/src/Tizen/PlatformEffect.cs b/src/Compatibility/Core/src/Tizen/PlatformEffect.cs
deleted file mode 100644
index d5875e1577..0000000000
--- a/src/Compatibility/Core/src/Tizen/PlatformEffect.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using ElmSharp;
-
-namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
-{
- ///
- /// Base class for platform-specific effect classes.
- ///
- public abstract class PlatformEffect : PlatformEffect
- {
- }
-}
diff --git a/src/Compatibility/Core/src/Tizen/PopupManager.cs b/src/Compatibility/Core/src/Tizen/PopupManager.cs
index 131a49fc19..c830f19774 100644
--- a/src/Compatibility/Core/src/Tizen/PopupManager.cs
+++ b/src/Compatibility/Core/src/Tizen/PopupManager.cs
@@ -1,14 +1,18 @@
using System;
using System.Collections.Generic;
using ElmSharp;
-using Microsoft.Maui.Controls.Compatibility.Internals;
-using Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.TizenSpecific;
+using Microsoft.Maui.Controls.Internals;
+using Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific;
+using Microsoft.Maui.Devices;
using EButton = ElmSharp.Button;
using EColor = ElmSharp.Color;
using EProgressBar = ElmSharp.ProgressBar;
+using Color = Microsoft.Maui.Graphics.Color;
+using XStackLayout = Microsoft.Maui.Controls.StackLayout;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [Obsolete]
public class PopupManager : IDisposable
{
ITizenPlatform _platform;
@@ -23,7 +27,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
MessagingCenter.Subscribe(this, Page.AlertSignalName, OnAlertRequest);
MessagingCenter.Subscribe(this, Page.ActionSheetSignalName, OnActionSheetRequest);
MessagingCenter.Subscribe(this, Page.PromptSignalName, OnPromptRequested);
- }
+ }
public void Dispose()
{
@@ -93,7 +97,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
var alert = Native.Dialog.CreateDialog(Forms.NativeParent, (arguments.Accept != null));
alert.Title = arguments.Title;
- var message = arguments.Message?.Replace("&", "&").Replace("<", "<").Replace(">", ">").Replace(Environment.NewLine, "
");
+ var message = arguments.Message?.Replace("&", "&", StringComparison.Ordinal).Replace("<", "<", StringComparison.Ordinal).Replace(">", ">", StringComparison.Ordinal).Replace(Environment.NewLine, "
", StringComparison.Ordinal);
alert.Message = message;
var cancel = new EButton(alert) { Text = arguments.Cancel };
@@ -211,9 +215,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
var entry = new Entry
{
MinimumWidthRequest = 200,
- HorizontalOptions = LayoutOptions.FillAndExpand,
+ HorizontalOptions = LayoutOptions.Fill,
BackgroundColor = Color.FromRgb(250, 250, 250),
- TextColor = Color.Black,
+ TextColor = Color.FromRgb(0, 0, 0),
Keyboard = args.Keyboard,
};
@@ -226,7 +230,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
entry.MaxLength = args.MaxLength;
}
- var layout = new StackLayout
+ var layout = new XStackLayout
{
Spacing = 10,
Children =
@@ -234,11 +238,13 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
new Label
{
LineBreakMode = LineBreakMode.CharacterWrap,
- TextColor = DeviceInfo.Idiom == DeviceIdiom.Watch ? Color.White : Color.Accent,
+ TextColor = DeviceInfo.Idiom == DeviceIdiom.Watch ? Color.FromRgb(255,255,255) : Application.AccentColor,
Text = args.Message,
- HorizontalOptions = LayoutOptions.FillAndExpand,
+ HorizontalOptions = LayoutOptions.Fill,
HorizontalTextAlignment = TextAlignment.Center,
+#pragma warning disable CS0612 // Type or member is obsolete
FontSize = Device.GetNamedSize(NamedSize.Subtitle, typeof(Label)),
+#pragma warning disable CS0612 // Type or member is obsolete
},
entry,
}
diff --git a/src/Compatibility/Core/src/Tizen/PreloadedWindow.cs b/src/Compatibility/Core/src/Tizen/PreloadedWindow.cs
index b92adb9aea..baa8aadf2f 100644
--- a/src/Compatibility/Core/src/Tizen/PreloadedWindow.cs
+++ b/src/Compatibility/Core/src/Tizen/PreloadedWindow.cs
@@ -1,10 +1,11 @@
using ElmSharp;
using Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native;
using ELayout = ElmSharp.Layout;
+using EWindow = ElmSharp.Window;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
- public class PreloadedWindow : Window
+ public class PreloadedWindow : EWindow
{
static PreloadedWindow s_precreated;
diff --git a/src/Compatibility/Core/src/Tizen/Properties/AssemblyInfo.cs b/src/Compatibility/Core/src/Tizen/Properties/AssemblyInfo.cs
index 408ab48f44..54f1710e1f 100644
--- a/src/Compatibility/Core/src/Tizen/Properties/AssemblyInfo.cs
+++ b/src/Compatibility/Core/src/Tizen/Properties/AssemblyInfo.cs
@@ -1,79 +1,6 @@
-using Microsoft.Maui.Controls.Compatibility;
-using Microsoft.Maui.Controls.Compatibility.Platform.Tizen;
-using Microsoft.Maui.Controls.Compatibility.Shapes;
+using System.Runtime.CompilerServices;
+using Microsoft.Maui.Controls.Internals;
-[assembly: Dependency(typeof(ResourcesProvider))]
-[assembly: Dependency(typeof(Deserializer))]
-[assembly: Dependency(typeof(NativeBindingService))]
-[assembly: Dependency(typeof(NativeValueConverterService))]
-
-[assembly: ExportRenderer(typeof(Layout), typeof(LayoutRenderer))]
-[assembly: ExportRenderer(typeof(ScrollView), typeof(ScrollViewRenderer))]
-[assembly: ExportRenderer(typeof(CarouselPage), typeof(CarouselPageRenderer))]
-[assembly: ExportRenderer(typeof(Page), typeof(PageRenderer))]
-[assembly: ExportRenderer(typeof(NavigationPage), typeof(NavigationPageRenderer))]
-#pragma warning disable CS0618 // Type or member is obsolete
-[assembly: ExportRenderer(typeof(MasterDetailPage), typeof(MasterDetailPageRenderer))]
-#pragma warning restore CS0618 // Type or member is obsolete
-[assembly: ExportRenderer(typeof(FlyoutPage), typeof(FlyoutPageRenderer))]
-[assembly: ExportRenderer(typeof(TabbedPage), typeof(TabbedPageRenderer))]
-[assembly: ExportRenderer(typeof(Shell), typeof(ShellRenderer))]
-
-[assembly: ExportRenderer(typeof(Label), typeof(LabelRenderer))]
-[assembly: ExportRenderer(typeof(Button), typeof(ButtonRenderer))]
-[assembly: ExportRenderer(typeof(Image), typeof(ImageRenderer))]
-[assembly: ExportRenderer(typeof(Slider), typeof(SliderRenderer))]
-[assembly: ExportRenderer(typeof(Picker), typeof(PickerRenderer))]
-[assembly: ExportRenderer(typeof(Frame), typeof(FrameRenderer))]
-[assembly: ExportRenderer(typeof(Stepper), typeof(StepperRenderer))]
-[assembly: ExportRenderer(typeof(DatePicker), typeof(DatePickerRenderer))]
-[assembly: ExportRenderer(typeof(TimePicker), typeof(TimePickerRenderer))]
-[assembly: ExportRenderer(typeof(ProgressBar), typeof(ProgressBarRenderer))]
-[assembly: ExportRenderer(typeof(Switch), typeof(SwitchRenderer))]
-[assembly: ExportRenderer(typeof(CheckBox), typeof(CheckBoxRenderer))]
-[assembly: ExportRenderer(typeof(ListView), typeof(ListViewRenderer))]
-[assembly: ExportRenderer(typeof(BoxView), typeof(BoxViewRenderer))]
-[assembly: ExportRenderer(typeof(ActivityIndicator), typeof(ActivityIndicatorRenderer))]
-[assembly: ExportRenderer(typeof(IndicatorView), typeof(IndicatorViewRenderer))]
-[assembly: ExportRenderer(typeof(SearchBar), typeof(SearchBarRenderer))]
-[assembly: ExportRenderer(typeof(Entry), typeof(EntryRenderer))]
-[assembly: ExportRenderer(typeof(Editor), typeof(EditorRenderer))]
-[assembly: ExportRenderer(typeof(TableView), typeof(TableViewRenderer))]
-[assembly: ExportRenderer(typeof(NativeViewWrapper), typeof(NativeViewWrapperRenderer))]
-[assembly: ExportRenderer(typeof(WebView), typeof(WebViewRenderer))]
-[assembly: ExportRenderer(typeof(ImageButton), typeof(ImageButtonRenderer))]
-[assembly: ExportRenderer(typeof(StructuredItemsView), typeof(StructuredItemsViewRenderer))]
-[assembly: ExportRenderer(typeof(CarouselView), typeof(CarouselViewRenderer))]
-[assembly: ExportRenderer(typeof(SwipeView), typeof(SwipeViewRenderer))]
-[assembly: ExportRenderer(typeof(RefreshView), typeof(RefreshViewRenderer))]
-[assembly: ExportRenderer(typeof(IndicatorView), typeof(IndicatorViewRenderer))]
-[assembly: ExportRenderer(typeof(RadioButton), typeof(RadioButtonRenderer))]
-
-[assembly: ExportImageSourceHandler(typeof(FileImageSource), typeof(FileImageSourceHandler))]
-[assembly: ExportImageSourceHandler(typeof(StreamImageSource), typeof(StreamImageSourceHandler))]
-[assembly: ExportImageSourceHandler(typeof(UriImageSource), typeof(UriImageSourceHandler))]
-
-[assembly: ExportCell(typeof(TextCell), typeof(TextCellRenderer))]
-[assembly: ExportCell(typeof(ImageCell), typeof(ImageCellRenderer))]
-[assembly: ExportCell(typeof(SwitchCell), typeof(SwitchCellRenderer))]
-[assembly: ExportCell(typeof(EntryCell), typeof(EntryCellRenderer))]
-[assembly: ExportCell(typeof(ViewCell), typeof(ViewCellRenderer))]
-
-[assembly: ExportRenderer(typeof(EmbeddedFont), typeof(EmbeddedFontLoader))]
-
-[assembly: ExportHandler(typeof(TapGestureRecognizer), typeof(TapGestureHandler))]
-[assembly: ExportHandler(typeof(PinchGestureRecognizer), typeof(PinchGestureHandler))]
-[assembly: ExportHandler(typeof(PanGestureRecognizer), typeof(PanGestureHandler))]
-[assembly: ExportHandler(typeof(SwipeGestureRecognizer), typeof(SwipeGestureHandler))]
-[assembly: ExportHandler(typeof(DragGestureRecognizer), typeof(DragGestureHandler))]
-[assembly: ExportHandler(typeof(DropGestureRecognizer), typeof(DropGestureHandler))]
-
-[assembly: ExportRenderer(typeof(Shell), typeof(Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Watch.ShellRenderer), TargetIdiom.Watch)]
-[assembly: ExportRenderer(typeof(Shell), typeof(Microsoft.Maui.Controls.Compatibility.Platform.Tizen.TV.TVShellRenderer), TargetIdiom.TV)]
-
-[assembly: ExportRenderer(typeof(Ellipse), typeof(EllipseRenderer))]
-[assembly: ExportRenderer(typeof(Line), typeof(LineRenderer))]
-[assembly: ExportRenderer(typeof(Path), typeof(PathRenderer))]
-[assembly: ExportRenderer(typeof(Polygon), typeof(PolygonRenderer))]
-[assembly: ExportRenderer(typeof(Polyline), typeof(PolylineRenderer))]
-[assembly: ExportRenderer(typeof(Microsoft.Maui.Controls.Compatibility.Shapes.Rectangle), typeof(RectangleRenderer))]
+[assembly: Preserve]
+[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.Compatibility.Platform")]
+[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.Compatibility.Material")]
\ No newline at end of file
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/ActivityIndicatorRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/ActivityIndicatorRenderer.cs
index 4234edf67f..42f7488c34 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/ActivityIndicatorRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/ActivityIndicatorRenderer.cs
@@ -1,8 +1,10 @@
+using Microsoft.Maui.Controls.Platform;
using EColor = ElmSharp.Color;
using EProgressBar = ElmSharp.ProgressBar;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class ActivityIndicatorRenderer : ViewRenderer
{
static readonly EColor s_defaultColor = ThemeConstants.ProgressBar.ColorClass.Default;
@@ -28,10 +30,10 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
void UpdateColor(bool initialize)
{
- if (initialize && Element.Color.IsDefault)
+ if (initialize && Element.Color.IsDefault())
return;
- Control.Color = (Element.Color == Color.Default) ? s_defaultColor : Element.Color.ToPlatform();
+ Control.Color = (Element.Color.IsDefault()) ? s_defaultColor : Element.Color.ToNative();
}
void UpdateIsRunning()
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs
index 63c5d3126c..9823e21fb1 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/BoxViewRenderer.cs
@@ -1,9 +1,11 @@
using System.ComponentModel;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native;
using EColor = ElmSharp.Color;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class BoxViewRenderer : ViewRenderer
{
public BoxViewRenderer()
@@ -33,10 +35,10 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
protected override void UpdateBackgroundColor(bool initialize)
{
- if (initialize && Element.BackgroundColor.IsDefault)
+ if (initialize && Element.BackgroundColor.IsDefault())
return;
- if (Element.Color.IsDefault)
+ if (Element.Color.IsDefault())
{
UpdateColor();
}
@@ -71,9 +73,9 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
void UpdateColor()
{
- if (Element.Color.IsDefault)
+ if (Element.Color.IsDefault())
{
- if (Element.BackgroundColor.IsDefault)
+ if (Element.BackgroundColor.IsDefault())
{
// Set to default color. (Transparent)
Control.Color = EColor.Transparent;
@@ -81,13 +83,13 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
else
{
// Use BackgroundColor only if color is default and background color is not default.
- Control.Color = Element.BackgroundColor.MultiplyAlpha(Element.Opacity).ToPlatform();
+ Control.Color = Element.BackgroundColor.MultiplyAlpha((float)Element.Opacity).ToNative();
}
}
else
{
// Color has higer priority than BackgroundColor.
- Control.Color = Element.Color.MultiplyAlpha(Element.Opacity).ToPlatform();
+ Control.Color = Element.Color.MultiplyAlpha((float)Element.Opacity).ToNative();
}
}
}
diff --git a/src/Compatibility/Core/src/Tizen/Renderers/ButtonRenderer.cs b/src/Compatibility/Core/src/Tizen/Renderers/ButtonRenderer.cs
index f51d3766d1..8933fb8cfb 100644
--- a/src/Compatibility/Core/src/Tizen/Renderers/ButtonRenderer.cs
+++ b/src/Compatibility/Core/src/Tizen/Renderers/ButtonRenderer.cs
@@ -1,10 +1,15 @@
using System;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native;
+using Microsoft.Maui.Devices;
+using NIButton = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.IButton;
using EButton = ElmSharp.Button;
-using Specific = Microsoft.Maui.Controls.Compatibility.PlatformConfiguration.TizenSpecific.VisualElement;
+using Specific = Microsoft.Maui.Controls.PlatformConfiguration.TizenSpecific.VisualElement;
namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen
{
+ [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)]
public class ButtonRenderer : ViewRenderer