Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of WinUI with samples and features working #853

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

KasperSK
Copy link
Member

@KasperSK KasperSK commented Apr 6, 2023

This works but navigation is a little rough around the edges, open for input on how it should be done for WinUI

@KasperSK KasperSK requested a review from vb2ae April 6, 2023 06:47
@vb2ae
Copy link
Member

vb2ae commented May 6, 2023

@KasperSK do you want to complete this pr?

@KasperSK
Copy link
Member Author

KasperSK commented May 9, 2023

@KasperSK do you want to complete this pr?

Yes but I think I need to make another commit and fix the small issues. :)

@alex-nicholas
Copy link

Just wondering how far off we are from seeing this in a release?

I've been using caliburn.micro in WPF apps for nearly 8 years, but I'm currently working on a WinUI app, and the amount of non-sense you have to do for basic View/ViewModel binding (and the amount of concrete references you need to have from the view to the view model) is just staggering after working in a fully auto-wired caliburn app...

@KasperSK
Copy link
Member Author

KasperSK commented Nov 5, 2024

@vb2ae Do you still think we should merge this if I rebase the PR?

@vb2ae
Copy link
Member

vb2ae commented Nov 5, 2024

yes we can fix any bug we find

@vb2ae
Copy link
Member

vb2ae commented Nov 5, 2024

@KasperSK thanks

vb2ae and others added 4 commits December 16, 2024 09:24
Updated README.md to reflect changes in description and package details. Modified `MessageDialogResult.cs` to use `_content` and `_title`. Updated `App.xaml` and `App.xaml.cs` with XML declaration, removed comments, and added navigation to `MenuView`. Updated `Features.WinUI3.csproj` to target .NET 8.0 and adjusted settings. Cleaned up `RootView.xaml.cs` and other files by removing unused directives. Updated `Package.appxmanifest` and `app.manifest` for Windows 10 compatibility. Renamed bindings in `ActionsView.xaml`, `NavigationSourceView.xaml`, and `NavigationTargetView.xaml`. Updated `Microsoft.NET.Test.Sdk` and `Nerdbank.GitVersioning` packages. Improved formatting and consistency in several files. Added strong name key files.
@KasperSK KasperSK requested a review from vb2ae December 18, 2024 08:22
src/Caliburn.Micro.Platform/BindingScope.cs Show resolved Hide resolved
src/Caliburn.Micro.Platform/BindingScope.cs Show resolved Hide resolved
Comment on lines +27 to +30
catch(Exception ex)
{
return Task.FromException(ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
Comment on lines +43 to +46
catch (Exception ex)
{
tcs.TrySetException(ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
Comment on lines +66 to +69
catch (Exception ex)
{
return Task.FromException<T>(ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
Comment on lines +80 to +83
catch (Exception ex)
{
tcs.SetException(ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause Note

Generic catch clause.
@@ -21,7 +27,9 @@
/// </summary>
public class XamlPlatformProvider : IPlatformProvider {
#if WINDOWS_UWP
private readonly CoreDispatcher dispatcher;
private CoreDispatcher dispatcher;

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field 'dispatcher' can be 'readonly'.
private readonly CoreDispatcher dispatcher;
private CoreDispatcher dispatcher;
#elif WinUI3
private DispatcherQueue dispatcher;

Check notice

Code scanning / CodeQL

Missed 'readonly' opportunity Note

Field 'dispatcher' can be 'readonly'.
var dummy = dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());
#elif AVALONIA
dispatcher.Post(action);
#elif WinUI3
var dummy = dispatcher.TryEnqueue(() => action());

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
dummy
is useless, since its value is never read.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should change to _ = dispatcher.TryEnqueue(() => action());

@@ -0,0 +1,72 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you change this to net8.0-windows10.0.19041 .net 6 is no longer supported

<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>Caliburn.Micro</RootNamespace>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you change this to
win-x86;win-x64;win-arm64

src/Caliburn.Micro.Platform/BindingScope.cs Show resolved Hide resolved
Copy link
Member

@vb2ae vb2ae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just need to move to .net8.0 from .net6.0 which is no longer supported

@KasperSK
Copy link
Member Author

just need to move to .net8.0 from .net6.0 which is no longer supported

I will get on that :)

This was linked to issues Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: Do somebody work on WinUI 3 support? WinUI 3 support
3 participants