Add WPF extension into PowerShell GUI

Welcome Forums General PowerShell Q&A Add WPF extension into PowerShell GUI

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
1 year, 10 months ago.

  • Author
    Posts
  • #62653

    Participant
    Points: 21
    Rank: Member

    I created a small PowerShell GUI using WPF Toolkit extension.

    The GUI works on Visual Studio. However, I got the error "Specified class name 'GUI_test.MainWindow' doesn't match actual root instance type 'System.Windows.Window'. Remove the Class directive or provide an instance via XamlObjectWriterSettings.RootObjectInstance." when I put the XMAL into PowerShell.

    Here is the PS code.

    I did some research and tried to add custom DLL file (Add-Type/[reflection.assembly]) but did not work. Any ideas would be appreciated.

  • #62676

    Participant
    Points: 0
    Rank: Member

    You need to Remove the x:class... And mc:Ignorable="d" and try again

  • #62709

    Participant
    Points: 21
    Rank: Member

    Hi, vacano

    Thanks for your suggestion.

    I removed x:Class="GUI_test.MainWindow" and mc:Ignorable="d" but got another error "Cannot create unknown type '{http://schemas.xceed.com/wpf/xaml/toolkit}DateTimePicker'."

    Any ideas?

The topic ‘Add WPF extension into PowerShell GUI’ is closed to new replies.