Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Core/Device/Screen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static void ConfigureSize(Func<float> widthProvider, Func<float> heightPr
WidthProvider = widthProvider;
HeightProvider = heightProvider;

#if WINUI
#if UWP
if (UIRuntime.IsDevMode && UIRuntime.Inspector.IsRotating)
{
Width = widthProvider();
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Core/Native/NativeRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Core/Native/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Core/Services/Css/BatchUIChangeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion Core/Services/Css/CssEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions Core/Services/Css/InheritanceDepth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion Core/Services/LayoutTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Core/UI.Core/TextInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public SpellCheckingType SpellChecking
}

/// <summary>
/// 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.
/// </summary>
public AutoCorrectionType AutoCorrection
{
Expand Down
4 changes: 2 additions & 2 deletions Core/UI.Core/View.Hierarchy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions Core/UI.Core/View.Positioning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Core/UI.Core/ViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public static async Task<TView> MoveTo<TView>(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;
Expand Down
2 changes: 1 addition & 1 deletion Framework/Async/AsyncEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Framework/Common/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class AssemblyInfo
{
public static Assembly[] GetAssemblies()
{
#if WINUI
#if UWP
var assemblies = new List<Assembly>();
var files = Windows.ApplicationModel.Package.Current.InstalledLocation.GetFilesAsync().AsTask().AwaitResultWithoutContext();
if (files is null) return assemblies.ToArray();
Expand Down
2 changes: 1 addition & 1 deletion Framework/Common/ZebbleConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static IDictionary<string, string> 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);
Expand Down
2 changes: 1 addition & 1 deletion Framework/Common/ZebbleLogging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void Log<TState>(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);
Expand Down
6 changes: 3 additions & 3 deletions Framework/Device/IO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -92,7 +92,7 @@ public static string AbsolutePath(string relative)
else
{
relative = NormalizePath(relative);
#if WINUI
#if UWP
relative = relative.Replace("/", "\\");
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Framework/Services/System/SuspendGC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Framework/UIRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void Initialize<TAnyAppType>(string appName, Action<IHostBuilder>
}
static IHostBuilder CreateHostBuilder<T>() where T : class
{
#if !WINUI
#if !UWP
return XamarinHost.CreateDefaultBuilder<T>();
#else
return Host.CreateDefaultBuilder();
Expand Down
2 changes: 1 addition & 1 deletion Mvvm/RenderAbstractions/Template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion SharedApp/ThreadPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public override Task<TResult> Run<TResult>(Func<Task<TResult>> task)
return task();
}

#if IOS || ANDROID || WINUI
#if IOS || ANDROID || UWP
public override bool IsRunning() => !Thread.UI.IsRunning();
#else
public override bool IsRunning() => true;
Expand Down
10 changes: 5 additions & 5 deletions Zebble.Build/Common/SolutionFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -175,11 +175,11 @@ static void FixSolutionSettings(FileInfo solution)

var buildSettings = new List<string>();

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}";
Expand Down
2 changes: 1 addition & 1 deletion Zebble.Build/ConvertPlugin/PluginConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void MoveTo(string name)
MoveTo("Shared");
MoveTo("iOS");
MoveTo("Android");
MoveTo("WinUI");
MoveTo("UWP");
}

void RemoveOldFilesAndFolders()
Expand Down
2 changes: 1 addition & 1 deletion Zebble.Build/NavigationXml/NavXmlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}

Expand Down
2 changes: 1 addition & 1 deletion Zebble.Build/Zebble.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Olive" Version="2.1.380" />
<PackageReference Include="Olive" Version="2.1.384" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icon.png" Pack="true" PackagePath="" />
Expand Down
2 changes: 1 addition & 1 deletion Zebble.CompileZbl/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Zebble.CompileZbl": {
"commandName": "Project",
"workingDirectory": "D:\\Geeks\\WinUI\\fyioNew\\fyio.mobile"
"workingDirectory": "D:\\Geeks\\UWP\\fyioNew\\fyio.mobile"
}
}
}
4 changes: 2 additions & 2 deletions Zebble.CompileZbl/Zebble.CompileZbl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Olive" Version="2.1.380" />
<PackageReference Include="SkiaSharp" Version="3.0.0-preview.4.1" />
<PackageReference Include="Olive" Version="2.1.384" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\icon.png" Pack="true" PackagePath="" />
Expand Down
2 changes: 1 addition & 1 deletion Zebble.Css/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Zebble.Css": {
"commandName": "Project",
"commandLineArgs": "generate",
"workingDirectory": "D:\\Geeks\\WinUI\\fyioNew\\fyio.mobile"
"workingDirectory": "D:\\Geeks\\UWP\\fyioNew\\fyio.mobile"
}
}
}
4 changes: 2 additions & 2 deletions Zebble.Css/Zebble.Css.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<None Include="Resources\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Olive" Version="2.1.380" />
<PackageReference Include="SkiaSharp" Version="3.0.0-preview.4.1" />
<PackageReference Include="Olive" Version="2.1.384" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
<PackageReference Include="SourceMapToolkit" Version="1.1.4" />
<PackageReference Include="LibSassHost" Version="1.5.0" />
<PackageReference Include="LibSassHost.Native.osx-x64" Version="1.5.0" />
Expand Down
4 changes: 2 additions & 2 deletions Zebble.FormatZbl/Zebble.FormatZbl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<None Remove="README.md" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Olive" Version="2.1.380" />
<PackageReference Include="SkiaSharp" Version="3.0.0-preview.4.1" />
<PackageReference Include="Olive" Version="2.1.384" />
<PackageReference Include="SkiaSharp" Version="3.116.1" />
</ItemGroup>
<Import Project="..\Zebble.Tooling\Zebble.Tooling.projitems" Label="Shared" />
<Import Project="..\Abstractions\Abstractions.projitems" Label="Shared" />
Expand Down
Loading