dotMorten / WinUIEx

WinUI Extensions
https://dotmorten.github.io/WinUIEx
MIT License
572 stars 36 forks source link

Add overload to WindowEx to Create a WindowEx from Window #136

Closed AathifMahir closed 9 months ago

AathifMahir commented 9 months ago

Having this makes to easier to cross create between native native WIndow and WindowEx

dotMorten commented 9 months ago

That's not really possible when WindowEx is a subclass of Window. However instead you can use WindowManager.Get(myWindow) to get pretty much all the features WindowEx have.

AathifMahir commented 9 months ago

The problem that i'm facing is, SplashScreen Completed Event is Exposing Window object instead of WindowEx, Since i'm using WindowEx as Primary Windows, There's no way to assign the Window Object that i'm getting from Splash Completed Event, Unless i'm missing something @dotMorten

dotMorten commented 9 months ago

You'll get the type back you passed to the splashscreen. It can be any Window type, including WindowEx. You'll just cast it back to WindowEx.

dotMorten commented 9 months ago

See the cast here: https://github.com/dotMorten/WinUIEx/blob/66aa5fa8fa4247d412702f64fc8d3179b35b3dff/src/WinUIExSample/App.xaml.cs#L49

AathifMahir commented 9 months ago

See the cast here:

https://github.com/dotMorten/WinUIEx/blob/66aa5fa8fa4247d412702f64fc8d3179b35b3dff/src/WinUIExSample/App.xaml.cs#L49

I tried that too, Seems like issue is related to Activation Service in My Project, Never mind, I might need to have custom splash screen implementation to solve this