Help ! Unknown Type #4453
Unanswered
OscarDelta59
asked this question in
Q&A
Replies: 2 comments
-
What's your error? I'm getting: | Exception calling "ShowDialog" with "0" argument(s): "Cannot create unknown type '{http://metro.mahapps.com/winfx/xaml/iconpacks}PackIconMaterial'." |
Beta Was this translation helpful? Give feedback.
0 replies
-
IconPacks is installed I guess? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I'm a Newbee using VB, WPF apps and Mahapps. I need to create some powershell scripts (no problem with powershell), and want to offer a Modern GUI ...
I've followed the How to guide.
Everything is ok in VB :
However, using Powershell, I get this error :
Exception lors de l'appel de « Load » avec « 1 » argument(s) : « Impossible de créer le type inconnu '{http://metro.mahapps.com/winfx/xaml/controls}MetroWindow'. »
I've googled it for hours, without success.
The PS1 file :
`clear-host
[System.Reflection.Assembly]::LoadFrom('C:_TestAppWpf\Metro\MahApps.Metro.dll') | out-null
[System.Reflection.Assembly]::LoadFrom('C:_TestAppWpf\Metro\System.Windows.Interactivity.dll') | out-null
[System.Reflection.Assembly]::LoadFrom('C:_TestAppWpf\Metro\ControlzEx.dll') | out-null
function LoadXml ($FileName) {
$XamlLoader = (new-object system.Xml.XmlDocument)
$XamlLoader.Load($FileName)
return $XamlLoader
}
$XamlWindow = LoadXml("C:_TestAppWpf\test.xaml")
$Reader = (New-Object System.Xml.XmlNodeReader $XamlWindow)
$Form = [Windows.Markup.XamlReader]::Load($Reader)
$Form.ShowDialog()`
The XAML file :
`<Controls:MetroWindow x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:local="clr-namespace:Test"
mc:Ignorable="d"
Title="Test App Wpf" Height="450" Width="800">
<Window.Resources>
`<ResourceDictionary.MergedDictionaries>
1
</ResourceDictionary.MergedDictionaries>
</Window.Resources>
Versions : Windows 11 22H2, Visual Studio 17.5.1, Mahapps Metro 2.4.10
Thank you for your help.
Kind regards,
Oliver.
Beta Was this translation helpful? Give feedback.
All reactions