From 80b8d93d5113f5cf9d12187d9503acf6ccab8d66 Mon Sep 17 00:00:00 2001 From: Reza Talebi Date: Sat, 25 Jan 2025 18:04:05 +0330 Subject: [PATCH 1/6] Update to .NET 9.0 (Revert WinUI) --- Core/Device/Screen.cs | 4 +- Core/Native/NativeRenderer.cs | 4 +- Core/Native/Renderer.cs | 4 +- Core/Services/Css/BatchUIChangeContext.cs | 2 +- Core/Services/Css/CssEngine.cs | 2 +- Core/Services/Css/InheritanceDepth.cs | 4 +- Core/Services/LayoutTracker.cs | 2 +- Core/UI.Core/TextInput.cs | 2 +- Core/UI.Core/View.Hierarchy.cs | 4 +- Core/UI.Core/View.Positioning.cs | 8 +- Core/UI.Core/ViewExtensions.cs | 4 +- Framework/Async/AsyncEvent.cs | 2 +- Framework/Common/AssemblyInfo.cs | 2 +- Framework/Common/ZebbleConfiguration.cs | 2 +- Framework/Common/ZebbleLogging.cs | 2 +- Framework/Device/IO.cs | 6 +- Framework/Services/System/SuspendGC.cs | 2 +- Framework/UIRuntime.cs | 2 +- Mvvm/RenderAbstractions/Template.cs | 2 +- SharedApp/ThreadPool.cs | 2 +- Zebble.Build/Common/SolutionFixer.cs | 10 +- Zebble.Build/ConvertPlugin/PluginConverter.cs | 2 +- Zebble.Build/NavigationXml/NavXmlGenerator.cs | 2 +- Zebble.Build/Zebble.Build.csproj | 2 +- .../Properties/launchSettings.json | 2 +- Zebble.CompileZbl/Zebble.CompileZbl.csproj | 4 +- Zebble.Css/Properties/launchSettings.json | 2 +- Zebble.Css/Zebble.Css.csproj | 4 +- Zebble.FormatZbl/Zebble.FormatZbl.csproj | 4 +- Zebble.Image/SplashImageCreator.cs | 108 ++++----- Zebble.Image/Zebble.Image.csproj | 6 +- Zebble.Schema/SchemaGenerator.cs | 4 +- Zebble.Schema/TypeDetector.cs | 2 +- Zebble.Schema/Zebble.Schema.csproj | 4 +- Zebble.Tooling/Utilities/DirectoryContext.cs | 6 +- Zebble/MAUIWindows/Animation.cs | 9 - Zebble/MAUIWindows/Font.cs | 14 -- Zebble/MAUIWindows/ImageService.cs | 26 --- Zebble/MAUIWindows/Renderer.cs | 14 -- Zebble/MAUIWindows/Screen.cs | 69 ------ Zebble/MAUIWindows/UIRuntime.cs | 11 - .../Controls/UWPBlurBox.cs} | 6 +- .../Controls/UWPCanvas.cs} | 16 +- .../Controls/UWPControlWrapper.cs} | 14 +- .../Controls/UWPImageView.cs} | 12 +- .../Controls/UWPScrollView.ManualMode.cs} | 14 +- .../Controls/UWPScrollView.cs} | 10 +- .../Controls/UWPTextBlock.cs} | 16 +- .../Controls/UWPTextBox.cs} | 18 +- .../Controls/UWPTextBoxPassword.cs} | 8 +- Zebble/{WinUI => UWP}/Renderer.cs | 32 +-- Zebble/{WinUI => UWP}/Screen.cs | 20 +- .../UWP.UIRuntime.cs} | 5 +- .../Utilities/Animation/UWP.Animation.cs} | 4 +- .../Animation/ZebblePropertyAnimator.cs | 4 +- .../Utilities/BaseApplication.cs | 40 ++-- .../{WinUI => UWP}/Utilities/GaussianBlur.cs | 0 Zebble/{WinUI => UWP}/Utilities/Inspector.cs | 6 +- .../Utilities/LiveCssWatcher.cs | 2 +- .../Utilities/UWP.Font.cs} | 8 +- .../Utilities/UWP.ImageService.cs} | 2 +- .../Utilities/UWP.Setup.cs} | 4 +- .../Utilities/UWPGestureRecognizer.cs} | 10 +- .../Utilities/UWPRenderExtensions.cs} | 15 +- Zebble/Zebble.csproj | 216 +++++++++--------- 65 files changed, 359 insertions(+), 490 deletions(-) delete mode 100644 Zebble/MAUIWindows/Animation.cs delete mode 100644 Zebble/MAUIWindows/Font.cs delete mode 100644 Zebble/MAUIWindows/ImageService.cs delete mode 100644 Zebble/MAUIWindows/Renderer.cs delete mode 100644 Zebble/MAUIWindows/Screen.cs delete mode 100644 Zebble/MAUIWindows/UIRuntime.cs rename Zebble/{WinUI/Controls/WinUIBlurBox.cs => UWP/Controls/UWPBlurBox.cs} (82%) rename Zebble/{WinUI/Controls/WinUICanvas.cs => UWP/Controls/UWPCanvas.cs} (75%) rename Zebble/{WinUI/Controls/WinUIControlWrapper.cs => UWP/Controls/UWPControlWrapper.cs} (95%) rename Zebble/{WinUI/Controls/WinUIImageView.cs => UWP/Controls/UWPImageView.cs} (91%) rename Zebble/{WinUI/Controls/WinUIScrollView.ManualMode.cs => UWP/Controls/UWPScrollView.ManualMode.cs} (90%) rename Zebble/{WinUI/Controls/WinUIScrollView.cs => UWP/Controls/UWPScrollView.cs} (97%) rename Zebble/{WinUI/Controls/WinUITextBlock.cs => UWP/Controls/UWPTextBlock.cs} (92%) rename Zebble/{WinUI/Controls/WinUITextBox.cs => UWP/Controls/UWPTextBox.cs} (94%) rename Zebble/{WinUI/Controls/WinUITextBoxPassword.cs => UWP/Controls/UWPTextBoxPassword.cs} (77%) rename Zebble/{WinUI => UWP}/Renderer.cs (93%) rename Zebble/{WinUI => UWP}/Screen.cs (92%) rename Zebble/{WinUI/WinUI.UIRuntime.cs => UWP/UWP.UIRuntime.cs} (95%) rename Zebble/{WinUI/Utilities/Animation/WinUI.Animation.cs => UWP/Utilities/Animation/UWP.Animation.cs} (98%) rename Zebble/{WinUI => UWP}/Utilities/Animation/ZebblePropertyAnimator.cs (91%) rename Zebble/{WinUI => UWP}/Utilities/BaseApplication.cs (87%) rename Zebble/{WinUI => UWP}/Utilities/GaussianBlur.cs (100%) rename Zebble/{WinUI => UWP}/Utilities/Inspector.cs (94%) rename Zebble/{WinUI => UWP}/Utilities/LiveCssWatcher.cs (99%) rename Zebble/{WinUI/Utilities/WinUI.Font.cs => UWP/Utilities/UWP.Font.cs} (95%) rename Zebble/{WinUI/Utilities/WinUI.ImageService.cs => UWP/Utilities/UWP.ImageService.cs} (99%) rename Zebble/{WinUI/Utilities/WinUI.Setup.cs => UWP/Utilities/UWP.Setup.cs} (87%) rename Zebble/{WinUI/Utilities/WinUIGestureRecognizer.cs => UWP/Utilities/UWPGestureRecognizer.cs} (98%) rename Zebble/{WinUI/Utilities/WinUIRenderExtensions.cs => UWP/Utilities/UWPRenderExtensions.cs} (98%) diff --git a/Core/Device/Screen.cs b/Core/Device/Screen.cs index 014cb29..c47a07a 100644 --- a/Core/Device/Screen.cs +++ b/Core/Device/Screen.cs @@ -148,7 +148,7 @@ public static void ConfigureSize(Func widthProvider, Func heightPr WidthProvider = widthProvider; HeightProvider = heightProvider; -#if WINUI +#if UWP if (UIRuntime.IsDevMode && UIRuntime.Inspector.IsRotating) { Width = widthProvider(); @@ -172,7 +172,7 @@ internal static void UpdateLayout() Width = newWidth; Height = newHeight; -#if WINUI +#if UWP var extra = UIRuntime.IsDevMode ? UIRuntime.Inspector.CurrentWidth : 0; UIRuntime.RenderRoot.Size(Width + extra, Height); #endif diff --git a/Core/Native/NativeRenderer.cs b/Core/Native/NativeRenderer.cs index 007dfb6..2883a06 100644 --- a/Core/Native/NativeRenderer.cs +++ b/Core/Native/NativeRenderer.cs @@ -8,8 +8,8 @@ namespace Zebble using Android.Runtime; using BaseNativeType = Android.Views.View; [Preserve] -#elif WINUI - using BaseNativeType = Microsoft.UI.Xaml.FrameworkElement; +#elif UWP + using BaseNativeType = Windows.UI.Xaml.FrameworkElement; #else using BaseNativeType = object; #endif diff --git a/Core/Native/Renderer.cs b/Core/Native/Renderer.cs index c0666ea..920367e 100644 --- a/Core/Native/Renderer.cs +++ b/Core/Native/Renderer.cs @@ -9,8 +9,8 @@ namespace Zebble using BaseNativeType = UIKit.UIView; #elif ANDROID using BaseNativeType = Android.Views.View; -#elif WINUI - using BaseNativeType = Microsoft.UI.Xaml.FrameworkElement; +#elif UWP + using BaseNativeType = Windows.UI.Xaml.FrameworkElement; #elif MAUI_Windows using BaseNativeType = object; #endif diff --git a/Core/Services/Css/BatchUIChangeContext.cs b/Core/Services/Css/BatchUIChangeContext.cs index f325086..c24415d 100644 --- a/Core/Services/Css/BatchUIChangeContext.cs +++ b/Core/Services/Css/BatchUIChangeContext.cs @@ -53,7 +53,7 @@ internal void TrackCascade(Length length) Log.For(this).Debug(""); } -#if WINUI +#if UWP Device.App.ExitWithError("Detected cyclic dependency in layout settings. See the output log."); #endif } diff --git a/Core/Services/Css/CssEngine.cs b/Core/Services/Css/CssEngine.cs index 06e61cf..6012aea 100644 --- a/Core/Services/Css/CssEngine.cs +++ b/Core/Services/Css/CssEngine.cs @@ -150,7 +150,7 @@ static CssRule[] FindMatchedRules(View view) static CssRule[] FindRules(View view) { var result = FindPossibleRules(view); -#if WINUI +#if UWP if (UIRuntime.IsDevMode) { result = result.Where(x => x.Platform == null || x.Platform == Platform).ToList(); diff --git a/Core/Services/Css/InheritanceDepth.cs b/Core/Services/Css/InheritanceDepth.cs index a762888..1ec6298 100644 --- a/Core/Services/Css/InheritanceDepth.cs +++ b/Core/Services/Css/InheritanceDepth.cs @@ -46,8 +46,8 @@ static void Reload() { var asses = AppDomain.CurrentDomain.GetAssemblies(); var assemblies = asses -#if WINUI - // .NET Native (WinUI) and other forms of Native AOT compilers don't support GetReferencedAssemblies +#if UWP + // .NET Native (UWP) and other forms of Native AOT compilers don't support GetReferencedAssemblies .Where(c => c.GetName().Name.Contains("Zebble")) #else .Where(c => c.References(ZebbleAssembly) || c.GetName().Name.Contains("Zebble")) diff --git a/Core/Services/LayoutTracker.cs b/Core/Services/LayoutTracker.cs index 6ec660d..4870607 100644 --- a/Core/Services/LayoutTracker.cs +++ b/Core/Services/LayoutTracker.cs @@ -28,7 +28,7 @@ public class LayoutTracker public static void Track(ITrackable trackable, object value, [CallerMemberName] string caller = null) { -#if WINUI +#if UWP if (!UIRuntime.IsDevMode) return; if (Tracking.None()) return; if (Tracking.Lacks(GetTrackingRef(trackable))) return; diff --git a/Core/UI.Core/TextInput.cs b/Core/UI.Core/TextInput.cs index f7fc8ce..b34c7f3 100644 --- a/Core/UI.Core/TextInput.cs +++ b/Core/UI.Core/TextInput.cs @@ -94,7 +94,7 @@ public SpellCheckingType SpellChecking } /// - /// Only needed for iOS. In Android and WinUI this can achived by setting SpellChecking. + /// Only needed for iOS. In Android and UWP this can achived by setting SpellChecking. /// public AutoCorrectionType AutoCorrection { diff --git a/Core/UI.Core/View.Hierarchy.cs b/Core/UI.Core/View.Hierarchy.cs index b7f9b6b..99b9769 100644 --- a/Core/UI.Core/View.Hierarchy.cs +++ b/Core/UI.Core/View.Hierarchy.cs @@ -218,7 +218,7 @@ public Task RemoveAt(int childIndex, bool awaitNative = false) public virtual async Task Remove(View view, bool awaitNative = false) { -#if WINUI +#if UWP if (UIRuntime.IsDevMode) UIRuntime.Inspector.DomUpdated(view).RunInParallel(); #endif @@ -307,7 +307,7 @@ async Task DoAddToNativeParent() UIWorkBatch.Publish(this, "[ADD]", null); -#if WINUI +#if UWP if (UIRuntime.IsDevMode) await UIRuntime.Inspector.DomUpdated(this); #endif } diff --git a/Core/UI.Core/View.Positioning.cs b/Core/UI.Core/View.Positioning.cs index 9f11ed5..9c7e3c3 100644 --- a/Core/UI.Core/View.Positioning.cs +++ b/Core/UI.Core/View.Positioning.cs @@ -84,8 +84,8 @@ public float NativeX return Thread.UI.Run(() => { -#if WINUI - return (float)Microsoft.UI.Xaml.Controls.Canvas.GetLeft((Microsoft.UI.Xaml.UIElement)native); +#if UWP + return (float)Windows.UI.Xaml.Controls.Canvas.GetLeft((Windows.UI.Xaml.UIElement)native); #elif IOS var nativeLayer = (native as UIKit.UIView).Layer.PresentationLayer; @@ -110,8 +110,8 @@ public float NativeY var native = Native; if (native is null) return -1; return Thread.UI.Run(() => { -#if WINUI - return (float)Microsoft.UI.Xaml.Controls.Canvas.GetTop((Microsoft.UI.Xaml.UIElement)native); +#if UWP + return (float)Windows.UI.Xaml.Controls.Canvas.GetTop((Windows.UI.Xaml.UIElement)native); #elif IOS var nativeLayer = (native as UIKit.UIView).Layer.PresentationLayer; if (nativeLayer is null) return -1f; diff --git a/Core/UI.Core/ViewExtensions.cs b/Core/UI.Core/ViewExtensions.cs index 885383d..182148f 100644 --- a/Core/UI.Core/ViewExtensions.cs +++ b/Core/UI.Core/ViewExtensions.cs @@ -69,8 +69,8 @@ public static async Task MoveTo(this TView @this, View newParent, return @this; } -#if WINUI - public static Microsoft.UI.Xaml.FrameworkElement Native(this View view) => (Microsoft.UI.Xaml.FrameworkElement)view.Native; +#if UWP + public static Windows.UI.Xaml.FrameworkElement Native(this View view) => (Windows.UI.Xaml.FrameworkElement)view.Native; #elif ANDROID public static Android.Views.View Native(this View view) => (Android.Views.View)view.Native; diff --git a/Framework/Async/AsyncEvent.cs b/Framework/Async/AsyncEvent.cs index ff9ccd5..3965c63 100644 --- a/Framework/Async/AsyncEvent.cs +++ b/Framework/Async/AsyncEvent.cs @@ -29,7 +29,7 @@ public Task RaiseOn(BaseThread thread) var runner = thread.Run(() => Raise()); -#if IOS || ANDROID || WINUI +#if IOS || ANDROID || UWP if (Thread.UI.IsRunning() && thread == Thread.Pool) return Task.CompletedTask; #endif diff --git a/Framework/Common/AssemblyInfo.cs b/Framework/Common/AssemblyInfo.cs index b916679..0054521 100644 --- a/Framework/Common/AssemblyInfo.cs +++ b/Framework/Common/AssemblyInfo.cs @@ -11,7 +11,7 @@ public class AssemblyInfo { public static Assembly[] GetAssemblies() { -#if WINUI +#if UWP var assemblies = new List(); var files = Windows.ApplicationModel.Package.Current.InstalledLocation.GetFilesAsync().AsTask().AwaitResultWithoutContext(); if (files is null) return assemblies.ToArray(); diff --git a/Framework/Common/ZebbleConfiguration.cs b/Framework/Common/ZebbleConfiguration.cs index d7ddc37..6b2988a 100644 --- a/Framework/Common/ZebbleConfiguration.cs +++ b/Framework/Common/ZebbleConfiguration.cs @@ -24,7 +24,7 @@ static IDictionary LoadValues() { try { -#if WINUI || ANDROID || IOS +#if UWP || ANDROID || IOS var text = UIRuntime.GetEmbeddedResources() .FirstOrDefault(x => x.Key.EndsWith("config.xml", StringComparison.OrdinalIgnoreCase)) .Value?.Invoke()?.ToString(Encoding.UTF8); diff --git a/Framework/Common/ZebbleLogging.cs b/Framework/Common/ZebbleLogging.cs index b5a0aff..212cc8a 100644 --- a/Framework/Common/ZebbleLogging.cs +++ b/Framework/Common/ZebbleLogging.cs @@ -37,7 +37,7 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except var message = formatter(state, exception); if (message.IsEmpty()) return; -#if WINUI || IOS +#if UWP || IOS System.Diagnostics.Debug.WriteLine(logLevel + ": " + Category + "> " + message); #elif ANDROID Android.Util.Log.Info("app", message); diff --git a/Framework/Device/IO.cs b/Framework/Device/IO.cs index 5867be1..5d5ffdb 100644 --- a/Framework/Device/IO.cs +++ b/Framework/Device/IO.cs @@ -18,7 +18,7 @@ public static string DocumentsFolder { get { -#if WINUI +#if UWP return Windows.Storage.KnownFolders.DocumentsLibrary.Path; #else return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); @@ -34,7 +34,7 @@ public static string PersonalFolder { get { -#if WINUI +#if UWP return Windows.Storage.ApplicationData.Current.LocalFolder.Path; #else return Environment.GetFolderPath(Environment.SpecialFolder.Personal); @@ -92,7 +92,7 @@ public static string AbsolutePath(string relative) else { relative = NormalizePath(relative); -#if WINUI +#if UWP relative = relative.Replace("/", "\\"); #endif } diff --git a/Framework/Services/System/SuspendGC.cs b/Framework/Services/System/SuspendGC.cs index 4930cd3..3f26e19 100644 --- a/Framework/Services/System/SuspendGC.cs +++ b/Framework/Services/System/SuspendGC.cs @@ -11,7 +11,7 @@ public class SuspendGC : IDisposable SuspendGC() { Original = GCSettings.LatencyMode; -#if WINUI +#if UWP GCSettings.LatencyMode = GCLatencyMode.LowLatency; #else GCSettings.LatencyMode = GCLatencyMode.NoGCRegion; diff --git a/Framework/UIRuntime.cs b/Framework/UIRuntime.cs index d1223ec..cbd45d1 100644 --- a/Framework/UIRuntime.cs +++ b/Framework/UIRuntime.cs @@ -62,7 +62,7 @@ public static void Initialize(string appName, Action } static IHostBuilder CreateHostBuilder() where T : class { -#if !WINUI +#if !UWP return XamarinHost.CreateDefaultBuilder(); #else return Host.CreateDefaultBuilder(); diff --git a/Mvvm/RenderAbstractions/Template.cs b/Mvvm/RenderAbstractions/Template.cs index cedfc07..0f6a945 100644 --- a/Mvvm/RenderAbstractions/Template.cs +++ b/Mvvm/RenderAbstractions/Template.cs @@ -18,7 +18,7 @@ internal View GetOrCreate(ViewModel model) if (View == null || View.IsDisposing) { View = (View)TemplateType.CreateInstance(); -#if WINUI || ANDROID || IOS +#if UWP || ANDROID || IOS View.SetViewModelValue(model); View.RefreshBindings(); #endif diff --git a/SharedApp/ThreadPool.cs b/SharedApp/ThreadPool.cs index d3b58b4..d8515f4 100644 --- a/SharedApp/ThreadPool.cs +++ b/SharedApp/ThreadPool.cs @@ -88,7 +88,7 @@ public override Task Run(Func> task) return task(); } -#if IOS || ANDROID || WINUI +#if IOS || ANDROID || UWP public override bool IsRunning() => !Thread.UI.IsRunning(); #else public override bool IsRunning() => true; diff --git a/Zebble.Build/Common/SolutionFixer.cs b/Zebble.Build/Common/SolutionFixer.cs index 486813c..42f0b23 100644 --- a/Zebble.Build/Common/SolutionFixer.cs +++ b/Zebble.Build/Common/SolutionFixer.cs @@ -117,8 +117,8 @@ void RenameSpecificPlatformsProjects(FileInfo solutionFile) foreach (var token in new[] { "", $"{solutionFile.NameWithoutExtension()}\\" }) { solutionText = solutionText.Replace( - oldValue: $"Project(\"{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}\") = \"WinUI\", \"{token}Run\\WinUI\\WinUI.csproj\"", - newValue: $"Project(\"{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}\") = \"~WinUI\", \"{token}Run\\WinUI\\~WinUI.csproj\"" + oldValue: $"Project(\"{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}\") = \"UWP\", \"{token}Run\\UWP\\UWP.csproj\"", + newValue: $"Project(\"{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}\") = \"~UWP\", \"{token}Run\\UWP\\~UWP.csproj\"" ); solutionText = solutionText.Replace( @@ -175,11 +175,11 @@ static void FixSolutionSettings(FileInfo solution) var buildSettings = new List(); - var winuiGUID = "{51AEAFB7-E02B-4F51-8AB0-AA90E034E684}"; + var uwpGUID = "{51AEAFB7-E02B-4F51-8AB0-AA90E034E684}"; foreach (var platform in new[] { "Any CPU", "iPhone", "iPhoneSimulator" }) { - buildSettings.Add($"{winuiGUID}.Debug|{platform}.Build.0 = Debug|x86"); - buildSettings.Add($"{winuiGUID}.Debug|{platform}.Deploy.0 = Debug|x86"); + buildSettings.Add($"{uwpGUID}.Debug|{platform}.Build.0 = Debug|x86"); + buildSettings.Add($"{uwpGUID}.Debug|{platform}.Deploy.0 = Debug|x86"); } var iosGUID = "{3B21A769-F17C-4219-A595-27A34955228F}"; diff --git a/Zebble.Build/ConvertPlugin/PluginConverter.cs b/Zebble.Build/ConvertPlugin/PluginConverter.cs index 05e0616..ff98d12 100644 --- a/Zebble.Build/ConvertPlugin/PluginConverter.cs +++ b/Zebble.Build/ConvertPlugin/PluginConverter.cs @@ -108,7 +108,7 @@ void MoveTo(string name) MoveTo("Shared"); MoveTo("iOS"); MoveTo("Android"); - MoveTo("WinUI"); + MoveTo("UWP"); } void RemoveOldFilesAndFolders() diff --git a/Zebble.Build/NavigationXml/NavXmlGenerator.cs b/Zebble.Build/NavigationXml/NavXmlGenerator.cs index 5e785ae..1bc124d 100644 --- a/Zebble.Build/NavigationXml/NavXmlGenerator.cs +++ b/Zebble.Build/NavigationXml/NavXmlGenerator.cs @@ -14,7 +14,7 @@ class NavXmlGenerator : Builder public NavXmlGenerator() { - _navXmlFile = Path.Combine(DirectoryContext.WinUIObjFolder.FullName, "zebble-nav.xml").AsFile(); + _navXmlFile = Path.Combine(DirectoryContext.UWPObjFolder.FullName, "zebble-nav.xml").AsFile(); Log($"Updated navigation info will be written into: {_navXmlFile.FullName}"); } diff --git a/Zebble.Build/Zebble.Build.csproj b/Zebble.Build/Zebble.Build.csproj index dc0953e..d93dda3 100644 --- a/Zebble.Build/Zebble.Build.csproj +++ b/Zebble.Build/Zebble.Build.csproj @@ -39,7 +39,7 @@ - + diff --git a/Zebble.CompileZbl/Properties/launchSettings.json b/Zebble.CompileZbl/Properties/launchSettings.json index e7f6248..a323df1 100644 --- a/Zebble.CompileZbl/Properties/launchSettings.json +++ b/Zebble.CompileZbl/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Zebble.CompileZbl": { "commandName": "Project", - "workingDirectory": "D:\\Geeks\\WinUI\\fyioNew\\fyio.mobile" + "workingDirectory": "D:\\Geeks\\UWP\\fyioNew\\fyio.mobile" } } } \ No newline at end of file diff --git a/Zebble.CompileZbl/Zebble.CompileZbl.csproj b/Zebble.CompileZbl/Zebble.CompileZbl.csproj index c7b95ec..266cfb4 100644 --- a/Zebble.CompileZbl/Zebble.CompileZbl.csproj +++ b/Zebble.CompileZbl/Zebble.CompileZbl.csproj @@ -39,8 +39,8 @@ - - + + diff --git a/Zebble.Css/Properties/launchSettings.json b/Zebble.Css/Properties/launchSettings.json index b4d5863..476be53 100644 --- a/Zebble.Css/Properties/launchSettings.json +++ b/Zebble.Css/Properties/launchSettings.json @@ -3,7 +3,7 @@ "Zebble.Css": { "commandName": "Project", "commandLineArgs": "generate", - "workingDirectory": "D:\\Geeks\\WinUI\\fyioNew\\fyio.mobile" + "workingDirectory": "D:\\Geeks\\UWP\\fyioNew\\fyio.mobile" } } } \ No newline at end of file diff --git a/Zebble.Css/Zebble.Css.csproj b/Zebble.Css/Zebble.Css.csproj index 87c325e..a3ef071 100644 --- a/Zebble.Css/Zebble.Css.csproj +++ b/Zebble.Css/Zebble.Css.csproj @@ -39,8 +39,8 @@ - - + + diff --git a/Zebble.FormatZbl/Zebble.FormatZbl.csproj b/Zebble.FormatZbl/Zebble.FormatZbl.csproj index 5bdd760..6fc0fe4 100644 --- a/Zebble.FormatZbl/Zebble.FormatZbl.csproj +++ b/Zebble.FormatZbl/Zebble.FormatZbl.csproj @@ -44,8 +44,8 @@ - - + + diff --git a/Zebble.Image/SplashImageCreator.cs b/Zebble.Image/SplashImageCreator.cs index 54c64d2..31b7f8a 100644 --- a/Zebble.Image/SplashImageCreator.cs +++ b/Zebble.Image/SplashImageCreator.cs @@ -58,60 +58,60 @@ IEnumerable GetVersions() // Legacy yield return new ScaledVersion { OutputPath = "Run\\iOS\\Resources\\Legacy-Icon-1024-768.png", Width = 1024, Height = 768 }; - // Splash - WinUI - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Splash.scale-400.png", Width = 2480, Height = 1200 }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Splash.scale-200.png", Width = 1240, Height = 600 }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Splash.scale-150.png", Width = 930, Height = 450 }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Splash.scale-125.png", Width = 775, Height = 375 }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Splash.scale-100.png", Width = 620, Height = 300 }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Wide310x150Logo.scale-400.png", Width = 1240, Height = 600, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Wide310x150Logo.scale-200.png", Width = 620, Height = 300, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Wide310x150Logo.scale-150.png", Width = 465, Height = 225, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Wide310x150Logo.scale-125.png", Width = 388, Height = 188, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Wide310x150Logo.scale-100.png", Width = 310, Height = 150, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square150x150Logo.scale-200.png", Width = 300, Height = 300, ScaleToExactSize = true }; - - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.targetsize-24_altform-unplated.png", Width = 24, Height = 24, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\StoreLogo.png", Width = 50, Height = 50, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.scale-200.png", Width = 88, Height = 88, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\LargeTile.scale-100.png", Width = 310, Height = 310, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\LargeTile.scale-125.png", Width = 388, Height = 388, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\LargeTile.scale-150.png", Width = 465, Height = 465, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\LargeTile.scale-200.png", Width = 620, Height = 620, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\LargeTile.scale-400.png", Width = 1240, Height = 1240, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\LockScreenLogo.scale-200.png", Width = 48, Height = 48, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\SmallTile.scale-100.png", Width = 71, Height = 71, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\SmallTile.scale-125.png", Width = 89, Height = 89, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\SmallTile.scale-150.png", Width = 107, Height = 107, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\SmallTile.scale-200.png", Width = 142, Height = 142, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\SmallTile.scale-400.png", Width = 284, Height = 284, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square150x150Logo.scale-100.png", Width = 150, Height = 150, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square150x150Logo.scale-125.png", Width = 188, Height = 188, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square150x150Logo.scale-150.png", Width = 225, Height = 225, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square150x150Logo.scale-200.png", Width = 300, Height = 300, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square150x150Logo.scale-400.png", Width = 600, Height = 600, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-16.png", Width = 16, Height = 16, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-24.png", Width = 24, Height = 24, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-256.png", Width = 256, Height = 256, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-32.png", Width = 32, Height = 32, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-48.png", Width = 48, Height = 48, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.scale-100.png", Width = 44, Height = 44, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.scale-125.png", Width = 55, Height = 55, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.scale-150.png", Width = 66, Height = 66, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.scale-200.png", Width = 88, Height = 88, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.scale-400.png", Width = 176, Height = 176, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.targetsize-16.png", Width = 16, Height = 16, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.targetsize-24.png", Width = 24, Height = 24, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.targetsize-24_altform-unplated.png", Width = 24, Height = 24, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.targetsize-256.png", Width = 256, Height = 256, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.targetsize-32.png", Width = 32, Height = 32, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\Square44x44Logo.targetsize-48.png", Width = 48, Height = 48, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\StoreLogo.png", Width = 1240, Height = 600, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\StoreLogo.scale-100.png", Width = 50, Height = 50, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\StoreLogo.scale-125.png", Width = 63, Height = 63, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\StoreLogo.scale-150.png", Width = 75, Height = 75, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\StoreLogo.scale-200.png", Width = 100, Height = 100, ScaleToExactSize = true }; - yield return new ScaledVersion { OutputPath = "Run\\WinUI\\Assets\\Tiles\\StoreLogo.scale-400.png", Width = 200, Height = 200, ScaleToExactSize = true }; + // Splash - UWP + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Splash.scale-400.png", Width = 2480, Height = 1200 }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Splash.scale-200.png", Width = 1240, Height = 600 }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Splash.scale-150.png", Width = 930, Height = 450 }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Splash.scale-125.png", Width = 775, Height = 375 }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Splash.scale-100.png", Width = 620, Height = 300 }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Wide310x150Logo.scale-400.png", Width = 1240, Height = 600, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Wide310x150Logo.scale-200.png", Width = 620, Height = 300, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Wide310x150Logo.scale-150.png", Width = 465, Height = 225, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Wide310x150Logo.scale-125.png", Width = 388, Height = 188, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Wide310x150Logo.scale-100.png", Width = 310, Height = 150, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square150x150Logo.scale-200.png", Width = 300, Height = 300, ScaleToExactSize = true }; + + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.targetsize-24_altform-unplated.png", Width = 24, Height = 24, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\StoreLogo.png", Width = 50, Height = 50, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.scale-200.png", Width = 88, Height = 88, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\LargeTile.scale-100.png", Width = 310, Height = 310, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\LargeTile.scale-125.png", Width = 388, Height = 388, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\LargeTile.scale-150.png", Width = 465, Height = 465, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\LargeTile.scale-200.png", Width = 620, Height = 620, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\LargeTile.scale-400.png", Width = 1240, Height = 1240, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\LockScreenLogo.scale-200.png", Width = 48, Height = 48, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\SmallTile.scale-100.png", Width = 71, Height = 71, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\SmallTile.scale-125.png", Width = 89, Height = 89, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\SmallTile.scale-150.png", Width = 107, Height = 107, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\SmallTile.scale-200.png", Width = 142, Height = 142, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\SmallTile.scale-400.png", Width = 284, Height = 284, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square150x150Logo.scale-100.png", Width = 150, Height = 150, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square150x150Logo.scale-125.png", Width = 188, Height = 188, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square150x150Logo.scale-150.png", Width = 225, Height = 225, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square150x150Logo.scale-200.png", Width = 300, Height = 300, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square150x150Logo.scale-400.png", Width = 600, Height = 600, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-16.png", Width = 16, Height = 16, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-24.png", Width = 24, Height = 24, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-256.png", Width = 256, Height = 256, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-32.png", Width = 32, Height = 32, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.altform-unplated_targetsize-48.png", Width = 48, Height = 48, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.scale-100.png", Width = 44, Height = 44, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.scale-125.png", Width = 55, Height = 55, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.scale-150.png", Width = 66, Height = 66, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.scale-200.png", Width = 88, Height = 88, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.scale-400.png", Width = 176, Height = 176, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.targetsize-16.png", Width = 16, Height = 16, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.targetsize-24.png", Width = 24, Height = 24, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.targetsize-24_altform-unplated.png", Width = 24, Height = 24, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.targetsize-256.png", Width = 256, Height = 256, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.targetsize-32.png", Width = 32, Height = 32, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\Square44x44Logo.targetsize-48.png", Width = 48, Height = 48, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\StoreLogo.png", Width = 1240, Height = 600, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\StoreLogo.scale-100.png", Width = 50, Height = 50, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\StoreLogo.scale-125.png", Width = 63, Height = 63, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\StoreLogo.scale-150.png", Width = 75, Height = 75, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\StoreLogo.scale-200.png", Width = 100, Height = 100, ScaleToExactSize = true }; + yield return new ScaledVersion { OutputPath = "Run\\UWP\\Assets\\Tiles\\StoreLogo.scale-400.png", Width = 200, Height = 200, ScaleToExactSize = true }; // Splash - Android diff --git a/Zebble.Image/Zebble.Image.csproj b/Zebble.Image/Zebble.Image.csproj index 45a6605..37cd40d 100644 --- a/Zebble.Image/Zebble.Image.csproj +++ b/Zebble.Image/Zebble.Image.csproj @@ -36,9 +36,9 @@ - - - + + + diff --git a/Zebble.Schema/SchemaGenerator.cs b/Zebble.Schema/SchemaGenerator.cs index 022f6d1..d805b0b 100644 --- a/Zebble.Schema/SchemaGenerator.cs +++ b/Zebble.Schema/SchemaGenerator.cs @@ -14,9 +14,9 @@ static class SchemaGenerator public static void Run() { - if (!DirectoryContext.WinUIBinFolder.Exists() || DirectoryContext.WinUIBinFolder.GetFiles("*.dll", SearchOption.AllDirectories).None()) + if (!DirectoryContext.UWPBinFolder.Exists() || DirectoryContext.UWPBinFolder.GetFiles("*.dll", SearchOption.AllDirectories).None()) { - Console.WriteLine("Skipped to update the xml schema as WinUI is not compiled yet."); + Console.WriteLine("Skipped to update the xml schema as UWP is not compiled yet."); return; } diff --git a/Zebble.Schema/TypeDetector.cs b/Zebble.Schema/TypeDetector.cs index 6e0bcd1..63db824 100644 --- a/Zebble.Schema/TypeDetector.cs +++ b/Zebble.Schema/TypeDetector.cs @@ -10,7 +10,7 @@ public class TypeDetector { - static DirectoryInfo AssembliesFolder => DirectoryContext.WinUIBinFolder.GetSubDirectory("x86").GetSubDirectory("Debug"); + static DirectoryInfo AssembliesFolder => DirectoryContext.UWPBinFolder.GetSubDirectory("x86").GetSubDirectory("Debug"); static readonly DefaultAssemblyResolver AssemblyResolver = new(); static TypeDetector() => AssemblyResolver.AddSearchDirectory(AssembliesFolder.FullName); diff --git a/Zebble.Schema/Zebble.Schema.csproj b/Zebble.Schema/Zebble.Schema.csproj index 26acbc3..22d00ba 100644 --- a/Zebble.Schema/Zebble.Schema.csproj +++ b/Zebble.Schema/Zebble.Schema.csproj @@ -36,8 +36,8 @@ - - + + diff --git a/Zebble.Tooling/Utilities/DirectoryContext.cs b/Zebble.Tooling/Utilities/DirectoryContext.cs index 96669cf..aa421a5 100644 --- a/Zebble.Tooling/Utilities/DirectoryContext.cs +++ b/Zebble.Tooling/Utilities/DirectoryContext.cs @@ -21,9 +21,9 @@ static DirectoryContext() public static DirectoryInfo AppUIStylesFolder => AppUIFolder.GetSubDirectory("Styles"); public static DirectoryInfo RunFolder => RootFolder.GetSubDirectory("Run"); public static DirectoryInfo AndroidFolder => RunFolder.GetSubDirectory("Android"); - public static DirectoryInfo WinUIFolder => RunFolder.GetSubDirectory("WinUI"); - public static DirectoryInfo WinUIBinFolder => WinUIFolder.GetSubDirectory("bin"); - public static DirectoryInfo WinUIObjFolder => WinUIFolder.GetSubDirectory("obj"); + public static DirectoryInfo UWPFolder => RunFolder.GetSubDirectory("UWP"); + public static DirectoryInfo UWPBinFolder => UWPFolder.GetSubDirectory("bin"); + public static DirectoryInfo UWPObjFolder => UWPFolder.GetSubDirectory("obj"); public static DirectoryInfo ViewModelFolder => RootFolder.GetSubDirectory("ViewModel"); public static DirectoryInfo[] Platforms => RunFolder.GetDirectories(); diff --git a/Zebble/MAUIWindows/Animation.cs b/Zebble/MAUIWindows/Animation.cs deleted file mode 100644 index e02cda8..0000000 --- a/Zebble/MAUIWindows/Animation.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Zebble -{ - partial class Animation - { - internal void Apply(View target) => throw new NotSupportedException(); - } -} \ No newline at end of file diff --git a/Zebble/MAUIWindows/Font.cs b/Zebble/MAUIWindows/Font.cs deleted file mode 100644 index 5b6e496..0000000 --- a/Zebble/MAUIWindows/Font.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Zebble -{ - using System; - - partial class Font - { - float CalculateAutomaticExtraTopPadding() => throw new NotSupportedException(); - float CalculateTextHeight(float width, string text) => throw new NotSupportedException(); - public static string DefaultSystemFont => throw new NotSupportedException(); - float CalculateTextWidth(string text) => throw new NotSupportedException(); - float CalculateFontLineHeight() => throw new NotSupportedException(); - static float GetScaledFontSize(float fontSize) => throw new NotSupportedException(); - } -} \ No newline at end of file diff --git a/Zebble/MAUIWindows/ImageService.cs b/Zebble/MAUIWindows/ImageService.cs deleted file mode 100644 index bf8d512..0000000 --- a/Zebble/MAUIWindows/ImageService.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Zebble.Services -{ - using System; - using System.IO; - using System.Threading.Tasks; - - partial class ImageService - { - public static Task DecodeImage(byte[] data) => throw new NotSupportedException(); - - internal static Size FindImageSize(FileInfo file) => throw new NotSupportedException(); - - static Task FetchImageSize(FileInfo file) => throw new NotSupportedException(); - public static async Task DecodeImage(FileInfo file, Size? desiredSize = null, Stretch stretch = Stretch.Default) => throw new NotSupportedException(); - - public static async Task Resize(FileInfo source, FileInfo destination, Size pixelSize, int jpegQuality = DEFAULT_JPEG_QUALITY) => throw new NotSupportedException(); - - partial class ImageSource - { - public void Dispose() { - Image = null; - GC.SuppressFinalize(this); - } - } - } -} \ No newline at end of file diff --git a/Zebble/MAUIWindows/Renderer.cs b/Zebble/MAUIWindows/Renderer.cs deleted file mode 100644 index 7ad590e..0000000 --- a/Zebble/MAUIWindows/Renderer.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Zebble -{ - using System; - using System.Threading.Tasks; - - partial class Renderer - { - public void Dispose() => GC.SuppressFinalize(this); - - public async Task Render() => throw new NotSupportedException(); - - internal void Apply(string property, UIChangedEventArgs change) => throw new NotSupportedException(); - } -} \ No newline at end of file diff --git a/Zebble/MAUIWindows/Screen.cs b/Zebble/MAUIWindows/Screen.cs deleted file mode 100644 index a6fe71f..0000000 --- a/Zebble/MAUIWindows/Screen.cs +++ /dev/null @@ -1,69 +0,0 @@ -namespace Zebble.Device -{ - using System; - using System.IO; - using System.Threading.Tasks; - using Windows.Graphics.Display; - using Windows.UI.ViewManagement; - - partial class Screen - { - public static partial class SafeAreaInsets - { - public static void DoUpdateValues() { } - } - - public static partial class StatusBar - { - static void DoSetBackgroundColor() => throw new NotSupportedException(); - - static void DoSetForegroundColor() => throw new NotSupportedException(); - - static void DoSetTransparency() => throw new NotSupportedException(); - - static void DoSetVisibility() => throw new NotSupportedException(); - - static void DoSetHasLightContent() => throw new NotSupportedException(); - } - - internal static float? density, hardwareDensity; - - - public static float HardwareDensity - { - get - { - if (hardwareDensity is null) - hardwareDensity = (float)DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; - return hardwareDensity.Value; - } - } - - public static float Density - { - get - { - if (density is null) - density = Thread.UI.Run(() => - (int)DisplayInformation.GetForCurrentView().ResolutionScale / 100f); - - return density.Value; - } - } - - public static DeviceOrientation Orientation - { - get - { - var orientation = Thread.UI.Run(() => ApplicationView.GetForCurrentView().Orientation); - - if (orientation == ApplicationViewOrientation.Landscape) - return DeviceOrientation.Landscape; - else - return DeviceOrientation.Portrait; - } - } - - static async Task DoSaveAsImage(object inputNative) => throw new NotSupportedException(); - } -} diff --git a/Zebble/MAUIWindows/UIRuntime.cs b/Zebble/MAUIWindows/UIRuntime.cs deleted file mode 100644 index e60bc9f..0000000 --- a/Zebble/MAUIWindows/UIRuntime.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Zebble -{ - using System.Collections.Generic; - - partial class UIRuntime - { - public static readonly AsyncEvent> OnParameterRecieved = new(); - public static bool SkipPageRefresh = false; - public static bool IsDevMode => false; - } -} \ No newline at end of file diff --git a/Zebble/WinUI/Controls/WinUIBlurBox.cs b/Zebble/UWP/Controls/UWPBlurBox.cs similarity index 82% rename from Zebble/WinUI/Controls/WinUIBlurBox.cs rename to Zebble/UWP/Controls/UWPBlurBox.cs index 71c7690..c49c96e 100644 --- a/Zebble/WinUI/Controls/WinUIBlurBox.cs +++ b/Zebble/UWP/Controls/UWPBlurBox.cs @@ -1,8 +1,8 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { - public class WinUIBlurBox : WinUICanvasBase + public class UWPBlurBox : UWPCanvasBase { - public WinUIBlurBox(Renderer renderer, BlurBox view) : base(renderer, view) + public UWPBlurBox(Renderer renderer, BlurBox view) : base(renderer, view) { view.BlurredChanged.Handle(MaintainBlur); CreateBlur(); diff --git a/Zebble/WinUI/Controls/WinUICanvas.cs b/Zebble/UWP/Controls/UWPCanvas.cs similarity index 75% rename from Zebble/WinUI/Controls/WinUICanvas.cs rename to Zebble/UWP/Controls/UWPCanvas.cs index 792989b..b30059f 100644 --- a/Zebble/WinUI/Controls/WinUICanvas.cs +++ b/Zebble/UWP/Controls/UWPCanvas.cs @@ -1,10 +1,10 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; - using controls = Microsoft.UI.Xaml.Controls; + using controls = Windows.UI.Xaml.Controls; using Olive; - public abstract class WinUICanvasBase : controls.Canvas, IDisposable, UIChangeCommand.IHandler where TView : View + public abstract class UWPCanvasBase : controls.Canvas, IDisposable, UIChangeCommand.IHandler where TView : View { readonly WeakReference RendererRef; readonly WeakReference ViewRef; @@ -12,7 +12,7 @@ public abstract class WinUICanvasBase : controls.Canvas, IDisposable, UIC protected bool IsDisposed; protected TView View => ViewRef?.GetTargetOrDefault(); - public WinUICanvasBase(Renderer renderer, TView view) + public UWPCanvasBase(Renderer renderer, TView view) { RendererRef = renderer.GetWeakReference(); ViewRef = view.GetWeakReference(); @@ -22,7 +22,7 @@ public WinUICanvasBase(Renderer renderer, TView view) protected void Configure() { HandleTouches(); - VerticalAlignment = Microsoft.UI.Xaml.VerticalAlignment.Top; + VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top; } public void Apply(string property, UIChangedEventArgs change) @@ -48,7 +48,7 @@ void HandleTouches() if (UIRuntime.IsDevMode && view.id.IsAnyOf("ZebbleInspectorHighlightMask", "ZebbleInspectorHighlightBorder")) { Background = null; - ManipulationMode = Microsoft.UI.Xaml.Input.ManipulationModes.None; + ManipulationMode = Windows.UI.Xaml.Input.ManipulationModes.None; IsTapEnabled = false; IsHitTestVisible = false; } @@ -67,8 +67,8 @@ public virtual void Dispose() } } - public class WinUICanvas : WinUICanvasBase + public class UWPCanvas : UWPCanvasBase { - public WinUICanvas(Renderer renderer, View view) : base(renderer, view) { } + public UWPCanvas(Renderer renderer, View view) : base(renderer, view) { } } } \ No newline at end of file diff --git a/Zebble/WinUI/Controls/WinUIControlWrapper.cs b/Zebble/UWP/Controls/UWPControlWrapper.cs similarity index 95% rename from Zebble/WinUI/Controls/WinUIControlWrapper.cs rename to Zebble/UWP/Controls/UWPControlWrapper.cs index d1e5ea0..d5d8bbf 100644 --- a/Zebble/WinUI/Controls/WinUIControlWrapper.cs +++ b/Zebble/UWP/Controls/UWPControlWrapper.cs @@ -1,14 +1,14 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Linq; using System.Threading.Tasks; using Olive; - using Microsoft.UI.Xaml.Media; - using controls = Microsoft.UI.Xaml.Controls; - using xaml = Microsoft.UI.Xaml; + using Windows.UI.Xaml.Media; + using controls = Windows.UI.Xaml.Controls; + using xaml = Windows.UI.Xaml; - class WinUIControlWrapper + class UWPControlWrapper { WeakReference ViewRef; View View => ViewRef.GetTargetOrDefault(); @@ -17,7 +17,7 @@ class WinUIControlWrapper controls.Grid BackgroundImageLayer; ImageView BackgroundImage; - public WinUIControlWrapper(Renderer renderer) + public UWPControlWrapper(Renderer renderer) { ViewRef = renderer.View.GetWeakReference(); Native = new controls.Border { Child = renderer.NativeElement }; @@ -26,7 +26,7 @@ public WinUIControlWrapper(Renderer renderer) BorderRadiusChanged(); } - public Task Render() + public Task Render() { BackgroundChanged(UIChangedEventArgs.Empty); return Task.FromResult(this); diff --git a/Zebble/WinUI/Controls/WinUIImageView.cs b/Zebble/UWP/Controls/UWPImageView.cs similarity index 91% rename from Zebble/WinUI/Controls/WinUIImageView.cs rename to Zebble/UWP/Controls/UWPImageView.cs index e284357..38474eb 100644 --- a/Zebble/WinUI/Controls/WinUIImageView.cs +++ b/Zebble/UWP/Controls/UWPImageView.cs @@ -1,19 +1,19 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Threading.Tasks; - using controls = Microsoft.UI.Xaml.Controls; - using media = Microsoft.UI.Xaml.Media; - using xaml = Microsoft.UI.Xaml; + using controls = Windows.UI.Xaml.Controls; + using media = Windows.UI.Xaml.Media; + using xaml = Windows.UI.Xaml; - class WinUIImageView : IRenderOrchestrator + class UWPImageView : IRenderOrchestrator { ImageView View; controls.Border Result; string LoadedImageKey; readonly EventHandlerDisposer EventHandlerDisposer = new(); - public WinUIImageView(ImageView view) => View = view; + public UWPImageView(ImageView view) => View = view; public async Task Render() { diff --git a/Zebble/WinUI/Controls/WinUIScrollView.ManualMode.cs b/Zebble/UWP/Controls/UWPScrollView.ManualMode.cs similarity index 90% rename from Zebble/WinUI/Controls/WinUIScrollView.ManualMode.cs rename to Zebble/UWP/Controls/UWPScrollView.ManualMode.cs index 4516132..33a0493 100644 --- a/Zebble/WinUI/Controls/WinUIScrollView.ManualMode.cs +++ b/Zebble/UWP/Controls/UWPScrollView.ManualMode.cs @@ -1,24 +1,24 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Collections.Generic; using System.Linq; - using controls = Microsoft.UI.Xaml.Controls; + using controls = Windows.UI.Xaml.Controls; using ScrollViewRef = System.WeakReference; - using WinUIScrollViewRef = System.WeakReference; - using xaml = Microsoft.UI.Xaml; + using UWPScrollViewRef = System.WeakReference; + using xaml = Windows.UI.Xaml; using Olive; - partial class WinUIScrollView + partial class UWPScrollView { xaml.Input.ManipulationDeltaRoutedEventArgs RunningInnertia; - internal static Dictionary Mappings = + internal static Dictionary Mappings = new(); public bool SupportsChildPanning; - static WinUIScrollView GetFor(ScrollView scrollView) + static UWPScrollView GetFor(ScrollView scrollView) { return Mappings .Where(x => x.Key.GetTargetOrDefault() == scrollView) diff --git a/Zebble/WinUI/Controls/WinUIScrollView.cs b/Zebble/UWP/Controls/UWPScrollView.cs similarity index 97% rename from Zebble/WinUI/Controls/WinUIScrollView.cs rename to Zebble/UWP/Controls/UWPScrollView.cs index c71a35a..72dea63 100644 --- a/Zebble/WinUI/Controls/WinUIScrollView.cs +++ b/Zebble/UWP/Controls/UWPScrollView.cs @@ -1,12 +1,12 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Threading.Tasks; - using controls = Microsoft.UI.Xaml.Controls; - using xaml = Microsoft.UI.Xaml; + using controls = Windows.UI.Xaml.Controls; + using xaml = Windows.UI.Xaml; using Olive; - public partial class WinUIScrollView : IRenderOrchestrator + public partial class UWPScrollView : IRenderOrchestrator { const int GAP_UNIT = 30; const int REFRESHER_DURATION = 600; @@ -20,7 +20,7 @@ public partial class WinUIScrollView : IRenderOrchestrator internal controls.StackPanel Container = new() { VerticalAlignment = xaml.VerticalAlignment.Top }; - public WinUIScrollView(ScrollView view) + public UWPScrollView(ScrollView view) { View = view; Mappings.Add(view.GetWeakReference(), this.GetWeakReference()); diff --git a/Zebble/WinUI/Controls/WinUITextBlock.cs b/Zebble/UWP/Controls/UWPTextBlock.cs similarity index 92% rename from Zebble/WinUI/Controls/WinUITextBlock.cs rename to Zebble/UWP/Controls/UWPTextBlock.cs index a4f75af..c9a40af 100644 --- a/Zebble/WinUI/Controls/WinUITextBlock.cs +++ b/Zebble/UWP/Controls/UWPTextBlock.cs @@ -1,16 +1,16 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Runtime.InteropServices; using System.Threading.Tasks; using Olive; - using Microsoft.UI.Text; - using Microsoft.UI.Xaml; - using Microsoft.UI.Xaml.Media; - using controls = Microsoft.UI.Xaml.Controls; - using xaml = Microsoft.UI.Xaml; + using Windows.UI.Text; + using Windows.UI.Xaml; + using Windows.UI.Xaml.Media; + using controls = Windows.UI.Xaml.Controls; + using xaml = Windows.UI.Xaml; - public class WinUITextBlock : controls.Grid, UIChangeCommand.IHandler, INativeRenderer + public class UWPTextBlock : controls.Grid, UIChangeCommand.IHandler, INativeRenderer { WeakReference ViewRef; TextView View => ViewRef.GetTargetOrDefault(); @@ -19,7 +19,7 @@ public class WinUITextBlock : controls.Grid, UIChangeCommand.IHandler, INativeRe public Task Render(Renderer renderer) => Task.FromResult((FrameworkElement)this); - public WinUITextBlock(TextView view) + public UWPTextBlock(TextView view) { ViewRef = view.GetWeakReference(); Background = Colors.Transparent.RenderBrush(); // Without setting the background, the events won't fire diff --git a/Zebble/WinUI/Controls/WinUITextBox.cs b/Zebble/UWP/Controls/UWPTextBox.cs similarity index 94% rename from Zebble/WinUI/Controls/WinUITextBox.cs rename to Zebble/UWP/Controls/UWPTextBox.cs index 6d5b33f..dd05c61 100644 --- a/Zebble/WinUI/Controls/WinUITextBox.cs +++ b/Zebble/UWP/Controls/UWPTextBox.cs @@ -1,15 +1,15 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Linq; using System.Threading.Tasks; using Olive; - using Microsoft.UI.Xaml; - using Microsoft.UI.Xaml.Controls; - using Microsoft.UI.Xaml.Input; - using xaml = Microsoft.UI.Xaml; + using Windows.UI.Xaml; + using Windows.UI.Xaml.Controls; + using Windows.UI.Xaml.Input; + using xaml = Windows.UI.Xaml; - public abstract class WinUITextBoxBase : IRenderOrchestrator, UIChangeCommand.IHandler + public abstract class UWPTextBoxBase : IRenderOrchestrator, UIChangeCommand.IHandler where TResult : Control, new() { protected bool IsApiChangingText; @@ -17,7 +17,7 @@ public abstract class WinUITextBoxBase : IRenderOrchestrator, UIChangeC protected TextInput View; protected TResult Result; - protected WinUITextBoxBase(Renderer renderer) + protected UWPTextBoxBase(Renderer renderer) { Renderer = renderer; View = renderer.View as TextInput; @@ -186,9 +186,9 @@ public virtual void Dispose() { } } - public class WinUITextBox : WinUITextBoxBase + public class UWPTextBox : UWPTextBoxBase { - public WinUITextBox(Renderer renderer) : base(renderer) { } + public UWPTextBox(Renderer renderer) : base(renderer) { } protected override void GenerateResult() { diff --git a/Zebble/WinUI/Controls/WinUITextBoxPassword.cs b/Zebble/UWP/Controls/UWPTextBoxPassword.cs similarity index 77% rename from Zebble/WinUI/Controls/WinUITextBoxPassword.cs rename to Zebble/UWP/Controls/UWPTextBoxPassword.cs index 47fae81..cbdf2db 100644 --- a/Zebble/WinUI/Controls/WinUITextBoxPassword.cs +++ b/Zebble/UWP/Controls/UWPTextBoxPassword.cs @@ -1,12 +1,12 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; - using controls = Microsoft.UI.Xaml.Controls; + using controls = Windows.UI.Xaml.Controls; using Olive; - public class WinUIPasswordBox : WinUITextBoxBase + public class UWPPasswordBox : UWPTextBoxBase { - public WinUIPasswordBox(Renderer renderer) : base(renderer) { } + public UWPPasswordBox(Renderer renderer) : base(renderer) { } protected override void GenerateResult() { diff --git a/Zebble/WinUI/Renderer.cs b/Zebble/UWP/Renderer.cs similarity index 93% rename from Zebble/WinUI/Renderer.cs rename to Zebble/UWP/Renderer.cs index 69390c3..bacd5a8 100644 --- a/Zebble/WinUI/Renderer.cs +++ b/Zebble/UWP/Renderer.cs @@ -3,17 +3,17 @@ namespace Zebble using System; using System.Linq; using System.Threading.Tasks; - using WinUI; - using Microsoft.UI.Xaml.Media; - using controls = Microsoft.UI.Xaml.Controls; - using xaml = Microsoft.UI.Xaml; + using UWP; + using Windows.UI.Xaml.Media; + using controls = Windows.UI.Xaml.Controls; + using xaml = Windows.UI.Xaml; using Olive; partial class Renderer { internal xaml.FrameworkElement NativeElement; - WinUIControlWrapper ResultWrapper; - WinUIGestureRecognizer GestureRecognizer; + UWPControlWrapper ResultWrapper; + UWPGestureRecognizer GestureRecognizer; readonly object RotationSyncLock = new(); xaml.FrameworkElement NativeResult => ResultWrapper?.Native ?? NativeElement; @@ -29,7 +29,7 @@ partial class Renderer throw new RenderException("Failed to create native object for " + View, ex); } - ResultWrapper = await new WinUIControlWrapper(this).Render(); + ResultWrapper = await new UWPControlWrapper(this).Render(); View.Native = NativeResult; if (UIRuntime.IsDebuggerAttached) @@ -44,7 +44,7 @@ partial class Renderer NativeResult.Loaded += NativeResult_Loaded; if (View.HandlesGestures()) - GestureRecognizer = new WinUIGestureRecognizer(NativeResult, View); + GestureRecognizer = new UWPGestureRecognizer(NativeResult, View); if (!View.IsEffectivelyVisible()) NativeResult.Visibility = xaml.Visibility.Collapsed; if (View.Opacity != 1) OnOpacityChanged(new UIChangedEventArgs(View, View.Opacity)); @@ -58,20 +58,20 @@ partial class Renderer async Task CreateNativeElement() { if (View is IRenderedBy) NativeElement = CreateFromNativeRenderer(); - else if (View is TextView tv) NativeElement = new WinUITextBlock(tv); + else if (View is TextView tv) NativeElement = new UWPTextBlock(tv); else if (View is TextInput input) { if (input.GetEffectiveTextMode() == TextMode.Password) - NativeElement = await (RenderOrchestrator = new WinUIPasswordBox(this)).Render(); + NativeElement = await (RenderOrchestrator = new UWPPasswordBox(this)).Render(); else - NativeElement = await (RenderOrchestrator = new WinUITextBox(this)).Render(); + NativeElement = await (RenderOrchestrator = new UWPTextBox(this)).Render(); } else if (View is ImageView image) - NativeElement = await (RenderOrchestrator = new WinUIImageView(image)).Render(); + NativeElement = await (RenderOrchestrator = new UWPImageView(image)).Render(); else if (View is ScrollView scroll) - NativeElement = await (RenderOrchestrator = new WinUIScrollView(scroll)).Render(); - else if (View is BlurBox blurBox) NativeElement = new WinUIBlurBox(this, blurBox); - else NativeElement = new WinUICanvas(this, View); + NativeElement = await (RenderOrchestrator = new UWPScrollView(scroll)).Render(); + else if (View is BlurBox blurBox) NativeElement = new UWPBlurBox(this, blurBox); + else NativeElement = new UWPCanvas(this, View); } internal void Apply(string property, UIChangedEventArgs change) @@ -178,7 +178,7 @@ void OnLoaded() if (View.Panning.IsHandled() || View.Swiped.IsHandled()) { foreach (var item in View.GetAllParents().OfType()) - WinUIScrollView.EnableManual(item); + UWPScrollView.EnableManual(item); } View.RaiseShown(); diff --git a/Zebble/WinUI/Screen.cs b/Zebble/UWP/Screen.cs similarity index 92% rename from Zebble/WinUI/Screen.cs rename to Zebble/UWP/Screen.cs index 42ea891..b47cf96 100644 --- a/Zebble/WinUI/Screen.cs +++ b/Zebble/UWP/Screen.cs @@ -9,7 +9,7 @@ namespace Zebble.Device using Windows.Graphics.Imaging; using Windows.Storage.Streams; using Windows.UI.ViewManagement; - using Microsoft.UI.Xaml.Media.Imaging; + using Windows.UI.Xaml.Media.Imaging; using Olive; partial class Screen @@ -44,7 +44,7 @@ static void DoSetBackgroundColor() static void DoSetForegroundColor() { - Windows.UI.Color foreColor = default; + Windows.UI.Color foreColor; if (ForegroundColor != null) { @@ -57,6 +57,8 @@ static void DoSetForegroundColor() }; } + else foreColor = Windows.UI.Colors.Transparent; + // PC customization if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView")) { @@ -74,9 +76,15 @@ static void DoSetForegroundColor() } } - static void DoSetTransparency() { } + static void DoSetTransparency() + { + + } - static void DoSetVisibility() { } + static void DoSetVisibility() + { + + } static void DoSetHasLightContent() { } } @@ -89,7 +97,7 @@ static Screen() DisplayInformation.GetForCurrentView().OrientationChanged += (s, e) => OrientationChanged.SignalRaiseOn(Thread.Pool); - DarkMode = new UISettings().GetColorValue(UIColorType.Background) == Microsoft.UI.Colors.Black; + DarkMode = new UISettings().GetColorValue(UIColorType.Background) == Windows.UI.Colors.Black; } public static float HardwareDensity @@ -130,7 +138,7 @@ public static DeviceOrientation Orientation static async Task DoSaveAsImage(object inputNative) { var rtb = new RenderTargetBitmap(); - await rtb.RenderAsync((Microsoft.UI.Xaml.UIElement)inputNative); + await rtb.RenderAsync((Windows.UI.Xaml.UIElement)inputNative); var image = (await rtb.GetPixelsAsync()).ToArray(); using (var encoded = new InMemoryRandomAccessStream()) diff --git a/Zebble/WinUI/WinUI.UIRuntime.cs b/Zebble/UWP/UWP.UIRuntime.cs similarity index 95% rename from Zebble/WinUI/WinUI.UIRuntime.cs rename to Zebble/UWP/UWP.UIRuntime.cs index ce387ad..594ba8d 100644 --- a/Zebble/WinUI/WinUI.UIRuntime.cs +++ b/Zebble/UWP/UWP.UIRuntime.cs @@ -1,11 +1,12 @@ namespace Zebble { - using Microsoft.UI.Xaml; - using Olive; using System; using System.Collections.Generic; using System.ComponentModel; + using System.Reflection; using Windows.ApplicationModel.Activation; + using Windows.UI.Xaml; + using Olive; partial class UIRuntime { diff --git a/Zebble/WinUI/Utilities/Animation/WinUI.Animation.cs b/Zebble/UWP/Utilities/Animation/UWP.Animation.cs similarity index 98% rename from Zebble/WinUI/Utilities/Animation/WinUI.Animation.cs rename to Zebble/UWP/Utilities/Animation/UWP.Animation.cs index 70a5dfa..2402dfc 100644 --- a/Zebble/WinUI/Utilities/Animation/WinUI.Animation.cs +++ b/Zebble/UWP/Utilities/Animation/UWP.Animation.cs @@ -5,8 +5,8 @@ namespace Zebble using System.Linq; using System.Threading.Tasks; using Olive; - using Microsoft.UI.Xaml.Media.Animation; - using xaml = Microsoft.UI.Xaml; + using Windows.UI.Xaml.Media.Animation; + using xaml = Windows.UI.Xaml; partial class Animation { diff --git a/Zebble/WinUI/Utilities/Animation/ZebblePropertyAnimator.cs b/Zebble/UWP/Utilities/Animation/ZebblePropertyAnimator.cs similarity index 91% rename from Zebble/WinUI/Utilities/Animation/ZebblePropertyAnimator.cs rename to Zebble/UWP/Utilities/Animation/ZebblePropertyAnimator.cs index a7a8148..153c09c 100644 --- a/Zebble/WinUI/Utilities/Animation/ZebblePropertyAnimator.cs +++ b/Zebble/UWP/Utilities/Animation/ZebblePropertyAnimator.cs @@ -1,8 +1,8 @@ namespace Zebble { using System; - using Microsoft.UI.Xaml.Media.Animation; - using xaml = Microsoft.UI.Xaml; + using Windows.UI.Xaml.Media.Animation; + using xaml = Windows.UI.Xaml; internal class ZebblePropertyAnimator { diff --git a/Zebble/WinUI/Utilities/BaseApplication.cs b/Zebble/UWP/Utilities/BaseApplication.cs similarity index 87% rename from Zebble/WinUI/Utilities/BaseApplication.cs rename to Zebble/UWP/Utilities/BaseApplication.cs index d35f9c7..96f4630 100644 --- a/Zebble/WinUI/Utilities/BaseApplication.cs +++ b/Zebble/UWP/Utilities/BaseApplication.cs @@ -1,6 +1,5 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { - using Olive; using System; using System.Collections.Generic; using System.Linq; @@ -8,10 +7,10 @@ namespace Zebble.WinUI using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.UI.Core; - using Windows.ApplicationModel.Core; using Windows.UI.ViewManagement; - using controls = Microsoft.UI.Xaml.Controls; - using xaml = Microsoft.UI.Xaml; + using controls = Windows.UI.Xaml.Controls; + using xaml = Windows.UI.Xaml; + using Olive; public abstract partial class BaseApplication : xaml.Application { @@ -30,9 +29,9 @@ protected BaseApplication() { UIThread.UIThreadID = Environment.CurrentManagedThreadId; Windows.System.MemoryManager.AppMemoryUsageIncreased += MemoryManager_AppMemoryUsageIncreased; - CoreApplication.EnteredBackground += (_, __) => Device.App.RaiseWentIntoBackground(); - CoreApplication.LeavingBackground += (_, __) => Device.App.RaiseCameToForeground(); - CoreApplication.Suspending += OnSuspending; + EnteredBackground += (_, __) => Device.App.RaiseWentIntoBackground(); + LeavingBackground += (_, __) => Device.App.RaiseCameToForeground(); + Suspending += OnSuspending; } void MemoryManager_AppMemoryUsageIncreased(object sender, object eventArgs) @@ -45,7 +44,7 @@ void MemoryManager_AppMemoryUsageIncreased(object sender, object eventArgs) Device.App.RaiseReceivedMemoryWarning(); } - protected override async void OnLaunched(xaml.LaunchActivatedEventArgs args) + protected override async void OnLaunched(LaunchActivatedEventArgs args) { UIThread.Dispatcher = Window.Dispatcher; @@ -53,7 +52,7 @@ protected override async void OnLaunched(xaml.LaunchActivatedEventArgs args) await HandleArguments(args.Arguments); - if (args.UWPLaunchActivatedEventArgs.PreviousExecutionState == ApplicationExecutionState.Running) return; + if (args.PreviousExecutionState == ApplicationExecutionState.Running) return; Setup.Start(); @@ -69,7 +68,7 @@ protected override async void OnLaunched(xaml.LaunchActivatedEventArgs args) Window.SizeChanged += Window_SizeChanged; } - async void Window_SizeChanged(object sender, xaml.WindowSizeChangedEventArgs e) + async void Window_SizeChanged(object sender, WindowSizeChangedEventArgs e) { var myVersion = LastSizeChanged = LocalTime.UtcNow; await Task.Delay(1.Seconds()); @@ -244,16 +243,15 @@ void OnSuspending(object sender, SuspendingEventArgs args) deferral.Complete(); } - //protected override void OnActivated(IActivatedEventArgs args) - //{ - // if (args.Kind == ActivationKind.Launch) - // { - // var launchArgs = (LaunchActivatedEventArgs)args; - // HandleArguments(launchArgs.Arguments).GetAwaiter(); - // } - - // UIRuntime.OnActivated?.Raise(Tuple.Create(args, Window)); - //} + protected override void OnActivated(IActivatedEventArgs args) + { + if (args.Kind == ActivationKind.Launch) + { + var launchArgs = (LaunchActivatedEventArgs)args; + HandleArguments(launchArgs.Arguments).GetAwaiter(); + } + UIRuntime.OnActivated?.Raise(Tuple.Create(args, Window)); + } } } \ No newline at end of file diff --git a/Zebble/WinUI/Utilities/GaussianBlur.cs b/Zebble/UWP/Utilities/GaussianBlur.cs similarity index 100% rename from Zebble/WinUI/Utilities/GaussianBlur.cs rename to Zebble/UWP/Utilities/GaussianBlur.cs diff --git a/Zebble/WinUI/Utilities/Inspector.cs b/Zebble/UWP/Utilities/Inspector.cs similarity index 94% rename from Zebble/WinUI/Utilities/Inspector.cs rename to Zebble/UWP/Utilities/Inspector.cs index 5bd3a5b..7973048 100644 --- a/Zebble/WinUI/Utilities/Inspector.cs +++ b/Zebble/UWP/Utilities/Inspector.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel; using System.Threading.Tasks; -using Zebble.WinUI; +using Zebble.UWP; using Olive; namespace Zebble @@ -17,7 +17,7 @@ public static IInspector Inspector if (inspector != null) return inspector; try { - var type = Config.Get("Zebble.Inspector.Type", "Zebble.WinUI.Inspector, Zebble.Inspector"); + var type = Config.Get("Zebble.Inspector.Type", "Zebble.UWP.Inspector, Zebble.Inspector"); var inspectorType = Type.GetType(type); if (inspectorType is null) throw new RenderException("Type not found: " + type); inspector = inspectorType.CreateInstance() as IInspector; @@ -32,7 +32,7 @@ public static IInspector Inspector } } - namespace WinUI + namespace UWP { [EditorBrowsable(EditorBrowsableState.Never)] public interface IInspector diff --git a/Zebble/WinUI/Utilities/LiveCssWatcher.cs b/Zebble/UWP/Utilities/LiveCssWatcher.cs similarity index 99% rename from Zebble/WinUI/Utilities/LiveCssWatcher.cs rename to Zebble/UWP/Utilities/LiveCssWatcher.cs index 4785ae1..5d13d3c 100644 --- a/Zebble/WinUI/Utilities/LiveCssWatcher.cs +++ b/Zebble/UWP/Utilities/LiveCssWatcher.cs @@ -1,4 +1,4 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Diagnostics; diff --git a/Zebble/WinUI/Utilities/WinUI.Font.cs b/Zebble/UWP/Utilities/UWP.Font.cs similarity index 95% rename from Zebble/WinUI/Utilities/WinUI.Font.cs rename to Zebble/UWP/Utilities/UWP.Font.cs index d1cdbfb..5480a82 100644 --- a/Zebble/WinUI/Utilities/WinUI.Font.cs +++ b/Zebble/UWP/Utilities/UWP.Font.cs @@ -1,10 +1,10 @@ namespace Zebble { using System; - using Microsoft.UI.Text; - using Microsoft.UI.Xaml; - using Microsoft.UI.Xaml.Controls; - using Microsoft.UI.Xaml.Media; + using Windows.UI.Text; + using Windows.UI.Xaml; + using Windows.UI.Xaml.Controls; + using Windows.UI.Xaml.Media; using foundation = Windows.Foundation; using Olive; diff --git a/Zebble/WinUI/Utilities/WinUI.ImageService.cs b/Zebble/UWP/Utilities/UWP.ImageService.cs similarity index 99% rename from Zebble/WinUI/Utilities/WinUI.ImageService.cs rename to Zebble/UWP/Utilities/UWP.ImageService.cs index 157b7fe..6e78983 100644 --- a/Zebble/WinUI/Utilities/WinUI.ImageService.cs +++ b/Zebble/UWP/Utilities/UWP.ImageService.cs @@ -6,7 +6,7 @@ namespace Zebble.Services using System.Threading.Tasks; using Windows.Graphics.Imaging; using Windows.Storage.Streams; - using Microsoft.UI.Xaml.Media.Imaging; + using Windows.UI.Xaml.Media.Imaging; using Olive; partial class ImageService diff --git a/Zebble/WinUI/Utilities/WinUI.Setup.cs b/Zebble/UWP/Utilities/UWP.Setup.cs similarity index 87% rename from Zebble/WinUI/Utilities/WinUI.Setup.cs rename to Zebble/UWP/Utilities/UWP.Setup.cs index a70ecd4..5cd3e57 100644 --- a/Zebble/WinUI/Utilities/WinUI.Setup.cs +++ b/Zebble/UWP/Utilities/UWP.Setup.cs @@ -1,4 +1,4 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using Olive; @@ -13,7 +13,7 @@ public static void Start() { IsAddedToNativeParentOnce = true, Id = "RenderRoot", - CssClass = "winui-only" + CssClass = "uwp-only" }.Background(color: Colors.White); } } diff --git a/Zebble/WinUI/Utilities/WinUIGestureRecognizer.cs b/Zebble/UWP/Utilities/UWPGestureRecognizer.cs similarity index 98% rename from Zebble/WinUI/Utilities/WinUIGestureRecognizer.cs rename to Zebble/UWP/Utilities/UWPGestureRecognizer.cs index c084bbf..feb0e5f 100644 --- a/Zebble/WinUI/Utilities/WinUIGestureRecognizer.cs +++ b/Zebble/UWP/Utilities/UWPGestureRecognizer.cs @@ -1,4 +1,4 @@ -namespace Zebble.WinUI +namespace Zebble.UWP { using System; using System.Collections.Generic; @@ -6,11 +6,11 @@ namespace Zebble.WinUI using System.Threading.Tasks; using Windows.System; using Windows.UI.Core; - using Microsoft.UI.Xaml; - using Microsoft.UI.Xaml.Input; + using Windows.UI.Xaml; + using Windows.UI.Xaml.Input; using Olive; - class WinUIGestureRecognizer + class UWPGestureRecognizer { const int MOUSE_WHEEL_DELTA_DEGREES = 8 /*slow it down: */ * 2; readonly WeakReference ElementRef; @@ -25,7 +25,7 @@ class WinUIGestureRecognizer UIElement Element => ElementRef.GetTargetOrDefault(); View View => ViewRef.GetTargetOrDefault(); - public WinUIGestureRecognizer(UIElement element, View view) + public UWPGestureRecognizer(UIElement element, View view) { ElementRef = element.GetWeakReference(); ViewRef = view.GetWeakReference(); diff --git a/Zebble/WinUI/Utilities/WinUIRenderExtensions.cs b/Zebble/UWP/Utilities/UWPRenderExtensions.cs similarity index 98% rename from Zebble/WinUI/Utilities/WinUIRenderExtensions.cs rename to Zebble/UWP/Utilities/UWPRenderExtensions.cs index a2c3e07..4a8095b 100644 --- a/Zebble/WinUI/Utilities/WinUIRenderExtensions.cs +++ b/Zebble/UWP/Utilities/UWPRenderExtensions.cs @@ -1,8 +1,5 @@ namespace Zebble { - using Microsoft.UI.Text; - using Microsoft.UI.Xaml.Input; - using Olive; using System; using System.Collections.Generic; using System.IO; @@ -13,14 +10,16 @@ namespace Zebble using Windows.Storage.Streams; using Windows.System; using Windows.UI.Text; - using animation = Microsoft.UI.Xaml.Media.Animation; - using controls = Microsoft.UI.Xaml.Controls; + using Windows.UI.Xaml.Input; + using animation = Windows.UI.Xaml.Media.Animation; + using controls = Windows.UI.Xaml.Controls; using foundation = Windows.Foundation; - using media = Microsoft.UI.Xaml.Media; + using media = Windows.UI.Xaml.Media; using ui = Windows.UI; - using xaml = Microsoft.UI.Xaml; + using xaml = Windows.UI.Xaml; + using Olive; - public static class WinUIRenderExtensions + public static class UWPRenderExtensions { static readonly Dictionary BrushesCache = new(); diff --git a/Zebble/Zebble.csproj b/Zebble/Zebble.csproj index f1fdbc6..8c00888 100644 --- a/Zebble/Zebble.csproj +++ b/Zebble/Zebble.csproj @@ -1,107 +1,113 @@  - - net8.0;net8.0-android;net8.0-ios - $(TargetFrameworks);net8.0-windows10.0.19041 - Zebble - Zebble - Zebble - $(AssemblyName) ($(TargetFramework)) - 5.1.6.0 - true - en - 0618;0162 - $(DefineConstants) - false - false - latest - portable - https://nuget.org/packages/Zebble/ - http://zebble.net/ - https://dashboard.geeksltd.co.uk/content/ZebbleNuGetIcon.png - xamarin, windows, ios, android, zebble - Zebble for Xamarin - Zebble framework for cross platform Xamarin-based solutions. - Minor fixes - Geeks Ltd - Geeks Ltd - Geeks Ltd 2024, All rights reserved. - true - $(TargetDir)Zebble.xml - - - true - false - - - true - true - true - - - $(DefineConstants);WINUI - - - $(DefineConstants);ANDROID - false - - - $(DefineConstants);IOS - - - $(DefineConstants);NET80 - - - $(DefineConstants);MAUI - true - true - true - - - $(DefineConstants);MAUI_IOS - - - $(DefineConstants);MAUI_ANDROID - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net9.0;net9.0-android;net9.0-ios + $(TargetFrameworks);net9.0-windows10.0.26100.0 + Zebble + Zebble + Zebble + $(AssemblyName) ($(TargetFramework)) + 5.1.6.0 + true + en + 0618;0162 + $(DefineConstants) + false + false + latest + portable + https://nuget.org/packages/Zebble/ + http://zebble.net/ + https://dashboard.geeksltd.co.uk/content/ZebbleNuGetIcon.png + xamarin, windows, ios, android, zebble + Zebble for Xamarin + Zebble framework for cross platform Xamarin-based solutions. + Minor fixes + Geeks Ltd + Geeks Ltd + Geeks Ltd 2024, All rights reserved. + true + $(TargetDir)Zebble.xml + + + true + false + + + true + true + true + + + $(DefineConstants);UWP + true + + + $(DefineConstants);ANDROID + false + + + $(DefineConstants);IOS + + + $(DefineConstants);NET90 + + + $(DefineConstants);MAUI + true + true + true + + + $(DefineConstants);MAUI_IOS + + + $(DefineConstants);MAUI_ANDROID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From d008123b62f70debce592da26cc317bca5bcfadc Mon Sep 17 00:00:00 2001 From: Reza Talebi Date: Sat, 25 Jan 2025 18:06:09 +0330 Subject: [PATCH 2/6] update version --- Zebble/Zebble.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zebble/Zebble.csproj b/Zebble/Zebble.csproj index 8c00888..42e5795 100644 --- a/Zebble/Zebble.csproj +++ b/Zebble/Zebble.csproj @@ -6,7 +6,7 @@ Zebble Zebble $(AssemblyName) ($(TargetFramework)) - 5.1.6.0 + 5.1.7.0 true en 0618;0162 From 3190dab5771523c98c59e9be3352c1d6db7c9921 Mon Sep 17 00:00:00 2001 From: Reza Talebi Date: Sat, 25 Jan 2025 18:22:07 +0330 Subject: [PATCH 3/6] fix --- Zebble/Zebble.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zebble/Zebble.csproj b/Zebble/Zebble.csproj index 42e5795..d5fc0be 100644 --- a/Zebble/Zebble.csproj +++ b/Zebble/Zebble.csproj @@ -37,7 +37,7 @@ true true - + $(DefineConstants);UWP true From 0fb594d88f97d9f919a773d5a79b847b847689ef Mon Sep 17 00:00:00 2001 From: Reza Talebi Date: Sat, 25 Jan 2025 18:42:09 +0330 Subject: [PATCH 4/6] fix --- Zebble/Zebble.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zebble/Zebble.csproj b/Zebble/Zebble.csproj index d5fc0be..064b82f 100644 --- a/Zebble/Zebble.csproj +++ b/Zebble/Zebble.csproj @@ -1,7 +1,7 @@  net9.0;net9.0-android;net9.0-ios - $(TargetFrameworks);net9.0-windows10.0.26100.0 + $(TargetFrameworks);net9.0-windows10.0.26100 Zebble Zebble Zebble From 09204287091625983ba30d7b521d0f0d7793f24c Mon Sep 17 00:00:00 2001 From: Reza Talebi Date: Sun, 26 Jan 2025 23:55:18 +0330 Subject: [PATCH 5/6] Update --- Zebble/Zebble.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zebble/Zebble.csproj b/Zebble/Zebble.csproj index 064b82f..cfc542c 100644 --- a/Zebble/Zebble.csproj +++ b/Zebble/Zebble.csproj @@ -105,7 +105,7 @@ - + From 210c5fa85ea89eea88514a8b1da1a21d0b1c6045 Mon Sep 17 00:00:00 2001 From: Reza Talebi Date: Sat, 1 Feb 2025 01:38:29 +0330 Subject: [PATCH 6/6] Added uap support for backward compatibility --- Zebble/Zebble.csproj | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Zebble/Zebble.csproj b/Zebble/Zebble.csproj index cfc542c..771ef6e 100644 --- a/Zebble/Zebble.csproj +++ b/Zebble/Zebble.csproj @@ -1,7 +1,7 @@  net9.0;net9.0-android;net9.0-ios - $(TargetFrameworks);net9.0-windows10.0.26100 + $(TargetFrameworks);uap10.0.18362;net9.0-windows10.0.26100 Zebble Zebble Zebble @@ -37,6 +37,9 @@ true true + + $(DefineConstants);UWP + $(DefineConstants);UWP true @@ -63,13 +66,18 @@ $(DefineConstants);MAUI_ANDROID - + + + + + +