diff --git a/Core/Device/Screen.cs b/Core/Device/Screen.cs index c47a07a..014cb29 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 UWP +#if WINUI if (UIRuntime.IsDevMode && UIRuntime.Inspector.IsRotating) { Width = widthProvider(); @@ -172,7 +172,7 @@ internal static void UpdateLayout() Width = newWidth; Height = newHeight; -#if UWP +#if WINUI 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 2883a06..007dfb6 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 UWP - using BaseNativeType = Windows.UI.Xaml.FrameworkElement; +#elif WINUI + using BaseNativeType = Microsoft.UI.Xaml.FrameworkElement; #else using BaseNativeType = object; #endif diff --git a/Core/Native/Renderer.cs b/Core/Native/Renderer.cs index 920367e..c0666ea 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 UWP - using BaseNativeType = Windows.UI.Xaml.FrameworkElement; +#elif WINUI + using BaseNativeType = Microsoft.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 c24415d..f325086 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 UWP +#if WINUI 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 6012aea..06e61cf 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 UWP +#if WINUI 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 1ec6298..a762888 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 UWP - // .NET Native (UWP) and other forms of Native AOT compilers don't support GetReferencedAssemblies +#if WINUI + // .NET Native (WinUI) 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 4870607..6ec660d 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 UWP +#if WINUI 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 b34c7f3..f7fc8ce 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 UWP this can achived by setting SpellChecking. + /// Only needed for iOS. In Android and WinUI 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 99b9769..b7f9b6b 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 UWP +#if WINUI if (UIRuntime.IsDevMode) UIRuntime.Inspector.DomUpdated(view).RunInParallel(); #endif @@ -307,7 +307,7 @@ async Task DoAddToNativeParent() UIWorkBatch.Publish(this, "[ADD]", null); -#if UWP +#if WINUI 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 9c7e3c3..9f11ed5 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 UWP - return (float)Windows.UI.Xaml.Controls.Canvas.GetLeft((Windows.UI.Xaml.UIElement)native); +#if WINUI + return (float)Microsoft.UI.Xaml.Controls.Canvas.GetLeft((Microsoft.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 UWP - return (float)Windows.UI.Xaml.Controls.Canvas.GetTop((Windows.UI.Xaml.UIElement)native); +#if WINUI + return (float)Microsoft.UI.Xaml.Controls.Canvas.GetTop((Microsoft.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 182148f..885383d 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 UWP - public static Windows.UI.Xaml.FrameworkElement Native(this View view) => (Windows.UI.Xaml.FrameworkElement)view.Native; +#if WINUI + public static Microsoft.UI.Xaml.FrameworkElement Native(this View view) => (Microsoft.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 3965c63..ff9ccd5 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 || UWP +#if IOS || ANDROID || WINUI if (Thread.UI.IsRunning() && thread == Thread.Pool) return Task.CompletedTask; #endif diff --git a/Framework/Common/AssemblyInfo.cs b/Framework/Common/AssemblyInfo.cs index 0054521..b916679 100644 --- a/Framework/Common/AssemblyInfo.cs +++ b/Framework/Common/AssemblyInfo.cs @@ -11,7 +11,7 @@ public class AssemblyInfo { public static Assembly[] GetAssemblies() { -#if UWP +#if WINUI 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 6b2988a..d7ddc37 100644 --- a/Framework/Common/ZebbleConfiguration.cs +++ b/Framework/Common/ZebbleConfiguration.cs @@ -24,7 +24,7 @@ static IDictionary LoadValues() { try { -#if UWP || ANDROID || IOS +#if WINUI || 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 212cc8a..b5a0aff 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 UWP || IOS +#if WINUI || 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 5d5ffdb..5867be1 100644 --- a/Framework/Device/IO.cs +++ b/Framework/Device/IO.cs @@ -18,7 +18,7 @@ public static string DocumentsFolder { get { -#if UWP +#if WINUI return Windows.Storage.KnownFolders.DocumentsLibrary.Path; #else return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); @@ -34,7 +34,7 @@ public static string PersonalFolder { get { -#if UWP +#if WINUI 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 UWP +#if WINUI relative = relative.Replace("/", "\\"); #endif } diff --git a/Framework/Services/System/SuspendGC.cs b/Framework/Services/System/SuspendGC.cs index 3f26e19..4930cd3 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 UWP +#if WINUI GCSettings.LatencyMode = GCLatencyMode.LowLatency; #else GCSettings.LatencyMode = GCLatencyMode.NoGCRegion; diff --git a/Framework/UIRuntime.cs b/Framework/UIRuntime.cs index cbd45d1..d1223ec 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 !UWP +#if !WINUI return XamarinHost.CreateDefaultBuilder(); #else return Host.CreateDefaultBuilder(); diff --git a/Mvvm/RenderAbstractions/Template.cs b/Mvvm/RenderAbstractions/Template.cs index 0f6a945..cedfc07 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 UWP || ANDROID || IOS +#if WINUI || ANDROID || IOS View.SetViewModelValue(model); View.RefreshBindings(); #endif diff --git a/SharedApp/ThreadPool.cs b/SharedApp/ThreadPool.cs index d8515f4..d3b58b4 100644 --- a/SharedApp/ThreadPool.cs +++ b/SharedApp/ThreadPool.cs @@ -88,7 +88,7 @@ public override Task Run(Func> task) return task(); } -#if IOS || ANDROID || UWP +#if IOS || ANDROID || WINUI 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 42f0b23..486813c 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}}\") = \"UWP\", \"{token}Run\\UWP\\UWP.csproj\"", - newValue: $"Project(\"{{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}}\") = \"~UWP\", \"{token}Run\\UWP\\~UWP.csproj\"" + 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\"" ); solutionText = solutionText.Replace( @@ -175,11 +175,11 @@ static void FixSolutionSettings(FileInfo solution) var buildSettings = new List(); - var uwpGUID = "{51AEAFB7-E02B-4F51-8AB0-AA90E034E684}"; + var winuiGUID = "{51AEAFB7-E02B-4F51-8AB0-AA90E034E684}"; foreach (var platform in new[] { "Any CPU", "iPhone", "iPhoneSimulator" }) { - buildSettings.Add($"{uwpGUID}.Debug|{platform}.Build.0 = Debug|x86"); - buildSettings.Add($"{uwpGUID}.Debug|{platform}.Deploy.0 = Debug|x86"); + buildSettings.Add($"{winuiGUID}.Debug|{platform}.Build.0 = Debug|x86"); + buildSettings.Add($"{winuiGUID}.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 ff98d12..05e0616 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("UWP"); + MoveTo("WinUI"); } void RemoveOldFilesAndFolders() diff --git a/Zebble.Build/NavigationXml/NavXmlGenerator.cs b/Zebble.Build/NavigationXml/NavXmlGenerator.cs index 1bc124d..5e785ae 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.UWPObjFolder.FullName, "zebble-nav.xml").AsFile(); + _navXmlFile = Path.Combine(DirectoryContext.WinUIObjFolder.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 327a1ef..dc0953e 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 a323df1..e7f6248 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\\UWP\\fyioNew\\fyio.mobile" + "workingDirectory": "D:\\Geeks\\WinUI\\fyioNew\\fyio.mobile" } } } \ No newline at end of file diff --git a/Zebble.CompileZbl/Zebble.CompileZbl.csproj b/Zebble.CompileZbl/Zebble.CompileZbl.csproj index 2aa0d1e..c7b95ec 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 476be53..b4d5863 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\\UWP\\fyioNew\\fyio.mobile" + "workingDirectory": "D:\\Geeks\\WinUI\\fyioNew\\fyio.mobile" } } } \ No newline at end of file diff --git a/Zebble.Css/Zebble.Css.csproj b/Zebble.Css/Zebble.Css.csproj index 9c60114..87c325e 100644 --- a/Zebble.Css/Zebble.Css.csproj +++ b/Zebble.Css/Zebble.Css.csproj @@ -39,12 +39,12 @@ - - + + - - - + + + diff --git a/Zebble.FormatZbl/Zebble.FormatZbl.csproj b/Zebble.FormatZbl/Zebble.FormatZbl.csproj index 59397de..5bdd760 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 31b7f8a..54c64d2 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 - 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 - 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 - Android diff --git a/Zebble.Image/Zebble.Image.csproj b/Zebble.Image/Zebble.Image.csproj index 7726514..45a6605 100644 --- a/Zebble.Image/Zebble.Image.csproj +++ b/Zebble.Image/Zebble.Image.csproj @@ -37,8 +37,8 @@ - - + + diff --git a/Zebble.Schema/SchemaGenerator.cs b/Zebble.Schema/SchemaGenerator.cs index d805b0b..022f6d1 100644 --- a/Zebble.Schema/SchemaGenerator.cs +++ b/Zebble.Schema/SchemaGenerator.cs @@ -14,9 +14,9 @@ static class SchemaGenerator public static void Run() { - if (!DirectoryContext.UWPBinFolder.Exists() || DirectoryContext.UWPBinFolder.GetFiles("*.dll", SearchOption.AllDirectories).None()) + if (!DirectoryContext.WinUIBinFolder.Exists() || DirectoryContext.WinUIBinFolder.GetFiles("*.dll", SearchOption.AllDirectories).None()) { - Console.WriteLine("Skipped to update the xml schema as UWP is not compiled yet."); + Console.WriteLine("Skipped to update the xml schema as WinUI is not compiled yet."); return; } diff --git a/Zebble.Schema/TypeDetector.cs b/Zebble.Schema/TypeDetector.cs index 63db824..6e0bcd1 100644 --- a/Zebble.Schema/TypeDetector.cs +++ b/Zebble.Schema/TypeDetector.cs @@ -10,7 +10,7 @@ public class TypeDetector { - static DirectoryInfo AssembliesFolder => DirectoryContext.UWPBinFolder.GetSubDirectory("x86").GetSubDirectory("Debug"); + static DirectoryInfo AssembliesFolder => DirectoryContext.WinUIBinFolder.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 a75f9e1..26acbc3 100644 --- a/Zebble.Schema/Zebble.Schema.csproj +++ b/Zebble.Schema/Zebble.Schema.csproj @@ -37,7 +37,7 @@ - + diff --git a/Zebble.Tooling/Utilities/DirectoryContext.cs b/Zebble.Tooling/Utilities/DirectoryContext.cs index aa421a5..96669cf 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 UWPFolder => RunFolder.GetSubDirectory("UWP"); - public static DirectoryInfo UWPBinFolder => UWPFolder.GetSubDirectory("bin"); - public static DirectoryInfo UWPObjFolder => UWPFolder.GetSubDirectory("obj"); + public static DirectoryInfo WinUIFolder => RunFolder.GetSubDirectory("WinUI"); + public static DirectoryInfo WinUIBinFolder => WinUIFolder.GetSubDirectory("bin"); + public static DirectoryInfo WinUIObjFolder => WinUIFolder.GetSubDirectory("obj"); public static DirectoryInfo ViewModelFolder => RootFolder.GetSubDirectory("ViewModel"); public static DirectoryInfo[] Platforms => RunFolder.GetDirectories(); diff --git a/Zebble/UWP/Controls/UWPBlurBox.cs b/Zebble/WinUI/Controls/WinUIBlurBox.cs similarity index 82% rename from Zebble/UWP/Controls/UWPBlurBox.cs rename to Zebble/WinUI/Controls/WinUIBlurBox.cs index c49c96e..71c7690 100644 --- a/Zebble/UWP/Controls/UWPBlurBox.cs +++ b/Zebble/WinUI/Controls/WinUIBlurBox.cs @@ -1,8 +1,8 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { - public class UWPBlurBox : UWPCanvasBase + public class WinUIBlurBox : WinUICanvasBase { - public UWPBlurBox(Renderer renderer, BlurBox view) : base(renderer, view) + public WinUIBlurBox(Renderer renderer, BlurBox view) : base(renderer, view) { view.BlurredChanged.Handle(MaintainBlur); CreateBlur(); diff --git a/Zebble/UWP/Controls/UWPCanvas.cs b/Zebble/WinUI/Controls/WinUICanvas.cs similarity index 75% rename from Zebble/UWP/Controls/UWPCanvas.cs rename to Zebble/WinUI/Controls/WinUICanvas.cs index b30059f..792989b 100644 --- a/Zebble/UWP/Controls/UWPCanvas.cs +++ b/Zebble/WinUI/Controls/WinUICanvas.cs @@ -1,10 +1,10 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; - using controls = Windows.UI.Xaml.Controls; + using controls = Microsoft.UI.Xaml.Controls; using Olive; - public abstract class UWPCanvasBase : controls.Canvas, IDisposable, UIChangeCommand.IHandler where TView : View + public abstract class WinUICanvasBase : controls.Canvas, IDisposable, UIChangeCommand.IHandler where TView : View { readonly WeakReference RendererRef; readonly WeakReference ViewRef; @@ -12,7 +12,7 @@ public abstract class UWPCanvasBase : controls.Canvas, IDisposable, UICha protected bool IsDisposed; protected TView View => ViewRef?.GetTargetOrDefault(); - public UWPCanvasBase(Renderer renderer, TView view) + public WinUICanvasBase(Renderer renderer, TView view) { RendererRef = renderer.GetWeakReference(); ViewRef = view.GetWeakReference(); @@ -22,7 +22,7 @@ public UWPCanvasBase(Renderer renderer, TView view) protected void Configure() { HandleTouches(); - VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top; + VerticalAlignment = Microsoft.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 = Windows.UI.Xaml.Input.ManipulationModes.None; + ManipulationMode = Microsoft.UI.Xaml.Input.ManipulationModes.None; IsTapEnabled = false; IsHitTestVisible = false; } @@ -67,8 +67,8 @@ public virtual void Dispose() } } - public class UWPCanvas : UWPCanvasBase + public class WinUICanvas : WinUICanvasBase { - public UWPCanvas(Renderer renderer, View view) : base(renderer, view) { } + public WinUICanvas(Renderer renderer, View view) : base(renderer, view) { } } } \ No newline at end of file diff --git a/Zebble/UWP/Controls/UWPControlWrapper.cs b/Zebble/WinUI/Controls/WinUIControlWrapper.cs similarity index 95% rename from Zebble/UWP/Controls/UWPControlWrapper.cs rename to Zebble/WinUI/Controls/WinUIControlWrapper.cs index d5d8bbf..d1e5ea0 100644 --- a/Zebble/UWP/Controls/UWPControlWrapper.cs +++ b/Zebble/WinUI/Controls/WinUIControlWrapper.cs @@ -1,14 +1,14 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Linq; using System.Threading.Tasks; using Olive; - using Windows.UI.Xaml.Media; - using controls = Windows.UI.Xaml.Controls; - using xaml = Windows.UI.Xaml; + using Microsoft.UI.Xaml.Media; + using controls = Microsoft.UI.Xaml.Controls; + using xaml = Microsoft.UI.Xaml; - class UWPControlWrapper + class WinUIControlWrapper { WeakReference ViewRef; View View => ViewRef.GetTargetOrDefault(); @@ -17,7 +17,7 @@ class UWPControlWrapper controls.Grid BackgroundImageLayer; ImageView BackgroundImage; - public UWPControlWrapper(Renderer renderer) + public WinUIControlWrapper(Renderer renderer) { ViewRef = renderer.View.GetWeakReference(); Native = new controls.Border { Child = renderer.NativeElement }; @@ -26,7 +26,7 @@ public UWPControlWrapper(Renderer renderer) BorderRadiusChanged(); } - public Task Render() + public Task Render() { BackgroundChanged(UIChangedEventArgs.Empty); return Task.FromResult(this); diff --git a/Zebble/UWP/Controls/UWPImageView.cs b/Zebble/WinUI/Controls/WinUIImageView.cs similarity index 91% rename from Zebble/UWP/Controls/UWPImageView.cs rename to Zebble/WinUI/Controls/WinUIImageView.cs index 38474eb..e284357 100644 --- a/Zebble/UWP/Controls/UWPImageView.cs +++ b/Zebble/WinUI/Controls/WinUIImageView.cs @@ -1,19 +1,19 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Threading.Tasks; - using controls = Windows.UI.Xaml.Controls; - using media = Windows.UI.Xaml.Media; - using xaml = Windows.UI.Xaml; + using controls = Microsoft.UI.Xaml.Controls; + using media = Microsoft.UI.Xaml.Media; + using xaml = Microsoft.UI.Xaml; - class UWPImageView : IRenderOrchestrator + class WinUIImageView : IRenderOrchestrator { ImageView View; controls.Border Result; string LoadedImageKey; readonly EventHandlerDisposer EventHandlerDisposer = new(); - public UWPImageView(ImageView view) => View = view; + public WinUIImageView(ImageView view) => View = view; public async Task Render() { diff --git a/Zebble/UWP/Controls/UWPScrollView.ManualMode.cs b/Zebble/WinUI/Controls/WinUIScrollView.ManualMode.cs similarity index 90% rename from Zebble/UWP/Controls/UWPScrollView.ManualMode.cs rename to Zebble/WinUI/Controls/WinUIScrollView.ManualMode.cs index 33a0493..4516132 100644 --- a/Zebble/UWP/Controls/UWPScrollView.ManualMode.cs +++ b/Zebble/WinUI/Controls/WinUIScrollView.ManualMode.cs @@ -1,24 +1,24 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Collections.Generic; using System.Linq; - using controls = Windows.UI.Xaml.Controls; + using controls = Microsoft.UI.Xaml.Controls; using ScrollViewRef = System.WeakReference; - using UWPScrollViewRef = System.WeakReference; - using xaml = Windows.UI.Xaml; + using WinUIScrollViewRef = System.WeakReference; + using xaml = Microsoft.UI.Xaml; using Olive; - partial class UWPScrollView + partial class WinUIScrollView { xaml.Input.ManipulationDeltaRoutedEventArgs RunningInnertia; - internal static Dictionary Mappings = + internal static Dictionary Mappings = new(); public bool SupportsChildPanning; - static UWPScrollView GetFor(ScrollView scrollView) + static WinUIScrollView GetFor(ScrollView scrollView) { return Mappings .Where(x => x.Key.GetTargetOrDefault() == scrollView) diff --git a/Zebble/UWP/Controls/UWPScrollView.cs b/Zebble/WinUI/Controls/WinUIScrollView.cs similarity index 97% rename from Zebble/UWP/Controls/UWPScrollView.cs rename to Zebble/WinUI/Controls/WinUIScrollView.cs index 72dea63..c71a35a 100644 --- a/Zebble/UWP/Controls/UWPScrollView.cs +++ b/Zebble/WinUI/Controls/WinUIScrollView.cs @@ -1,12 +1,12 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Threading.Tasks; - using controls = Windows.UI.Xaml.Controls; - using xaml = Windows.UI.Xaml; + using controls = Microsoft.UI.Xaml.Controls; + using xaml = Microsoft.UI.Xaml; using Olive; - public partial class UWPScrollView : IRenderOrchestrator + public partial class WinUIScrollView : IRenderOrchestrator { const int GAP_UNIT = 30; const int REFRESHER_DURATION = 600; @@ -20,7 +20,7 @@ public partial class UWPScrollView : IRenderOrchestrator internal controls.StackPanel Container = new() { VerticalAlignment = xaml.VerticalAlignment.Top }; - public UWPScrollView(ScrollView view) + public WinUIScrollView(ScrollView view) { View = view; Mappings.Add(view.GetWeakReference(), this.GetWeakReference()); diff --git a/Zebble/UWP/Controls/UWPTextBlock.cs b/Zebble/WinUI/Controls/WinUITextBlock.cs similarity index 92% rename from Zebble/UWP/Controls/UWPTextBlock.cs rename to Zebble/WinUI/Controls/WinUITextBlock.cs index c9a40af..a4f75af 100644 --- a/Zebble/UWP/Controls/UWPTextBlock.cs +++ b/Zebble/WinUI/Controls/WinUITextBlock.cs @@ -1,16 +1,16 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Runtime.InteropServices; using System.Threading.Tasks; using Olive; - using Windows.UI.Text; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Media; - using controls = Windows.UI.Xaml.Controls; - using xaml = Windows.UI.Xaml; + using Microsoft.UI.Text; + using Microsoft.UI.Xaml; + using Microsoft.UI.Xaml.Media; + using controls = Microsoft.UI.Xaml.Controls; + using xaml = Microsoft.UI.Xaml; - public class UWPTextBlock : controls.Grid, UIChangeCommand.IHandler, INativeRenderer + public class WinUITextBlock : controls.Grid, UIChangeCommand.IHandler, INativeRenderer { WeakReference ViewRef; TextView View => ViewRef.GetTargetOrDefault(); @@ -19,7 +19,7 @@ public class UWPTextBlock : controls.Grid, UIChangeCommand.IHandler, INativeRend public Task Render(Renderer renderer) => Task.FromResult((FrameworkElement)this); - public UWPTextBlock(TextView view) + public WinUITextBlock(TextView view) { ViewRef = view.GetWeakReference(); Background = Colors.Transparent.RenderBrush(); // Without setting the background, the events won't fire diff --git a/Zebble/UWP/Controls/UWPTextBox.cs b/Zebble/WinUI/Controls/WinUITextBox.cs similarity index 94% rename from Zebble/UWP/Controls/UWPTextBox.cs rename to Zebble/WinUI/Controls/WinUITextBox.cs index dd05c61..6d5b33f 100644 --- a/Zebble/UWP/Controls/UWPTextBox.cs +++ b/Zebble/WinUI/Controls/WinUITextBox.cs @@ -1,15 +1,15 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Linq; using System.Threading.Tasks; using Olive; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Input; - using xaml = Windows.UI.Xaml; + using Microsoft.UI.Xaml; + using Microsoft.UI.Xaml.Controls; + using Microsoft.UI.Xaml.Input; + using xaml = Microsoft.UI.Xaml; - public abstract class UWPTextBoxBase : IRenderOrchestrator, UIChangeCommand.IHandler + public abstract class WinUITextBoxBase : IRenderOrchestrator, UIChangeCommand.IHandler where TResult : Control, new() { protected bool IsApiChangingText; @@ -17,7 +17,7 @@ public abstract class UWPTextBoxBase : IRenderOrchestrator, UIChangeCom protected TextInput View; protected TResult Result; - protected UWPTextBoxBase(Renderer renderer) + protected WinUITextBoxBase(Renderer renderer) { Renderer = renderer; View = renderer.View as TextInput; @@ -186,9 +186,9 @@ public virtual void Dispose() { } } - public class UWPTextBox : UWPTextBoxBase + public class WinUITextBox : WinUITextBoxBase { - public UWPTextBox(Renderer renderer) : base(renderer) { } + public WinUITextBox(Renderer renderer) : base(renderer) { } protected override void GenerateResult() { diff --git a/Zebble/UWP/Controls/UWPTextBoxPassword.cs b/Zebble/WinUI/Controls/WinUITextBoxPassword.cs similarity index 77% rename from Zebble/UWP/Controls/UWPTextBoxPassword.cs rename to Zebble/WinUI/Controls/WinUITextBoxPassword.cs index cbdf2db..47fae81 100644 --- a/Zebble/UWP/Controls/UWPTextBoxPassword.cs +++ b/Zebble/WinUI/Controls/WinUITextBoxPassword.cs @@ -1,12 +1,12 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; - using controls = Windows.UI.Xaml.Controls; + using controls = Microsoft.UI.Xaml.Controls; using Olive; - public class UWPPasswordBox : UWPTextBoxBase + public class WinUIPasswordBox : WinUITextBoxBase { - public UWPPasswordBox(Renderer renderer) : base(renderer) { } + public WinUIPasswordBox(Renderer renderer) : base(renderer) { } protected override void GenerateResult() { diff --git a/Zebble/UWP/Renderer.cs b/Zebble/WinUI/Renderer.cs similarity index 93% rename from Zebble/UWP/Renderer.cs rename to Zebble/WinUI/Renderer.cs index bacd5a8..69390c3 100644 --- a/Zebble/UWP/Renderer.cs +++ b/Zebble/WinUI/Renderer.cs @@ -3,17 +3,17 @@ namespace Zebble using System; using System.Linq; using System.Threading.Tasks; - using UWP; - using Windows.UI.Xaml.Media; - using controls = Windows.UI.Xaml.Controls; - using xaml = Windows.UI.Xaml; + using WinUI; + using Microsoft.UI.Xaml.Media; + using controls = Microsoft.UI.Xaml.Controls; + using xaml = Microsoft.UI.Xaml; using Olive; partial class Renderer { internal xaml.FrameworkElement NativeElement; - UWPControlWrapper ResultWrapper; - UWPGestureRecognizer GestureRecognizer; + WinUIControlWrapper ResultWrapper; + WinUIGestureRecognizer 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 UWPControlWrapper(this).Render(); + ResultWrapper = await new WinUIControlWrapper(this).Render(); View.Native = NativeResult; if (UIRuntime.IsDebuggerAttached) @@ -44,7 +44,7 @@ partial class Renderer NativeResult.Loaded += NativeResult_Loaded; if (View.HandlesGestures()) - GestureRecognizer = new UWPGestureRecognizer(NativeResult, View); + GestureRecognizer = new WinUIGestureRecognizer(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 UWPTextBlock(tv); + else if (View is TextView tv) NativeElement = new WinUITextBlock(tv); else if (View is TextInput input) { if (input.GetEffectiveTextMode() == TextMode.Password) - NativeElement = await (RenderOrchestrator = new UWPPasswordBox(this)).Render(); + NativeElement = await (RenderOrchestrator = new WinUIPasswordBox(this)).Render(); else - NativeElement = await (RenderOrchestrator = new UWPTextBox(this)).Render(); + NativeElement = await (RenderOrchestrator = new WinUITextBox(this)).Render(); } else if (View is ImageView image) - NativeElement = await (RenderOrchestrator = new UWPImageView(image)).Render(); + NativeElement = await (RenderOrchestrator = new WinUIImageView(image)).Render(); else if (View is ScrollView scroll) - NativeElement = await (RenderOrchestrator = new UWPScrollView(scroll)).Render(); - else if (View is BlurBox blurBox) NativeElement = new UWPBlurBox(this, blurBox); - else NativeElement = new UWPCanvas(this, View); + NativeElement = await (RenderOrchestrator = new WinUIScrollView(scroll)).Render(); + else if (View is BlurBox blurBox) NativeElement = new WinUIBlurBox(this, blurBox); + else NativeElement = new WinUICanvas(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()) - UWPScrollView.EnableManual(item); + WinUIScrollView.EnableManual(item); } View.RaiseShown(); diff --git a/Zebble/UWP/Screen.cs b/Zebble/WinUI/Screen.cs similarity index 68% rename from Zebble/UWP/Screen.cs rename to Zebble/WinUI/Screen.cs index 6f6f784..42ea891 100644 --- a/Zebble/UWP/Screen.cs +++ b/Zebble/WinUI/Screen.cs @@ -9,7 +9,7 @@ namespace Zebble.Device using Windows.Graphics.Imaging; using Windows.Storage.Streams; using Windows.UI.ViewManagement; - using Windows.UI.Xaml.Media.Imaging; + using Microsoft.UI.Xaml.Media.Imaging; using Olive; partial class Screen @@ -40,22 +40,11 @@ static void DoSetBackgroundColor() } } } - - // Mobile customization - if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) - { - var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); - if (statusBar != null) - { - if (backgroundColor != null) - statusBar.BackgroundColor = backgroundColor; - } - } } static void DoSetForegroundColor() { - Windows.UI.Color foreColor; + Windows.UI.Color foreColor = default; if (ForegroundColor != null) { @@ -83,48 +72,11 @@ static void DoSetForegroundColor() } } } - - // Mobile customization - if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) - { - var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); - if (statusBar != null) - { - if (foreColor != null) - statusBar.ForegroundColor = foreColor; - } - } } - static void DoSetTransparency() - { - // Mobile customization - if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) - { - var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); - if (statusBar != null) - { - if (IsTransparent) - statusBar.BackgroundOpacity = 0; - else - statusBar.BackgroundOpacity = 1; - } - } - } + static void DoSetTransparency() { } - static void DoSetVisibility() - { - // Mobile customization - if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) - { - var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView(); - if (statusBar != null) - { - if (IsVisible) statusBar.ShowAsync().GetResults(); - else statusBar.HideAsync().GetResults(); - } - } - } + static void DoSetVisibility() { } static void DoSetHasLightContent() { } } @@ -137,7 +89,7 @@ static Screen() DisplayInformation.GetForCurrentView().OrientationChanged += (s, e) => OrientationChanged.SignalRaiseOn(Thread.Pool); - DarkMode = new UISettings().GetColorValue(UIColorType.Background) == Windows.UI.Colors.Black; + DarkMode = new UISettings().GetColorValue(UIColorType.Background) == Microsoft.UI.Colors.Black; } public static float HardwareDensity @@ -178,7 +130,7 @@ public static DeviceOrientation Orientation static async Task DoSaveAsImage(object inputNative) { var rtb = new RenderTargetBitmap(); - await rtb.RenderAsync((Windows.UI.Xaml.UIElement)inputNative); + await rtb.RenderAsync((Microsoft.UI.Xaml.UIElement)inputNative); var image = (await rtb.GetPixelsAsync()).ToArray(); using (var encoded = new InMemoryRandomAccessStream()) diff --git a/Zebble/UWP/Utilities/Animation/UWP.Animation.cs b/Zebble/WinUI/Utilities/Animation/WinUI.Animation.cs similarity index 98% rename from Zebble/UWP/Utilities/Animation/UWP.Animation.cs rename to Zebble/WinUI/Utilities/Animation/WinUI.Animation.cs index 2402dfc..70a5dfa 100644 --- a/Zebble/UWP/Utilities/Animation/UWP.Animation.cs +++ b/Zebble/WinUI/Utilities/Animation/WinUI.Animation.cs @@ -5,8 +5,8 @@ namespace Zebble using System.Linq; using System.Threading.Tasks; using Olive; - using Windows.UI.Xaml.Media.Animation; - using xaml = Windows.UI.Xaml; + using Microsoft.UI.Xaml.Media.Animation; + using xaml = Microsoft.UI.Xaml; partial class Animation { diff --git a/Zebble/UWP/Utilities/Animation/ZebblePropertyAnimator.cs b/Zebble/WinUI/Utilities/Animation/ZebblePropertyAnimator.cs similarity index 91% rename from Zebble/UWP/Utilities/Animation/ZebblePropertyAnimator.cs rename to Zebble/WinUI/Utilities/Animation/ZebblePropertyAnimator.cs index 153c09c..a7a8148 100644 --- a/Zebble/UWP/Utilities/Animation/ZebblePropertyAnimator.cs +++ b/Zebble/WinUI/Utilities/Animation/ZebblePropertyAnimator.cs @@ -1,8 +1,8 @@ namespace Zebble { using System; - using Windows.UI.Xaml.Media.Animation; - using xaml = Windows.UI.Xaml; + using Microsoft.UI.Xaml.Media.Animation; + using xaml = Microsoft.UI.Xaml; internal class ZebblePropertyAnimator { diff --git a/Zebble/UWP/Utilities/BaseApplication.cs b/Zebble/WinUI/Utilities/BaseApplication.cs similarity index 87% rename from Zebble/UWP/Utilities/BaseApplication.cs rename to Zebble/WinUI/Utilities/BaseApplication.cs index 96f4630..d35f9c7 100644 --- a/Zebble/UWP/Utilities/BaseApplication.cs +++ b/Zebble/WinUI/Utilities/BaseApplication.cs @@ -1,5 +1,6 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { + using Olive; using System; using System.Collections.Generic; using System.Linq; @@ -7,10 +8,10 @@ namespace Zebble.UWP using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.UI.Core; + using Windows.ApplicationModel.Core; using Windows.UI.ViewManagement; - using controls = Windows.UI.Xaml.Controls; - using xaml = Windows.UI.Xaml; - using Olive; + using controls = Microsoft.UI.Xaml.Controls; + using xaml = Microsoft.UI.Xaml; public abstract partial class BaseApplication : xaml.Application { @@ -29,9 +30,9 @@ protected BaseApplication() { UIThread.UIThreadID = Environment.CurrentManagedThreadId; Windows.System.MemoryManager.AppMemoryUsageIncreased += MemoryManager_AppMemoryUsageIncreased; - EnteredBackground += (_, __) => Device.App.RaiseWentIntoBackground(); - LeavingBackground += (_, __) => Device.App.RaiseCameToForeground(); - Suspending += OnSuspending; + CoreApplication.EnteredBackground += (_, __) => Device.App.RaiseWentIntoBackground(); + CoreApplication.LeavingBackground += (_, __) => Device.App.RaiseCameToForeground(); + CoreApplication.Suspending += OnSuspending; } void MemoryManager_AppMemoryUsageIncreased(object sender, object eventArgs) @@ -44,7 +45,7 @@ void MemoryManager_AppMemoryUsageIncreased(object sender, object eventArgs) Device.App.RaiseReceivedMemoryWarning(); } - protected override async void OnLaunched(LaunchActivatedEventArgs args) + protected override async void OnLaunched(xaml.LaunchActivatedEventArgs args) { UIThread.Dispatcher = Window.Dispatcher; @@ -52,7 +53,7 @@ protected override async void OnLaunched(LaunchActivatedEventArgs args) await HandleArguments(args.Arguments); - if (args.PreviousExecutionState == ApplicationExecutionState.Running) return; + if (args.UWPLaunchActivatedEventArgs.PreviousExecutionState == ApplicationExecutionState.Running) return; Setup.Start(); @@ -68,7 +69,7 @@ protected override async void OnLaunched(LaunchActivatedEventArgs args) Window.SizeChanged += Window_SizeChanged; } - async void Window_SizeChanged(object sender, WindowSizeChangedEventArgs e) + async void Window_SizeChanged(object sender, xaml.WindowSizeChangedEventArgs e) { var myVersion = LastSizeChanged = LocalTime.UtcNow; await Task.Delay(1.Seconds()); @@ -243,15 +244,16 @@ 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(); - } + //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)); + //} - UIRuntime.OnActivated?.Raise(Tuple.Create(args, Window)); - } } } \ No newline at end of file diff --git a/Zebble/UWP/Utilities/GaussianBlur.cs b/Zebble/WinUI/Utilities/GaussianBlur.cs similarity index 100% rename from Zebble/UWP/Utilities/GaussianBlur.cs rename to Zebble/WinUI/Utilities/GaussianBlur.cs diff --git a/Zebble/UWP/Utilities/Inspector.cs b/Zebble/WinUI/Utilities/Inspector.cs similarity index 94% rename from Zebble/UWP/Utilities/Inspector.cs rename to Zebble/WinUI/Utilities/Inspector.cs index 7973048..5bd3a5b 100644 --- a/Zebble/UWP/Utilities/Inspector.cs +++ b/Zebble/WinUI/Utilities/Inspector.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel; using System.Threading.Tasks; -using Zebble.UWP; +using Zebble.WinUI; 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.UWP.Inspector, Zebble.Inspector"); + var type = Config.Get("Zebble.Inspector.Type", "Zebble.WinUI.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 UWP + namespace WinUI { [EditorBrowsable(EditorBrowsableState.Never)] public interface IInspector diff --git a/Zebble/UWP/Utilities/LiveCssWatcher.cs b/Zebble/WinUI/Utilities/LiveCssWatcher.cs similarity index 99% rename from Zebble/UWP/Utilities/LiveCssWatcher.cs rename to Zebble/WinUI/Utilities/LiveCssWatcher.cs index 5d13d3c..4785ae1 100644 --- a/Zebble/UWP/Utilities/LiveCssWatcher.cs +++ b/Zebble/WinUI/Utilities/LiveCssWatcher.cs @@ -1,4 +1,4 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Diagnostics; diff --git a/Zebble/UWP/Utilities/UWP.Font.cs b/Zebble/WinUI/Utilities/WinUI.Font.cs similarity index 95% rename from Zebble/UWP/Utilities/UWP.Font.cs rename to Zebble/WinUI/Utilities/WinUI.Font.cs index 5480a82..d1cdbfb 100644 --- a/Zebble/UWP/Utilities/UWP.Font.cs +++ b/Zebble/WinUI/Utilities/WinUI.Font.cs @@ -1,10 +1,10 @@ namespace Zebble { using System; - using Windows.UI.Text; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Controls; - using Windows.UI.Xaml.Media; + using Microsoft.UI.Text; + using Microsoft.UI.Xaml; + using Microsoft.UI.Xaml.Controls; + using Microsoft.UI.Xaml.Media; using foundation = Windows.Foundation; using Olive; diff --git a/Zebble/UWP/Utilities/UWP.ImageService.cs b/Zebble/WinUI/Utilities/WinUI.ImageService.cs similarity index 99% rename from Zebble/UWP/Utilities/UWP.ImageService.cs rename to Zebble/WinUI/Utilities/WinUI.ImageService.cs index 6e78983..157b7fe 100644 --- a/Zebble/UWP/Utilities/UWP.ImageService.cs +++ b/Zebble/WinUI/Utilities/WinUI.ImageService.cs @@ -6,7 +6,7 @@ namespace Zebble.Services using System.Threading.Tasks; using Windows.Graphics.Imaging; using Windows.Storage.Streams; - using Windows.UI.Xaml.Media.Imaging; + using Microsoft.UI.Xaml.Media.Imaging; using Olive; partial class ImageService diff --git a/Zebble/UWP/Utilities/UWP.Setup.cs b/Zebble/WinUI/Utilities/WinUI.Setup.cs similarity index 87% rename from Zebble/UWP/Utilities/UWP.Setup.cs rename to Zebble/WinUI/Utilities/WinUI.Setup.cs index 5cd3e57..a70ecd4 100644 --- a/Zebble/UWP/Utilities/UWP.Setup.cs +++ b/Zebble/WinUI/Utilities/WinUI.Setup.cs @@ -1,4 +1,4 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using Olive; @@ -13,7 +13,7 @@ public static void Start() { IsAddedToNativeParentOnce = true, Id = "RenderRoot", - CssClass = "uwp-only" + CssClass = "winui-only" }.Background(color: Colors.White); } } diff --git a/Zebble/UWP/Utilities/UWPGestureRecognizer.cs b/Zebble/WinUI/Utilities/WinUIGestureRecognizer.cs similarity index 98% rename from Zebble/UWP/Utilities/UWPGestureRecognizer.cs rename to Zebble/WinUI/Utilities/WinUIGestureRecognizer.cs index feb0e5f..c084bbf 100644 --- a/Zebble/UWP/Utilities/UWPGestureRecognizer.cs +++ b/Zebble/WinUI/Utilities/WinUIGestureRecognizer.cs @@ -1,4 +1,4 @@ -namespace Zebble.UWP +namespace Zebble.WinUI { using System; using System.Collections.Generic; @@ -6,11 +6,11 @@ namespace Zebble.UWP using System.Threading.Tasks; using Windows.System; using Windows.UI.Core; - using Windows.UI.Xaml; - using Windows.UI.Xaml.Input; + using Microsoft.UI.Xaml; + using Microsoft.UI.Xaml.Input; using Olive; - class UWPGestureRecognizer + class WinUIGestureRecognizer { const int MOUSE_WHEEL_DELTA_DEGREES = 8 /*slow it down: */ * 2; readonly WeakReference ElementRef; @@ -25,7 +25,7 @@ class UWPGestureRecognizer UIElement Element => ElementRef.GetTargetOrDefault(); View View => ViewRef.GetTargetOrDefault(); - public UWPGestureRecognizer(UIElement element, View view) + public WinUIGestureRecognizer(UIElement element, View view) { ElementRef = element.GetWeakReference(); ViewRef = view.GetWeakReference(); diff --git a/Zebble/UWP/Utilities/UWPRenderExtensions.cs b/Zebble/WinUI/Utilities/WinUIRenderExtensions.cs similarity index 98% rename from Zebble/UWP/Utilities/UWPRenderExtensions.cs rename to Zebble/WinUI/Utilities/WinUIRenderExtensions.cs index 4a8095b..a2c3e07 100644 --- a/Zebble/UWP/Utilities/UWPRenderExtensions.cs +++ b/Zebble/WinUI/Utilities/WinUIRenderExtensions.cs @@ -1,5 +1,8 @@ namespace Zebble { + using Microsoft.UI.Text; + using Microsoft.UI.Xaml.Input; + using Olive; using System; using System.Collections.Generic; using System.IO; @@ -10,16 +13,14 @@ namespace Zebble using Windows.Storage.Streams; using Windows.System; using Windows.UI.Text; - using Windows.UI.Xaml.Input; - using animation = Windows.UI.Xaml.Media.Animation; - using controls = Windows.UI.Xaml.Controls; + using animation = Microsoft.UI.Xaml.Media.Animation; + using controls = Microsoft.UI.Xaml.Controls; using foundation = Windows.Foundation; - using media = Windows.UI.Xaml.Media; + using media = Microsoft.UI.Xaml.Media; using ui = Windows.UI; - using xaml = Windows.UI.Xaml; - using Olive; + using xaml = Microsoft.UI.Xaml; - public static class UWPRenderExtensions + public static class WinUIRenderExtensions { static readonly Dictionary BrushesCache = new(); diff --git a/Zebble/UWP/UWP.UIRuntime.cs b/Zebble/WinUI/WinUI.UIRuntime.cs similarity index 95% rename from Zebble/UWP/UWP.UIRuntime.cs rename to Zebble/WinUI/WinUI.UIRuntime.cs index 594ba8d..ce387ad 100644 --- a/Zebble/UWP/UWP.UIRuntime.cs +++ b/Zebble/WinUI/WinUI.UIRuntime.cs @@ -1,12 +1,11 @@ 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/Zebble.csproj b/Zebble/Zebble.csproj index ddd848f..f627fac 100644 --- a/Zebble/Zebble.csproj +++ b/Zebble/Zebble.csproj @@ -1,13 +1,12 @@  net8.0;net8.0-android;net8.0-ios - $(TargetFrameworks);uap10.0.18362 - $(TargetFrameworks);net8.0-windows10.0.19041.0 + $(TargetFrameworks);net8.0-windows10.0.19041.0 Zebble Zebble Zebble $(AssemblyName) ($(TargetFramework)) - 5.0.63.0 + 5.1.0.0 true en 0618;0162 @@ -38,11 +37,8 @@ true true - - $(DefineConstants);UWP - - - $(DefineConstants);MAUI_Windows + + $(DefineConstants);WINUI $(DefineConstants);ANDROID @@ -66,19 +62,16 @@ $(DefineConstants);MAUI_ANDROID - - + + - - Windows Mobile Extensions for the UWP - - - - + + + @@ -87,11 +80,7 @@ - - - - - + @@ -100,10 +89,10 @@ - - - - + + + + @@ -115,4 +104,10 @@ + + + + + + \ No newline at end of file