diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 1943372b..bee9d004 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -393,7 +393,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- sample: [CPlusPlusWidgets, CPlusPlusWin32, CSharpAvalonia, CSharpWpf, NodeJSElectron, RustIced]
+ sample: [CPlusPlusWidgets, CPlusPlusWin32, CSharpAvalonia, CSharpUno, CSharpWpf, NodeJSElectron, RustIced]
os: [windows-latest, ubuntu-latest, macos-latest]
exclude:
- os: ubuntu-latest
diff --git a/samples/CSharpUno/.editorconfig b/samples/CSharpUno/.editorconfig
index b947be64..6376a9f8 100644
--- a/samples/CSharpUno/.editorconfig
+++ b/samples/CSharpUno/.editorconfig
@@ -9,11 +9,27 @@ root = true
##########################################
[*]
-indent_style = space
+indent_style = tab
end_of_line = crlf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
+dotnet_style_prefer_auto_properties = true:silent
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:silent
+dotnet_style_prefer_conditional_expression_over_return = true:silent
+dotnet_style_explicit_tuple_names = true:suggestion
+dotnet_style_prefer_inferred_tuple_names = true:suggestion
+dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
+dotnet_style_operator_placement_when_wrapping = beginning_of_line
+tab_width = 4
+indent_size = 4
+dotnet_style_prefer_compound_assignment = true:suggestion
##########################################
# File Extension Settings
@@ -31,40 +47,40 @@ indent_style = tab
indent_size = 2
[*.{csproj,proj,projitems,shproj}]
-indent_size = 2
+indent_size = 4
[*.{json,slnf}]
indent_size = 2
end_of_line = lf
[*.{props,targets}]
-indent_size = 2
+indent_size = 4
[*.xaml]
-indent_size = 2
+indent_size = 4
charset = utf-8-bom
[*.xml]
-indent_size = 2
+indent_size = 4
end_of_line = lf
[*.plist]
-indent_size = 2
+indent_size = 4
indent_style = tab
end_of_line = lf
[*.manifest]
-indent_size = 2
+indent_size = 4
[*.appxmanifest]
-indent_size = 2
+indent_size = 4
[*.{json,css,webmanifest}]
indent_size = 2
end_of_line = lf
[web.config]
-indent_size = 2
+indent_size = 4
end_of_line = lf
[*.sh]
@@ -165,3 +181,4 @@ csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
+csharp_prefer_system_threading_lock = true:suggestion
diff --git a/samples/CSharpUno/.gitignore b/samples/CSharpUno/.gitignore
index ef88c205..c9a4f514 100644
--- a/samples/CSharpUno/.gitignore
+++ b/samples/CSharpUno/.gitignore
@@ -82,6 +82,8 @@ StyleCopReport.xml
*.pgc
*.pgd
*.rsp
+# but not Directory.Build.rsp, as it configures directory-level build defaults
+!Directory.Build.rsp
*.sbr
*.tlb
*.tli
diff --git a/samples/CSharpUno/.run/Readme.md b/samples/CSharpUno/.run/Readme.md
new file mode 100644
index 00000000..6e72638a
--- /dev/null
+++ b/samples/CSharpUno/.run/Readme.md
@@ -0,0 +1,3 @@
+# About the `.run` folder
+
+This folder is present to add support for the [Rider IDE](https://aka.platform.uno/rider-getstarted). You can remove this folder safely if you're not using Rider.
diff --git a/samples/CSharpUno/.run/UnoSample.run.xml b/samples/CSharpUno/.run/UnoSample.run.xml
new file mode 100644
index 00000000..6bae33f6
--- /dev/null
+++ b/samples/CSharpUno/.run/UnoSample.run.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/CSharpUno/.vscode/launch.json b/samples/CSharpUno/.vscode/launch.json
index 87a59c21..fd154cad 100644
--- a/samples/CSharpUno/.vscode/launch.json
+++ b/samples/CSharpUno/.vscode/launch.json
@@ -4,23 +4,16 @@
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
- {
- "name": "Uno Platform Mobile",
- "type": "Uno",
- "request": "launch",
- // any Uno* task will do, this is simply to satisfy vscode requirement when a launch.json is present
- "preLaunchTask": "Uno: android | Debug | android-x64"
- },
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
- "name": "Uno Platform Desktop (Debug)",
+ "name": "Uno Platform Desktop Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-desktop",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/UnoSample/bin/Debug/net8.0-desktop/UnoSample.dll",
+ "program": "${workspaceFolder}/UnoSample/bin/Debug/net9.0-desktop/UnoSample.dll",
"args": [],
"launchSettingsProfile": "UnoSample (Desktop)",
"env": {
diff --git a/samples/CSharpUno/.vscode/settings.json b/samples/CSharpUno/.vscode/settings.json
index 23133fc7..3405922d 100644
--- a/samples/CSharpUno/.vscode/settings.json
+++ b/samples/CSharpUno/.vscode/settings.json
@@ -3,5 +3,8 @@
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"*.xaml": "$(capture).xaml.cs"
+ },
+ "files.associations": {
+ "global.json": "jsonc"
}
}
diff --git a/samples/CSharpUno/.vscode/tasks.json b/samples/CSharpUno/.vscode/tasks.json
index ff3537ca..8e8935dc 100644
--- a/samples/CSharpUno/.vscode/tasks.json
+++ b/samples/CSharpUno/.vscode/tasks.json
@@ -9,7 +9,7 @@
"build",
"${workspaceFolder}/UnoSample/UnoSample.csproj",
"/property:GenerateFullPaths=true",
- "/property:TargetFramework=net8.0-desktop",
+ "/property:TargetFramework=net9.0-desktop",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
@@ -22,7 +22,7 @@
"publish",
"${workspaceFolder}/UnoSample/UnoSample.csproj",
"/property:GenerateFullPaths=true",
- "/property:TargetFramework=net8.0-desktop",
+ "/property:TargetFramework=net9.0-desktop",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
diff --git a/samples/CSharpUno/.vsconfig b/samples/CSharpUno/.vsconfig
index 6cd65ee4..73997027 100644
--- a/samples/CSharpUno/.vsconfig
+++ b/samples/CSharpUno/.vsconfig
@@ -7,16 +7,10 @@
"Microsoft.NetCore.Component.DevelopmentTools",
"Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
"Microsoft.VisualStudio.Component.TextTemplating",
- "Microsoft.VisualStudio.Component.Windows10SDK.19041",
"Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging",
"Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
"Microsoft.VisualStudio.Component.Debugger.JustInTime",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
- "Microsoft.Component.NetFX.Native",
- "Microsoft.VisualStudio.Component.Graphics",
- "Microsoft.VisualStudio.Component.Merq",
- "Microsoft.VisualStudio.Component.MonoDebugger",
- "Microsoft.VisualStudio.ComponentGroup.Maui.All",
"Microsoft.VisualStudio.Workload.NetCrossPlat",
"Microsoft.VisualStudio.Workload.NetCoreTools"
]
diff --git a/samples/CSharpUno/Directory.Build.props b/samples/CSharpUno/Directory.Build.props
index c23d7362..8daf5692 100644
--- a/samples/CSharpUno/Directory.Build.props
+++ b/samples/CSharpUno/Directory.Build.props
@@ -12,12 +12,4 @@
-->
$(NoWarn);NU1507;NETSDK1201;PRI257
-
-
-
- 4.1.23
- 6.0.24
- 5.0.13
- 5.2.14
-
diff --git a/samples/CSharpUno/Directory.Build.targets b/samples/CSharpUno/Directory.Build.targets
index f75adf7e..14437118 100644
--- a/samples/CSharpUno/Directory.Build.targets
+++ b/samples/CSharpUno/Directory.Build.targets
@@ -1,2 +1,3 @@
-
+
+
diff --git a/samples/CSharpUno/Directory.Packages.props b/samples/CSharpUno/Directory.Packages.props
index 2dca56b2..e920b828 100644
--- a/samples/CSharpUno/Directory.Packages.props
+++ b/samples/CSharpUno/Directory.Packages.props
@@ -3,13 +3,9 @@
To update the version of Uno, you should instead update the Sdk version in the global.json file.
See https://aka.platform.uno/using-uno-sdk for more information.
+ See https://aka.platform.uno/using-uno-sdk#implicit-packages for more information regarding the Implicit Packages.
-->
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/samples/CSharpUno/README.md b/samples/CSharpUno/README.md
deleted file mode 100644
index 2dc09858..00000000
--- a/samples/CSharpUno/README.md
+++ /dev/null
@@ -1,39 +0,0 @@
-# Uno with Velopack
-
-This solution contains an Uno Desktop application that targets both Windows and macOS. Because Velopack does not currently support mobile or web platforms, those are not included.
-
-## Prerequisites
-This solution will publish the application out to the Velopack Flow service. To test the full publish you will need to create a [Velopack Flow account](https://app.velopack.io).
-
-The solution assumes that you have downloaded and installed the Velopack CLI (`vpk`) global tool. This tool can be installed by running `dotnet tool install -g vpk`.
-You will need to authenticate with the Velopack Flow service by running `vpk login` and signing in with your Velopack Flow account.
-
-## The Application
-`Presentation/MainPage.xaml` contains the main UI for viewing the current version, checking for updates, and applying the latest update.
-The `MainViewModel.cs` contains the logic for checking for updates and applying them. The key piece of the setup is the initialization of the `UpdateManager` with the `VelopackFlowUpdateSource` which provides the interaction with the Velopack Flow service.
-
-The `App.xaml.cs` has been updated to contain the [Velopack application startup hook](https://docs.velopack.io/integrating/overview).
-
-### Updating the Project file
-There are two properties to set in the `csproj` file to enable the Velopack Flow integration. These are:
-```xml
-true
-Velopack.UnoSample
-```
-
-`VelopackPackId` is the unique identifier for the application. This is used to identify the application in the Velopack Flow service. It must be unique among all applications.You **MUST** change this to be your own application identifier.
-`VelopackPushOnPublish` is a boolean value that determines if the application should be pushed to the Velopack Flow service when it is published. This should be set to `true` to enable the integration.
-
-### Building installers
-To build the local installers run the following command replacing `` with the desired version number.
-The `-f` option is used to specify the target framework. Because each target platform should result in a different build, you likely will want to specify a different Velopack channel for each target platform. By default, it will default to your target OS. You can specify the channel by adding `-p:VelopackChannel=` to the command.
-
-This can be any of the desktop frameworks specified in the `csproj` file.
-```bash
-dotnet publish -c Release -f net8.0-desktop -p:VelopackChannel= -p:Version=
-```
-
-For example:
-```bash
-dotnet publish -c Release -f net8.0-desktop -p:VelopackChannel=win-desktop -p:Version=1.0.5
-```
diff --git a/samples/CSharpUno/UnoSample.sln b/samples/CSharpUno/UnoSample.sln
index 787f438b..c1d6a7fd 100644
--- a/samples/CSharpUno/UnoSample.sln
+++ b/samples/CSharpUno/UnoSample.sln
@@ -1,17 +1,18 @@
+
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.11.34929.205
+VisualStudioVersion = 17.13.35913.81 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoSample", "UnoSample\UnoSample.csproj", "{F9ACED52-AE70-46F6-8C7C-2EF629084661}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnoSample", "UnoSample\UnoSample.csproj", "{6BF41A07-4B32-447E-96AB-5437C3564AFD}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{29980CC9-DC41-4944-966D-F088C84D1C7B}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
global.json = global.json
- README.md = README.md
EndProjectSection
EndProject
Global
@@ -20,15 +21,17 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {F9ACED52-AE70-46F6-8C7C-2EF629084661}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F9ACED52-AE70-46F6-8C7C-2EF629084661}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F9ACED52-AE70-46F6-8C7C-2EF629084661}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F9ACED52-AE70-46F6-8C7C-2EF629084661}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6BF41A07-4B32-447E-96AB-5437C3564AFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6BF41A07-4B32-447E-96AB-5437C3564AFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6BF41A07-4B32-447E-96AB-5437C3564AFD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {6BF41A07-4B32-447E-96AB-5437C3564AFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6BF41A07-4B32-447E-96AB-5437C3564AFD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6BF41A07-4B32-447E-96AB-5437C3564AFD}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {2FA3FC94-E895-443E-AAA8-9A7F956F9E92}
+ SolutionGuid = {800ACAFE-BC3B-4646-9989-C59A522D41E4}
EndGlobalSection
EndGlobal
diff --git a/samples/CSharpUno/UnoSample/App.xaml b/samples/CSharpUno/UnoSample/App.xaml
index d4a63169..b05f9cc9 100644
--- a/samples/CSharpUno/UnoSample/App.xaml
+++ b/samples/CSharpUno/UnoSample/App.xaml
@@ -1,28 +1,17 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
diff --git a/samples/CSharpUno/UnoSample/App.xaml.cs b/samples/CSharpUno/UnoSample/App.xaml.cs
index 26a1a4ae..82f62561 100644
--- a/samples/CSharpUno/UnoSample/App.xaml.cs
+++ b/samples/CSharpUno/UnoSample/App.xaml.cs
@@ -4,113 +4,130 @@ using Velopack;
namespace UnoSample;
public partial class App : Application
{
- ///
- /// Initializes the singleton application object. This is the first line of authored code
- /// executed, and as such is the logical equivalent of main() or WinMain().
- ///
- public App()
- {
- // It's important to Run() the VelopackApp as early as possible in app startup.
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
+ {
+ // It's important to Run() the VelopackApp as early as possible in app startup.
VelopackApp.Build()
.WithFirstRun((v) => { /* Your first run code here */ })
.Run();
- this.InitializeComponent();
- }
+ this.InitializeComponent();
+ }
- protected Window? MainWindow { get; private set; }
- protected IHost? Host { get; private set; }
+ protected Window? MainWindow { get; private set; }
- protected async override void OnLaunched(LaunchActivatedEventArgs args)
- {
- var builder = this.CreateBuilder(args)
- // Add navigation support for toolkit controls such as TabBar and NavigationView
- .UseToolkitNavigation()
- .Configure(host => host
+ protected override void OnLaunched(LaunchActivatedEventArgs args)
+ {
+ MainWindow = new Window();
#if DEBUG
- // Switch to Development environment when running in DEBUG
- .UseEnvironment(Environments.Development)
+ MainWindow.UseStudio();
#endif
- .UseLogging(configure: (context, logBuilder) =>
- {
- // Configure log levels for different categories of logging
- logBuilder
- .SetMinimumLevel(
- context.HostingEnvironment.IsDevelopment() ?
- LogLevel.Information :
- LogLevel.Warning)
- // Default filters for core Uno Platform namespaces
- .CoreLogLevel(LogLevel.Warning);
- // Uno Platform namespace filter groups
- // Uncomment individual methods to see more detailed logging
- //// Generic Xaml events
- //logBuilder.XamlLogLevel(LogLevel.Debug);
- //// Layout specific messages
- //logBuilder.XamlLayoutLogLevel(LogLevel.Debug);
- //// Storage messages
- //logBuilder.StorageLogLevel(LogLevel.Debug);
- //// Binding related messages
- //logBuilder.XamlBindingLogLevel(LogLevel.Debug);
- //// Binder memory references tracking
- //logBuilder.BinderMemoryReferenceLogLevel(LogLevel.Debug);
- //// DevServer and HotReload related
- //logBuilder.HotReloadCoreLogLevel(LogLevel.Information);
- //// Debug JS interop
- //logBuilder.WebAssemblyLogLevel(LogLevel.Debug);
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (MainWindow.Content is not Frame rootFrame)
+ {
+ // Create a Frame to act as the navigation context and navigate to the first page
+ rootFrame = new Frame();
- }, enableUnoLogging: true)
- .UseConfiguration(configure: configBuilder =>
- configBuilder
- .EmbeddedSource()
- .Section()
- )
- // Enable localization (see appsettings.json for supported languages)
- .UseLocalization()
- // Register Json serializers (ISerializer and ISerializer)
- .UseSerialization((context, services) => services
- .AddContentSerializer(context)
- .AddJsonTypeInfo(WeatherForecastContext.Default.IImmutableListWeatherForecast))
- .UseHttp((context, services) => services
- // Register HttpClient
+ // Place the frame in the current Window
+ MainWindow.Content = rootFrame;
+
+ rootFrame.NavigationFailed += OnNavigationFailed;
+ }
+
+ if (rootFrame.Content == null)
+ {
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame.Navigate(typeof(MainPage), args.Arguments);
+ }
+
+ MainWindow.SetWindowIcon();
+ // Ensure the current window is active
+ MainWindow.Activate();
+ }
+
+ ///
+ /// Invoked when Navigation to a certain page fails
+ ///
+ /// The Frame which failed navigation
+ /// Details about the navigation failure
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ throw new InvalidOperationException($"Failed to load {e.SourcePageType.FullName}: {e.Exception}");
+ }
+
+ ///
+ /// Configures global Uno Platform logging
+ ///
+ public static void InitializeLogging()
+ {
#if DEBUG
- // DelegatingHandler will be automatically injected into Refit Client
- .AddTransient()
+ // Logging is disabled by default for release builds, as it incurs a significant
+ // initialization cost from Microsoft.Extensions.Logging setup. If startup performance
+ // is a concern for your application, keep this disabled. If you're running on the web or
+ // desktop targets, you can use URL or command line parameters to enable it.
+ //
+ // For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html
+
+ var factory = LoggerFactory.Create(builder =>
+ {
+#if __WASM__
+ builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider());
+#elif __IOS__ || __MACCATALYST__
+ builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider());
+#else
+ builder.AddConsole();
#endif
- .AddSingleton()
- .AddRefitClient(context))
- .ConfigureServices((context, services) =>
- {
- // TODO: Register your services
- //services.AddSingleton();
- })
- .UseNavigation(RegisterRoutes)
- );
- MainWindow = builder.Window;
-#if DEBUG
- MainWindow.EnableHotReload();
+ // Exclude logs below this level
+ builder.SetMinimumLevel(LogLevel.Information);
+
+ // Default filters for Uno Platform namespaces
+ builder.AddFilter("Uno", LogLevel.Warning);
+ builder.AddFilter("Windows", LogLevel.Warning);
+ builder.AddFilter("Microsoft", LogLevel.Warning);
+
+ // Generic Xaml events
+ // builder.AddFilter("Microsoft.UI.Xaml", LogLevel.Debug );
+ // builder.AddFilter("Microsoft.UI.Xaml.VisualStateGroup", LogLevel.Debug );
+ // builder.AddFilter("Microsoft.UI.Xaml.StateTriggerBase", LogLevel.Debug );
+ // builder.AddFilter("Microsoft.UI.Xaml.UIElement", LogLevel.Debug );
+ // builder.AddFilter("Microsoft.UI.Xaml.FrameworkElement", LogLevel.Trace );
+
+ // Layouter specific messages
+ // builder.AddFilter("Microsoft.UI.Xaml.Controls", LogLevel.Debug );
+ // builder.AddFilter("Microsoft.UI.Xaml.Controls.Layouter", LogLevel.Debug );
+ // builder.AddFilter("Microsoft.UI.Xaml.Controls.Panel", LogLevel.Debug );
+
+ // builder.AddFilter("Windows.Storage", LogLevel.Debug );
+
+ // Binding related messages
+ // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug );
+ // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug );
+
+ // Binder memory references tracking
+ // builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug );
+
+ // DevServer and HotReload related
+ // builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information);
+
+ // Debug JS interop
+ // builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug );
+ });
+
+ global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory;
+
+#if HAS_UNO
+ global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize();
#endif
- MainWindow.SetWindowIcon();
-
- Host = await builder.NavigateAsync();
- }
-
- private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
- {
- views.Register(
- new ViewMap(ViewModel: typeof(ShellViewModel)),
- new ViewMap()
- );
-
- routes.Register(
- new RouteMap("", View: views.FindByViewModel(),
- Nested:
- [
- new ("Main", View: views.FindByViewModel())
- ]
- )
- );
- }
+#endif
+ }
}
diff --git a/samples/CSharpUno/UnoSample/Assets/Images/back.svg b/samples/CSharpUno/UnoSample/Assets/Images/back.svg
deleted file mode 100644
index bcd7851b..00000000
--- a/samples/CSharpUno/UnoSample/Assets/Images/back.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/samples/CSharpUno/UnoSample/GlobalUsings.cs b/samples/CSharpUno/UnoSample/GlobalUsings.cs
index c93bf566..06613b25 100644
--- a/samples/CSharpUno/UnoSample/GlobalUsings.cs
+++ b/samples/CSharpUno/UnoSample/GlobalUsings.cs
@@ -1,15 +1,3 @@
-global using System.Collections.Immutable;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
-global using Microsoft.Extensions.DependencyInjection;
-global using Microsoft.Extensions.Hosting;
-global using Microsoft.Extensions.Localization;
global using Microsoft.Extensions.Logging;
-global using Microsoft.Extensions.Options;
-global using UnoSample.DataContracts;
-global using UnoSample.DataContracts.Serialization;
-global using UnoSample.Models;
-global using UnoSample.Presentation;
-global using UnoSample.Services.Caching;
-global using UnoSample.Services.Endpoints;
-global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
diff --git a/samples/CSharpUno/UnoSample/MainPage.xaml b/samples/CSharpUno/UnoSample/MainPage.xaml
new file mode 100644
index 00000000..9167117a
--- /dev/null
+++ b/samples/CSharpUno/UnoSample/MainPage.xaml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/CSharpUno/UnoSample/MainPage.xaml.cs b/samples/CSharpUno/UnoSample/MainPage.xaml.cs
new file mode 100644
index 00000000..d7767433
--- /dev/null
+++ b/samples/CSharpUno/UnoSample/MainPage.xaml.cs
@@ -0,0 +1,15 @@
+namespace UnoSample;
+
+public sealed partial class MainPage : Page
+{
+ public MainViewModel ViewModel { get; } = new MainViewModel();
+
+ public bool NotInstalled => ViewModel.IsInstalled != true;
+
+ public MainPage()
+ {
+ this.InitializeComponent();
+
+ this.DataContext = ViewModel;
+ }
+}
diff --git a/samples/CSharpUno/UnoSample/MainViewModel.cs b/samples/CSharpUno/UnoSample/MainViewModel.cs
new file mode 100644
index 00000000..392e48ce
--- /dev/null
+++ b/samples/CSharpUno/UnoSample/MainViewModel.cs
@@ -0,0 +1,65 @@
+using Velopack;
+
+namespace UnoSample;
+
+public partial class MainViewModel : ObservableObject
+{
+ private readonly UpdateManager _updateManager;
+
+ public bool IsInstalled => _updateManager.IsInstalled;
+
+ [ObservableProperty]
+ [NotifyPropertyChangedFor(nameof(HasUpdate))]
+ private UpdateInfo? _latestUpdate;
+
+ public bool HasUpdate => LatestUpdate != null;
+
+ public string CurrentVersion => _updateManager.CurrentVersion?.ToFullString() ?? "";
+
+ [ObservableProperty]
+ private string? _status;
+
+ public MainViewModel()
+ {
+ var updateUrl = SampleHelper.GetReleasesDir(); // replace with your update path/url
+ _updateManager = new UpdateManager(updateUrl!);
+ }
+
+ [RelayCommand(CanExecute = nameof(IsInstalled))]
+ private async Task CheckForUpdates()
+ {
+ if (_updateManager.IsInstalled)
+ {
+ try
+ {
+ Status = "Checking for updates...";
+ LatestUpdate = await _updateManager.CheckForUpdatesAsync();
+ Status = LatestUpdate is null ? "No updates available" : $"{LatestUpdate.TargetFullRelease.Version} - Update available";
+ }
+ catch (Exception ex)
+ {
+ Status = ex.Message;
+ }
+ }
+ }
+
+ [RelayCommand(CanExecute = nameof(IsInstalled))]
+ private async Task DownloadUpdates()
+ {
+ if (_updateManager.IsInstalled && LatestUpdate is { } latestUpdate)
+ {
+ try
+ {
+ Status = $"Downloading {0:p}";
+
+ await _updateManager.DownloadUpdatesAsync(latestUpdate, progress => Status = $"Downloading {progress / 100.0:p}");
+ Status = "Restarting...";
+ _updateManager.ApplyUpdatesAndRestart(latestUpdate.TargetFullRelease);
+ }
+ catch (Exception ex)
+ {
+ Status = ex.Message;
+ }
+ }
+ }
+}
diff --git a/samples/CSharpUno/UnoSample/Models/AppConfig.cs b/samples/CSharpUno/UnoSample/Models/AppConfig.cs
deleted file mode 100644
index 603e2405..00000000
--- a/samples/CSharpUno/UnoSample/Models/AppConfig.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace UnoSample.Models;
-
-public record AppConfig
-{
- public string? Environment { get; init; }
-}
diff --git a/samples/CSharpUno/UnoSample/Models/Entity.cs b/samples/CSharpUno/UnoSample/Models/Entity.cs
deleted file mode 100644
index ee8bb3bf..00000000
--- a/samples/CSharpUno/UnoSample/Models/Entity.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace UnoSample.Models;
-
-public record Entity(string Name);
diff --git a/samples/CSharpUno/UnoSample/Models/WeatherForecast.cs b/samples/CSharpUno/UnoSample/Models/WeatherForecast.cs
deleted file mode 100644
index 9869b1dd..00000000
--- a/samples/CSharpUno/UnoSample/Models/WeatherForecast.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace UnoSample.DataContracts;
-
-///
-/// A Weather Forecast for a specific date
-///
-/// Gets the Date of the Forecast.
-/// Gets the Forecast Temperature in Celsius.
-/// Get a description of how the weather will feel.
-public record WeatherForecast(DateOnly Date, double TemperatureC, string? Summary)
-{
- ///
- /// Gets the Forecast Temperature in Fahrenheit
- ///
- public double TemperatureF => 32 + (TemperatureC * 9 / 5);
-}
diff --git a/samples/CSharpUno/UnoSample/Package.appxmanifest b/samples/CSharpUno/UnoSample/Package.appxmanifest
index 656dc6f5..9ef38146 100644
--- a/samples/CSharpUno/UnoSample/Package.appxmanifest
+++ b/samples/CSharpUno/UnoSample/Package.appxmanifest
@@ -1,20 +1,12 @@
-
-
+
-
-
-
- UnoSample
- UnoSample
-
+
+
@@ -29,11 +21,7 @@
-
-
-
+
diff --git a/samples/CSharpUno/UnoSample/Platforms/Desktop/Program.cs b/samples/CSharpUno/UnoSample/Platforms/Desktop/Program.cs
index 37959b14..be15d7ad 100644
--- a/samples/CSharpUno/UnoSample/Platforms/Desktop/Program.cs
+++ b/samples/CSharpUno/UnoSample/Platforms/Desktop/Program.cs
@@ -3,21 +3,19 @@ using Uno.UI.Runtime.Skia;
namespace UnoSample;
public class Program
{
- [STAThread]
- public static void Main(string[] args)
- {
-#if (!useDependencyInjection && useLoggingFallback)
- App.InitializeLogging();
+ [STAThread]
+ public static void Main(string[] args)
+ {
+ App.InitializeLogging();
-#endif
- var host = SkiaHostBuilder.Create()
- .App(() => new App())
- .UseX11()
- .UseLinuxFrameBuffer()
- .UseMacOS()
- .UseWindows()
- .Build();
+ var host = SkiaHostBuilder.Create()
+ .App(() => new App())
+ .UseX11()
+ .UseLinuxFrameBuffer()
+ .UseMacOS()
+ .UseWindows()
+ .Build();
- host.Run();
- }
+ host.Run();
+ }
}
diff --git a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Entitlements.plist b/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Entitlements.plist
deleted file mode 100644
index 24c31036..00000000
--- a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Entitlements.plist
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Info.plist b/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Info.plist
deleted file mode 100644
index 1bb02ddc..00000000
--- a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Info.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- UIDeviceFamily
-
- 2
-
- LSApplicationCategoryType
- public.app-category.utilities
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- XSAppIconAssets
- Assets.xcassets/icon.appiconset
-
-
-
-
diff --git a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Main.maccatalyst.cs b/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Main.maccatalyst.cs
deleted file mode 100644
index 32579dc0..00000000
--- a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Main.maccatalyst.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using UIKit;
-
-namespace UnoSample.MacCatalyst;
-public class EntryPoint
-{
- // This is the main entry point of the application.
- public static void Main(string[] args)
- {
- // if you want to use a different Application Delegate class from "AppDelegate"
- // you can specify it here.
- UIApplication.Main(args, null, typeof(App));
- }
-}
diff --git a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json b/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json
deleted file mode 100644
index 69555e44..00000000
--- a/samples/CSharpUno/UnoSample/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "images": [
- {
- "orientation": "portrait",
- "extent": "full-screen",
- "minimum-system-version": "7.0",
- "scale": "2x",
- "size": "640x960",
- "idiom": "iphone"
- },
- {
- "orientation": "portrait",
- "extent": "full-screen",
- "minimum-system-version": "7.0",
- "subtype": "retina4",
- "scale": "2x",
- "size": "640x1136",
- "idiom": "iphone"
- },
- {
- "orientation": "portrait",
- "extent": "full-screen",
- "minimum-system-version": "7.0",
- "scale": "1x",
- "size": "768x1024",
- "idiom": "ipad"
- },
- {
- "orientation": "landscape",
- "extent": "full-screen",
- "minimum-system-version": "7.0",
- "scale": "1x",
- "size": "1024x768",
- "idiom": "ipad"
- },
- {
- "orientation": "portrait",
- "extent": "full-screen",
- "minimum-system-version": "7.0",
- "scale": "2x",
- "size": "1536x2048",
- "idiom": "ipad"
- },
- {
- "orientation": "landscape",
- "extent": "full-screen",
- "minimum-system-version": "7.0",
- "scale": "2x",
- "size": "2048x1536",
- "idiom": "ipad"
- }
- ],
- "properties": {},
- "info": {
- "version": 1,
- "author": ""
- }
-}
\ No newline at end of file
diff --git a/samples/CSharpUno/UnoSample/Platforms/Windows/Program.cs b/samples/CSharpUno/UnoSample/Platforms/Windows/Program.cs
deleted file mode 100644
index c0e01031..00000000
--- a/samples/CSharpUno/UnoSample/Platforms/Windows/Program.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Microsoft.UI.Dispatching;
-using Velopack;
-
-namespace UnoSample;
-//public static class Program
-//{
-// // https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/guides/applifecycle?WT.mc_id=DT-MVP-5003472#single-instancing-in-main-or-wwinmain
-// [STAThread]
-// public static void Main(string[] args)
-// {
-
-
-// WinRT.ComWrappersSupport.InitializeComWrappers();
-
-// Application.Start((p) =>
-// {
-// var context = new DispatcherQueueSynchronizationContext(
-// DispatcherQueue.GetForCurrentThread());
-// SynchronizationContext.SetSynchronizationContext(context);
-// new App();
-// });
-// }
-//}
diff --git a/samples/CSharpUno/UnoSample/Presentation/MainPage.xaml b/samples/CSharpUno/UnoSample/Presentation/MainPage.xaml
deleted file mode 100644
index a0c2a48a..00000000
--- a/samples/CSharpUno/UnoSample/Presentation/MainPage.xaml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/CSharpUno/UnoSample/Presentation/MainPage.xaml.cs b/samples/CSharpUno/UnoSample/Presentation/MainPage.xaml.cs
deleted file mode 100644
index 549bf2ce..00000000
--- a/samples/CSharpUno/UnoSample/Presentation/MainPage.xaml.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace UnoSample.Presentation;
-
-public sealed partial class MainPage : Page
-{
- public MainViewModel ViewModel => (MainViewModel)DataContext;
-
- public bool NotInstalled => ViewModel?.IsInstalled != true;
-
- public MainPage()
- {
- InitializeComponent();
- }
-}
diff --git a/samples/CSharpUno/UnoSample/Presentation/MainViewModel.cs b/samples/CSharpUno/UnoSample/Presentation/MainViewModel.cs
deleted file mode 100644
index 91ac9b3e..00000000
--- a/samples/CSharpUno/UnoSample/Presentation/MainViewModel.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using Velopack;
-using Velopack.Sources;
-
-namespace UnoSample.Presentation;
-
-public partial class MainViewModel : ObservableObject
-{
- private readonly UpdateManager _updateManager;
-
- public bool IsInstalled => _updateManager.IsInstalled;
-
- [ObservableProperty]
- [NotifyPropertyChangedFor(nameof(HasUpdate))]
- private UpdateInfo? _latestUpdate;
-
- public bool HasUpdate => LatestUpdate != null;
-
- public string CurrentVersion => _updateManager.CurrentVersion?.ToFullString() ?? "";
-
- [ObservableProperty]
- private string? _status;
-
- public MainViewModel(
- IStringLocalizer localizer,
- IOptions appInfo)
- {
- Title = "Main";
- Title += $" - {localizer["ApplicationName"]}";
- Title += $" - {appInfo?.Value?.Environment}";
-
- _updateManager = new UpdateManager(new VelopackFlowUpdateSource());
- }
- public string? Title { get; }
-
- [RelayCommand(CanExecute = nameof(IsInstalled))]
- private async Task CheckForUpdates()
- {
- if (_updateManager.IsInstalled)
- {
- try
- {
- Status = "Checking for updates...";
- LatestUpdate = await _updateManager.CheckForUpdatesAsync();
- Status = LatestUpdate is null ? "No updates available" : $"{LatestUpdate.TargetFullRelease.Version} - Update available";
- }
- catch (Exception ex)
- {
- Status = ex.Message;
- }
- }
- }
-
- [RelayCommand(CanExecute = nameof(IsInstalled))]
- private async Task DownloadUpdates()
- {
- if (_updateManager.IsInstalled && LatestUpdate is { } latestUpdate)
- {
- try
- {
- Status = $"Downloading {0:p}";
-
- await _updateManager.DownloadUpdatesAsync(latestUpdate, progress => Status = $"Downloading {progress / 100.0:p}");
- Status = "Restarting...";
- _updateManager.ApplyUpdatesAndRestart(latestUpdate.TargetFullRelease);
- }
- catch(Exception ex)
- {
- Status = ex.Message;
- }
- }
- }
-}
diff --git a/samples/CSharpUno/UnoSample/Presentation/Shell.xaml b/samples/CSharpUno/UnoSample/Presentation/Shell.xaml
deleted file mode 100644
index 88082443..00000000
--- a/samples/CSharpUno/UnoSample/Presentation/Shell.xaml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/CSharpUno/UnoSample/Presentation/Shell.xaml.cs b/samples/CSharpUno/UnoSample/Presentation/Shell.xaml.cs
deleted file mode 100644
index 2ba19587..00000000
--- a/samples/CSharpUno/UnoSample/Presentation/Shell.xaml.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace UnoSample.Presentation;
-
-public sealed partial class Shell : UserControl, IContentControlProvider
-{
- public Shell()
- {
- this.InitializeComponent();
- }
- public ContentControl ContentControl => Splash;
-}
diff --git a/samples/CSharpUno/UnoSample/Presentation/ShellViewModel.cs b/samples/CSharpUno/UnoSample/Presentation/ShellViewModel.cs
deleted file mode 100644
index cf938dcd..00000000
--- a/samples/CSharpUno/UnoSample/Presentation/ShellViewModel.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace UnoSample.Presentation;
-
-public class ShellViewModel
-{
- private readonly INavigator _navigator;
-
- public ShellViewModel(
- INavigator navigator)
- {
- _navigator = navigator;
- _ = Start();
- }
-
- public async Task Start()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
-}
diff --git a/samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml b/samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-arm64.pubxml
similarity index 74%
rename from samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml
rename to samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-arm64.pubxml
index d5147f10..5d5632ab 100644
--- a/samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml
+++ b/samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-arm64.pubxml
@@ -12,11 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
False
False
True
-
-
diff --git a/samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml b/samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-x64.pubxml
similarity index 74%
rename from samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml
rename to samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-x64.pubxml
index 4fea954e..12b83447 100644
--- a/samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml
+++ b/samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-x64.pubxml
@@ -12,11 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
False
False
True
-
-
diff --git a/samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml b/samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-x86.pubxml
similarity index 84%
rename from samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml
rename to samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-x86.pubxml
index 928cb25e..65b8f1db 100644
--- a/samples/CSharpUno/UnoSample/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml
+++ b/samples/CSharpUno/UnoSample/Properties/PublishProfiles/win-x86.pubxml
@@ -12,7 +12,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
False
False
True
-
+ False
+ True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- UnoSample-es
-
-
diff --git a/samples/CSharpUno/UnoSample/Strings/fr/Resources.resw b/samples/CSharpUno/UnoSample/Strings/fr/Resources.resw
deleted file mode 100644
index f2d8f36a..00000000
--- a/samples/CSharpUno/UnoSample/Strings/fr/Resources.resw
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- UnoSample-fr
-
-
diff --git a/samples/CSharpUno/UnoSample/Strings/pt-BR/Resources.resw b/samples/CSharpUno/UnoSample/Strings/pt-BR/Resources.resw
deleted file mode 100644
index 7aa109d2..00000000
--- a/samples/CSharpUno/UnoSample/Strings/pt-BR/Resources.resw
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- UnoSample-pt-BR
-
-
diff --git a/samples/CSharpUno/UnoSample/Styles/ColorPaletteOverride.json b/samples/CSharpUno/UnoSample/Styles/ColorPaletteOverride.json
deleted file mode 100644
index cd154921..00000000
--- a/samples/CSharpUno/UnoSample/Styles/ColorPaletteOverride.json
+++ /dev/null
@@ -1,76 +0,0 @@
-{
- "description": "Default Uno Material colors",
- "seed": "#5946d2",
- "coreColors": {
- "primary": "#5946d2",
- "secondary": "#6b4ea2"
- },
- "extendedColors": [],
- "schemes": {
- "light": {
- "primary": "#5946d2",
- "surfaceTint": "#5946d2",
- "onPrimary": "#ffffff",
- "primaryContainer": "#e5deff",
- "onPrimaryContainer": "#170065",
- "secondary": "#6b4ea2",
- "onSecondary": "#ffffff",
- "secondaryContainer": "#ebddff",
- "onSecondaryContainer": "#220555",
- "tertiary": "#0061a4",
- "onTertiary": "#ffffff",
- "tertiaryContainer": "#cfe4ff",
- "onTertiaryContainer": "#001d36",
- "error": "#b3261e",
- "onError": "#ffffff",
- "errorContainer": "#f9dedc",
- "onErrorContainer": "#410e0b",
- "background": "#fcfbff",
- "onBackground": "#1c1b1f",
- "surface": "#ffffff",
- "onSurface": "#1c1b1f",
- "surfaceVariant": "#f2eff5",
- "onSurfaceVariant": "#8b8494",
- "outline": "#79747e",
- "outlineVariant": "#c9c5d0",
- "shadow": "#000000",
- "scrim": "#000000",
- "inverseSurface": "#e6e1e5",
- "inverseOnSurface": "#1c1b1f",
- "inversePrimary": "#2a009f"
- },
- "dark": {
- "primary": "#c7bfff",
- "surfaceTint": "#c7bfff",
- "onPrimary": "#2a009f",
- "primaryContainer": "#4129ba",
- "onPrimaryContainer": "#e4dfff",
- "secondary": "#cdc2dc",
- "onSecondary": "#332d41",
- "secondaryContainer": "#433c52",
- "onSecondaryContainer": "#eddfff",
- "tertiary": "#9fcaff",
- "onTertiary": "#003258",
- "tertiaryContainer": "#00497d",
- "onTertiaryContainer": "#d1e4ff",
- "error": "#ffb4ab",
- "onError": "#690005",
- "errorContainer": "#93000a",
- "onErrorContainer": "#ffdad6",
- "background": "#1c1b1f",
- "onBackground": "#e5e1e6",
- "surface": "#302d37",
- "onSurface": "#e6e1e5",
- "surfaceVariant": "#47464f",
- "onSurfaceVariant": "#c9c5d0",
- "outline": "#928f99",
- "outlineVariant": "#57545d",
- "shadow": "#000000",
- "scrim": "#000000",
- "inverseSurface": "#e6e1e5",
- "inverseOnSurface": "#1c1b1f",
- "inversePrimary": "#2a009f"
- }
- },
- "palettes": {}
-}
diff --git a/samples/CSharpUno/UnoSample/Styles/ColorPaletteOverride.xaml b/samples/CSharpUno/UnoSample/Styles/ColorPaletteOverride.xaml
deleted file mode 100644
index 6993f785..00000000
--- a/samples/CSharpUno/UnoSample/Styles/ColorPaletteOverride.xaml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- #5946D2
- #5946D2
- #FFFFFF
- #E5DEFF
- #170065
- #6B4EA2
- #FFFFFF
- #EBDDFF
- #220555
- #0061A4
- #FFFFFF
- #CFE4FF
- #001D36
- #B3261E
- #FFFFFF
- #F9DEDC
- #410E0B
- #FCFBFF
- #1C1B1F
- #FFFFFF
- #1C1B1F
- #F2EFF5
- #8B8494
- #79747E
- #C9C5D0
- #E6E1E5
- #1C1B1F
- #2A009F
-
-
- #C7BFFF
- #C7BFFF
- #2A009F
- #4129BA
- #E4DFFF
- #CDC2DC
- #332D41
- #433C52
- #EDDFFF
- #9FCAFF
- #003258
- #00497D
- #D1E4FF
- #FFB4AB
- #690005
- #93000A
- #FFDAD6
- #1C1B1F
- #E5E1E6
- #302D37
- #E6E1E5
- #47464F
- #C9C5D0
- #928F99
- #57545D
- #E6E1E5
- #1C1B1F
- #2A009F
-
-
-
\ No newline at end of file
diff --git a/samples/CSharpUno/UnoSample/UnoSample.csproj b/samples/CSharpUno/UnoSample/UnoSample.csproj
index d0b14457..c9921bb8 100644
--- a/samples/CSharpUno/UnoSample/UnoSample.csproj
+++ b/samples/CSharpUno/UnoSample/UnoSample.csproj
@@ -1,10 +1,6 @@
-
- net8.0-maccatalyst;
- net8.0-windows10.0.19041;
- net8.0-desktop;
-
+ net9.0-desktop;net9.0-windows10.0.26100
Exe
true
@@ -19,6 +15,10 @@
1.0
1
+
+ Velopack
+
+ UnoSample powered by Uno Platform.
- Material;
- Dsp;
- Hosting;
- Toolkit;
- Logging;
Mvvm;
- Configuration;
- Http;
- Serialization;
- Localization;
- Navigation;
- ThemeService;
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
- Uno
-
diff --git a/samples/CSharpUno/UnoSample/appsettings.development.json b/samples/CSharpUno/UnoSample/appsettings.development.json
deleted file mode 100644
index 2cf8df52..00000000
--- a/samples/CSharpUno/UnoSample/appsettings.development.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "AppConfig": {
- "Environment": "Development"
- },
- "ApiClient": {
- "Url": "https://localhost:5002",
- "UseNativeHandler": true
- }
-}
diff --git a/samples/CSharpUno/UnoSample/appsettings.json b/samples/CSharpUno/UnoSample/appsettings.json
deleted file mode 100644
index aa890ef1..00000000
--- a/samples/CSharpUno/UnoSample/appsettings.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "AppConfig": {
- "Environment": "Production"
- },
- "ApiClient": {
- "UseNativeHandler": true
- },
- "LocalizationConfiguration": {
- "Cultures": [
- "es",
- "fr",
- "pt-BR",
- "en"
- ]
- }
-}
diff --git a/samples/CSharpUno/build.bat b/samples/CSharpUno/build.bat
new file mode 100644
index 00000000..59ef67bb
--- /dev/null
+++ b/samples/CSharpUno/build.bat
@@ -0,0 +1,18 @@
+@echo off
+setlocal enabledelayedexpansion
+
+if "%~1"=="" (
+ echo Version number is required.
+ echo Usage: build.bat [version]
+ exit /b 1
+)
+
+set "version=%~1"
+
+echo.
+echo Compiling CSharpUno with dotnet...
+dotnet publish -c Release --framework net9.0-desktop -o %~dp0UnoSample\publish UnoSample\UnoSample.csproj
+
+echo.
+echo Building Velopack Release v%version%
+vpk pack -u CSharpUno -v %version% -o %~dp0UnoSample\releases -p %~dp0UnoSample\publish --mainExe UnoSample.exe
diff --git a/samples/CSharpUno/build.sh b/samples/CSharpUno/build.sh
new file mode 100644
index 00000000..5a8f99ad
--- /dev/null
+++ b/samples/CSharpUno/build.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Check if version parameter is provided
+if [ "$#" -ne 1 ]; then
+ echo "Version number is required."
+ echo "Usage: ./build.sh [version]"
+ exit 1
+fi
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+BUILD_VERSION="$1"
+RELEASE_DIR="$SCRIPT_DIR/UnoSample/releases"
+PUBLISH_DIR="$SCRIPT_DIR/UnoSample/publish"
+
+echo ""
+echo Compiling CSharpUno with dotnet...
+dotnet publish -c Release --framework net9.0-desktop -o "$PUBLISH_DIR" UnoSample/UnoSample.csproj
+
+echo ""
+echo "Building Velopack Release v$BUILD_VERSION"
+vpk pack -u CSharpUno -v $BUILD_VERSION -o "$RELEASE_DIR" -p "$PUBLISH_DIR" --mainExe UnoSample
\ No newline at end of file
diff --git a/samples/CSharpUno/global.json b/samples/CSharpUno/global.json
index 0f8ea7cd..e385cb20 100644
--- a/samples/CSharpUno/global.json
+++ b/samples/CSharpUno/global.json
@@ -2,5 +2,8 @@
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
"Uno.Sdk": "5.6.51"
+ },
+ "sdk":{
+ "allowPrerelease": false
}
}
diff --git a/samples/Directory.Build.targets b/samples/Directory.Build.targets
index 3943538e..0e3c031e 100644
--- a/samples/Directory.Build.targets
+++ b/samples/Directory.Build.targets
@@ -10,12 +10,12 @@
<_Parameter1>VelopackSampleReleaseDir
- <_Parameter2>$(MSBuildThisFileDirectory)$(ProjectName)/releases
+ <_Parameter2>$(MSBuildProjectDirectory)/releases
-
+
diff --git a/samples/SampleHelper.cs b/samples/SampleHelper.cs
index da7d401b..6f205345 100644
--- a/samples/SampleHelper.cs
+++ b/samples/SampleHelper.cs
@@ -1,10 +1,12 @@
using System.Linq;
using System.Reflection;
+#nullable enable
internal static class SampleHelper
{
- public static string GetReleasesDir() => Assembly.GetEntryAssembly()
+ public static string? GetReleasesDir() => Assembly.GetEntryAssembly()?
.GetCustomAttributes()
.Where(x => x.Key == "VelopackSampleReleaseDir")
.Single().Value;
-}
\ No newline at end of file
+}
+#nullable restore
\ No newline at end of file