Closed chausner closed 2 years ago
@chausner are you able to elaborate further? I am trying to adapt my code from Window to WindowEx, but I am failing miserably. I can do this:
<Window
x:Class="Ennex.MainWindow:WindowEx"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ennex"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:Ennex.Views"
mc:Ignorable="d">
which solves the errors in c# code of MainWindow.xaml.cs, but then I get errors everywhere on "InitializeComponent". Using Windows App SDK 1.0.0 Release
@TRadigk This should work:
<winuiex:WindowEx
x:Class="Ennex.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ennex"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="using:Ennex.Views"
xmlns:winuiex="using:WinUIEx"
mc:Ignorable="d">
...
</winuiex:WindowEx>
It feels like a thumbs up is not enough: @chausner thank you!
I got the following error after changing the base class to
WindowEx
in the code-behind:Took me a few minutes to figure out that I would need to change the tag name in XAML, as well:
I suggest to extend the documentation by mentioning this fact and ideally including some sample code to make this clearer to users.