-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add WinUI #29
Comments
Before tackling this part here (I do have a working hosted service running under WinUI 3 (0.8.4)) I'd need to know whether these shortcomings are relevant or should be worked around:
Anything I should look out for before implementing this for you here? |
Thanks for taking a swing at this. 👍
My suggestion, as you already seem to have code, create a pull-request for a branch called "feature/winui" so I can see it. I'm not sure how much I can help, but it would be nice if you can make the behavior similar to the other projects. |
I just added a draft PR for my initial implementation here.
I'd help out as much as I can for supporting/extending the WinUI-part (migrating to App SDK 1.0, etc.). |
So … I just played with it a bit and turns out handling Windows is much harder now, as everything is managed by WinUI/COM. One solution: User cannot use Tracking this here: microsoft/microsoft-ui-xaml#6020 |
I'm currently reacting to the comment above this one, about the WinUI/COM management. I don't expect there will be a solution coming from Microsoft, as this is exactly the way things work when mixing managed & unmanaged. Compare it to the GDI Bitmap (System.Drawing.Bitmap) these are also interfaces into unmanaged resources, and will be cleaned when all references are gone via a finalizer. If you still use the Bitmap somewhere indirectly, e.g. in a button, it will cause issues. The way you define a new window, in a local scope (var window = new Window), will exactly do that. And to be honest, it makes sense, as there is no reference to the window anymore, so it would be a memory leak to leave it hanging. A memory leak would be no good either and that is what actually happens with a lot of WinForms and other stuff, which is NOT collected, the amount of people who have issues with forgetting to dispose their resources like a Pen or a brush... I've had my share of disposing issues for Greenshot, which bite you in the face due to a "unknown" error. So although I agree it's not nice behavior, I do not see any solution for it, besides making sure YOUR application keeps the references it needs. And maybe there is a way we can support making this a better experience via a library like this? |
Ageed with the COM/Native-part, though I'd argue that WPF does work fine with fire-and-forget creation of Windows (though So: Configure()-method would be turned down to For library-support: Eventually this would be a separate service |
Regarding the experimentation-branch: I'll mark the PR as ready for review once I finished migrating an app I have completely to WinUI with the Hosting extensions to ensure there are no major issues, other than those created by WinUI itself. |
Yeah, absolutely no hurries. Take your time, I am so swamped with work that it doesn't matter if it takes another week. Btw. |
@ChrisPulman II shine at the lack of WinUI knowledge, and with the merge of the WinUI code into master, it of course doesn't work. This is when I start the sample project
And this is when the build on Azure runs:
Before I start from scratch, for which I do not have time right now, I rather disable the WinUI project for now. |
I just gave it a try and got the same error, which is likely caused by the fact the Updating @Lakritzator any chance you could give it another try? 😃 |
I guess it should be possible to add WinUI support, with a sample project.
The text was updated successfully, but these errors were encountered: