-
Hello, before posting in the Issues section I'd like to check with you whether what I'm doing is correct. I built a WPF App in VS 2019 as a WPF .NET Framework project and it works. I really like the result and now I want to translate it into ps1 file. I followed what adviced in this link: http://vcloud-lab.com/entries/powershell/part-3-powershell-wpf-mahapps-metro-theme-step-by-step but my ps1 does not work. The only difference is that I'm using Microsoft.Xaml.Behaviors.dll rather than System.Windows.Interactivity.dll. Exception calling "Load" with "1" argument(s): "Cannot create unknown type '{clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro}MetroWindow'." Here's my xaml:
Here the ps1 file. When it get to the Try statement it throws the error.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hi @mezamoe I have no idea about PowerShell but what I can tell from the XAML you posted is, that you need to change <Controls:MetroWindow
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Test" Height="325" Width="735" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Topmost="True" WindowStyle="ThreeDBorderWindow" FontFamily="Calibri" Foreground="Black" Background="White" BorderBrush="#FFF9FAFB" BorderThickness="0,0,0,0">
<Controls:MetroWindow.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Theme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Controls:MetroWindow.Resources>
<Grid >
</Grid>
</Controls:MetroWindow> I hope this helps. Happy coding |
Beta Was this translation helpful? Give feedback.
-
Hi Tim, |
Beta Was this translation helpful? Give feedback.
-
and yes there was something wrong... the tagging! the namespace was missing the correct identifier: xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" |
Beta Was this translation helpful? Give feedback.
and yes there was something wrong... the tagging!
the namespace was missing the correct identifier:
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"