8000 Merge WinUI3 extensions by tajbender · Pull Request #507 · dahall/Vanara · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Merge WinUI3 extensions #507

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tajbender
Copy link
Contributor
@tajbender tajbender commented Feb 9, 2025

🚶 Coming soon.

⚠️ Work in Progress

tajbender and others added 2 commits December 28, 2024 04:21
Add temporary ReSharper configs.
Update Target Frameworks.
Add Release Notes.

Co-Authored-By: David Hall <dahall@users.noreply.github.com>
Merge as of 22.01.2015
@tajbender tajbender closed this Feb 9, 2025
@tajbender tajbender reopened this Feb 9, 2025
@tajbender tajbender changed the title Merge Win UI.extensions Merge WinUI3 extensions Feb 9, 2025
@tajbender tajbender marked this pull request as draft February 9, 2025 14:06
@tajbender
Copy link
Contributor Author

🚶 Coming soon.

⚠️ Work in Progress

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll have to delete

  • TargetFrameworks net5.0-windows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we don't have to. Minimum should be net5

Copy link
Contributor Author
@tajbender tajbender Mar 11, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dahall any comment?

Copy link
Owner

Choose a reason for hiding this comment

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

There are a number of assemblies that don't support all the same .NET versions as the rest of the project. .NET 5-9 and maybe Core 3.1 would be fine.

Copy link
Contributor Author
@tajbender tajbender Mar 14, 2025

Choose a reason for hiding this comment

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

Thanks for clarifying 👍🏻

According #507 (comment), net6 is an Requirement for WinUI 3...

I really don't have any knowledge whether the code would run with WinUI 2. But, since Requirements for WinUI 2 are at least Windows 10, imho it makes no sense to even try to downgrade.

@tajbender
Copy link
Contributor Author
tajbender commented Feb 22, 2025

@dahall One question, when pushing a integration test version of WinUI package, will it be included in the nightly AppVoyer build when the merge is still in progress?

I guess not, or will it?

Regards, tajbender

@dahall
Copy link
Owner
dahall commented Feb 23, 2025

@dahall One question, when pushing a integration test version of WinUI package, will it be included in the nightly AppVoyer build when the merge is still in progress?

I don't think so. Also, I have migrated away from AppVeyor and now use GitHub Actions to build after each commit and then post to MyGet.

@tajbender
Copy link
Contributor Author
tajbender commented Feb 24, 2025

I don't think so. Also, I have migrated away from AppVeyor and now use GitHub Actions to build after each commit and then post to MyGet.

That's fine for me. I'm asking cause I crashed my dev setup for any reason, nowadays i am not even able to compile my last revisions I checked in 🐞 on the current Win 11 Insider / Visual Studio.

However, I restarted from scratch with the latest iterations of Win App SDK with focus on ExplorerBrowser control alone. Another question is targeting the Windows Community Toolkit.

I use some of their components within the codebase, but I guess you don't want such dependencies for Vanara. That's - however - not a show-stopper. I just would copy & paste i.e. import their classes into the package itself. There`re not that much classes I use, but I use some especially for performance reasons.

e.g.: https://github.com/CommunityToolkit/Windows/tree/main/components/Collections/src/AdvancedCollectionView

@dahall Is that okay to you?

@dahall
Copy link
Owner
dahall commented Feb 26, 2025

@dahall Is that okay to you?

This all sounds good. I stay holding until I hear you are ready to integrate.

@tajbender
Copy link
Contributor Author

Thanks for your patience. I won't touch any other packages, nor do I need to for that stuff.

I'm living on the WinUI package island solely 😃 It's completely decoupled from the existing Vanara code base, I just use your Shell stuff.

The biggest Issue will be that namespaces and classes don't collide - beside code quality, for sure.

@dahall
Copy link
Owner
dahall commented Mar 7, 2025

Curious to have you try the 4.1.0 packages. I added .net 9.0 support and removed 4.5. Most notable is that all handles are now generated. I'm trying my hand at generation before using in many more places and maybe even pulling in generated code from https://github.com/microsoft/win32metadata to recreate Vanara live like CsWin32, but with the Vanara primitives and design goals.

@tajbender
Copy link
Contributor Author

Thank you so much. Without doubt, the next days I finally will submit code.

As mentioned yesterday, NETSDK1138: The target framework 'net7.0-windows10.0.19041.0' is out of support.. made me crazy for weeks now, cause every then and when this error came and left, and I don't get the point.

Then I tried JetBrains Rider, and that beast doesn't even mention there could be a problem and compiles fine.

I'm definitely too old for this 💩 - But I'm fine with the lessons learned, another year, another try 🧨. Now, I switched my dev-branch to reconfigure from scratch and ignore the .net7 issue. The XAML is already in, code stubs are coming. Everything works and compiles without this solely 'issue', but I don't even think it is one.

Long writing, short story: Now comes the fun part again, writing code 🎃

@tajbender
Copy link
Contributor Author

@dahall Surprise!

I'm very happy to let you know that we'll not only have a full working clone of ExplorerBrowser, it will also add double pane mode by default, without any hassle 🎈

image

@tajbender

This comment was marked as outdated.

@tajbender
Copy link
Contributor Author
tajbender commented Mar 9, 2025

Curious to have you try the 4.1.0 packages. I added .net 9.0 support and removed 4.5. Most notable is that all handles are now generated. I'm trying my hand at generation before using in many more places and maybe even pulling in generated code from https://github.com/microsoft/win32metadata to recreate Vanara live like CsWin32, but with the Vanara primitives and design goals.

fyi, I'm taking the direct route 🫖

image

electrifier/electrifier-v1.25@67417ed

@tajbender
Copy link
Contributor Author
tajbender commented Mar 10, 2025

Backtracking: WinUI 3 official Requirement:

Okay, I found the requirements: https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/system-requirements

The Windows App SDK has the following minimum system requirements:

  • Windows 10, version 1809 (build 17763) or later.
  • Visual Studio 2022, version 17.0 or later, with the required workloads and components.
  • Visual Studio 2019, version 16.9 or later, with the required workloads and components.
  • Windows SDK, version 2004 (build 19041) or later (included with Visual Studio 2019 and 2022 by default).
  • If you plan to build .NET apps, you'll also need .NET 6 or later (see Download .NET).

@tajbender
Copy link
Contributor Author
tajbender commented Mar 11, 2025

@dahall Just a little update:

Deployed branch: https://github.com/electrifier/electrifier-v1.25/commits/reconfigure/

That's the warning I get with this setup:

Updating the layout...
Copying files: Total <1 mb to layout...
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Build completed at 09:55 and took 02.814 seconds ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Deploy completed at 09:55 and took 02.814 seconds ==========
DEP0840: Project 'electrifier' requires packages 
- _MicrosoftCorporationII.WinAppRuntime.Main.1.4_8wekyb3d8bbwe_ and 
- _MicrosoftCorporationII.WinAppRuntime.Singleton_8wekyb3d8bbwe_ with version >= *4000.1010.1349.0*

These packages should be installed on first run, if not please visit [http://go.microsoft.com/fwlink/?linkid=2222757] for installation instructions.
Deployment complete (0:00:00.061). Full package name: "01234567-affe-0101"

Current Package config:

image

@tajbender
Copy link
Contributor Author
tajbender commented Mar 11, 2025

Copilot flies to:

Certainly! Developing a Windows app using the Windows App SDK with C# requires a few key components and steps. Here's a concise overview to get you started:

System Requirements Operating System: Windows 10 version 1809 (build 17763) or later. Development Environment: Visual Studio 2019 version 16.9 or later, or Visual Studio 2022. .NET SDK: .NET 5.0 or later. Software Requirements Windows App SDK: Install the latest version of the Windows App SDK. Visual Studio Workloads: Universal Windows Platform (UWP) development: Required for UWP apps. Desktop development with C#: Required for WinUI 3 desktop apps. Steps to Set Up Your Development Environment

Install Visual Studio:

Download and install Visual Studio from the official website. During installation, select the necessary workloads mentioned above.

Install .NET SDK:

Download and install the .NET SDK from the .NET website.

Install Windows App SDK:

Use the Visual Studio Installer to add the Windows App SDK extension. Alternatively, you can install it via NuGet in your project. Creating a New Project

Open Visual Studio.

Create a new project:

Select Create a new project. Choose a template such as Blank App, Packaged (WinUI 3 in Desktop) or Blank App, Unpackaged (WinUI 3 in Desktop). Click Next and configure your project settings.

Configure Project Dependencies:

Ensure your project references the Windows App SDK. Add necessary NuGet packages for WinUI 3 and other dependencies. Example Code Snippet

Here's a simple example of a WinUI 3 app in C#:

using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls;

namespace MyWinUIApp { public sealed partial class MainWindow : Window { public MainWindow() { this.InitializeComponent(); var textBlock = new TextBlock { Text = "Hello, Windows App SDK!", VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center }; this.Content = textBlock; } } }

This example creates a basic window with a centered text block displaying a greeting message.

Additional Resources Windows App SDK Documentation WinUI 3 Documentation

Feel free to reach out if you need more detailed guidance or have specific questions!

@tajbender
Copy link
Contributor Author
tajbender commented Mar 11, 2025

@dahall I upgraded to WinAppSDK 1.5, 1.5.25 - latest stable a far as i remember.

Just for your interest ℹ️

@tajbender

This comment was marked as outdated.

@tajbender
Copy link
Contributor Author

Here is what we would get, at least and so far:

image

The complete Controls namespace as seen here would be merged into the Vanara package, plus, at least a Breadcrumb Bar.

The Highlighted Ressource file will contain all i18n aware texts, that we'll use especially for Commands and Error / Info messages. I myself could provide German and English, obviously.

@tajbender
Copy link
Contributor Author

Just a Note: See CommunityToolkit/Windows#533 (comment)

I had to target Windows version 22621 at least, to get the Windows Community Toolkit running:

When consuming the Toolkit, you must target Windows version 22621 instead of the prior 18362, i.e. if you were targeting net6.0-windows10.0.18362, you would target net6.0-windows10.0.22621 instead now.
This does not affect your ability to run down-level with the minimum target version, that remains at 17763.

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.

2 participants
0