Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shortdevelopment/shortdev.uwp.fulltrust
Create a performant WinUI application with Uwp and CoreWindow and run as full-trust win32
https://github.com/shortdevelopment/shortdev.uwp.fulltrust
full-trust star uwp winui2 xaml-islands xaml-ui
Last synced: 4 months ago
JSON representation
Create a performant WinUI application with Uwp and CoreWindow and run as full-trust win32
- Host: GitHub
- URL: https://github.com/shortdevelopment/shortdev.uwp.fulltrust
- Owner: ShortDevelopment
- License: mit
- Created: 2022-04-23T14:50:38.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T20:56:52.000Z (6 months ago)
- Last Synced: 2024-10-12T20:22:42.900Z (4 months ago)
- Topics: full-trust, star, uwp, winui2, xaml-islands, xaml-ui
- Language: C#
- Homepage: https://www.nuget.org/packages/ShortDev.Uwp.FullTrust/
- Size: 1.55 MB
- Stars: 18
- Watchers: 4
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ShortDev.Uwp.FullTrust
Create highly performant UI with `WinUi2` (Uwp) and enjoy the freedom of `Win32`!
You don't need any interop code for the `.GetForCurrentView()` methods.
### Problems
- The library does currently not support any Uwp-Frame related apis
- Therefore not frame customization
- Creating a new window is only possible with the library apis
- Pickers still need `IInitializeWithWindow` (See [#11](https://github.com/ShortDevelopment/ShortDev.Uwp.FullTrust/issues/11))## Setup
1. Create new Uwp project (*UI-Project*)
2. Add `false` in to the project file
3. Add reference to this library
---
5. Create new `netcoreapp3.1` `WinExe` project (*Host-Project*)
6. Add reference to `Microsoft.Toolkit.Win32.UI.SDK`
7. Add reference to Uwp project
8. Add `TargetPlatformVersion` and `AssetTargetFallback` to the project file
9. Redirect main method to the Uwp main method (See below)
### *Host-Project* (netcoreapp3.1)
This is needed for the management of all the dependency and runtime stuff.
Should contain no logic.
```xml
WinExe
netcoreapp3.1
x86;x64
uap10.0.19041
10.0.19041
```
#### `Program.cs`
```csharp
public class Program
{
[STAThread]
public static void Main(string[] args)
{
NAMESPACE.Program.Main(args);
}
}
```### *UI-Project* (Uwp)
Should contain all logic.
```xml
false
...```
#### `Program.cs`
```csharp
public class Program
{
[STAThread]
public static void Main(string[] args)
{
FullTrustApplication.Start((_) => new App());
}
}
```## Examples
#### Create New Window
```csharp
var view = FullTrustApplication.CreateNewView();
_ = view.CoreWindow.Dispatcher.RunIdleAsync((x) =>
{
Window.Current.Content = new MainPage();
Window.Current.Activate();
});
```