Can Third party WPF controls be loaded

Dec 18, 2014 at 6:27 PM

I was hoping that there is a way to import third party WPF components to be used within the foundation of ShowUI.

I am a huge fan of the DevExpress tool set and am hoping I can leverage ShowUI to host those controls.

Can you point me in the right direction if this can be done?

Thanks in advance.

Apr 11, 2015 at 8:04 AM
Yes, of course. That's what Add-UIModule is for, just point it at the assembly you want to use...
Apr 17, 2015 at 7:26 PM

Add-UIModule never actually generates any code, I am trying to use this with MahApps. Pointed at the dll and the files generated look like this

Export-ModuleMember -Cmdlet * -Function * -Alias *

With no other content. Also the manifest file is in the old style and needs to be rewritten to actually be imported without throwing errors.
Apr 18, 2015 at 7:50 PM
What command are you using, flyboarder? Is it this project?
Apr 18, 2015 at 7:56 PM
Yes same project. Passing -name and -path prams to Add-UIModule using absolute path.

The generated module is blank.

Matthew Ratzke

Apr 19, 2015 at 5:18 AM
Edited Apr 19, 2015 at 5:21 AM
OK, so ... I'm not sure what's going on with yours :-)

I'm using the current Dev branch from GitHub, and there's a minor bug in the RequiredAssemblies property (see in the code below, it put an extra empty string in there). Other than that, it seems to work:
C:\PS> cd ~\Documents\WindowsPowerShell\Modules

C:\PS> nuget install MahApps.Metro -x
Installing 'MahApps.Metro'.
Successfully installed 'MahApps.Metro'.

C:\PS> Add-UIModule -Path .\MahApps.Metro\lib\net40\MahApps.Metro.dll -Name MahApps.Metro

C:\PS> ls .\MahApps.Metro

    Directory: C:\Users\Joel\Documents\WindowsPowerShell\Modules\MahApps.Metro

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
da----        4/18/2015  11:51 PM                lib
da----        4/18/2015  11:51 PM                tools
-a----        4/18/2015  11:51 PM         639875 MahApps.Metro.nupkg
-a----        4/18/2015  11:52 PM           4494 MahApps.Metro.psd1
-a----        4/18/2015  11:52 PM         965706 MahApps.Metro.psm1

C:\PS> cat .\MahApps.Metro\MahApps.Metro.psd1
    ModuleVersion = '1.0'
    RequiredModules = 'ShowUI'
    RequiredAssemblies = 'C:\Users\Joel\Documents\WindowsPowerShell\Modules\MahApps.Metro\lib\net40\MahApps.Metro.dll',''
    ModuleToProcess = 'C:\Users\Joel\Documents\WindowsPowerShell\Modules\MahApps.Metro\MahApps.Metro.psm1'
    GUID = '36f28fcd-90dc-4278-9baa-b8544a032d84' 
    FunctionsToExport = @('New-CloseTabItemAction','New-SetFlyoutOpenAction','New-BindableResourceBehavior','New-BorderlessWindowBehavior','New-GlowWindowBehavior','New-WindowsSettingBehaviour','New-CustomValidationPopup','New-DataGridNumericUpDownColumn','New-LoginDialogSettings','New-CustomDialog','New-DropDownButton','New-FlipViewItem','New-FlipView','New-Flyout','New-FlyoutsControl','New-Glow','New-LayoutInvalidationCatcher','New-MetroAnimatedSingleRowTabControl','New-MetroAnimatedTabControl','New-MetroWindow','New-MetroNavigationWindow','New-MetroProgressBar','New-MetroTabControl','New-MetroTabItem','New-MultiFrameImage','New-NumericUpDown','New-Pivot','New-PivotItem','New-ScrollViewerOffsetMediator','New-SplitButton','New-WindowButtonCommands','New-WindowCommands','New-Planerator','New-ProgressRing','New-RangeSlider','New-ToggleSwitchButton','New-TransitioningContentControl','New-TiltBehavior','New-MetroContentControl','New-RevealImage','New-Tile','New-ToggleSwitch','New-ToUpperConverter','New-ToLowerConverter' ) 
    AliasesToExport = @( 'CloseTabItemAction','SetFlyoutOpenAction','BindableResourceBehavior','BorderlessWindowBehavior','GlowWindowBehavior','WindowsSettingBehaviour','CustomValidationPopup','DataGridNumericUpDownColumn','LoginDialogSettings','CustomDialog','DropDownButton','FlipViewItem','FlipView','Flyout','FlyoutsControl','Glow','LayoutInvalidationCatcher','MetroAnimatedSingleRowTabControl','MetroAnimatedTabControl','MetroWindow','MetroNavigationWindow','MetroProgressBar','MetroTabControl','MetroTabItem','MultiFrameImage','NumericUpDown','Pivot','PivotItem','ScrollViewerOffsetMediator','SplitButton','WindowButtonCommands','WindowCommands','Planerator','ProgressRing','RangeSlider','ToggleSwitchButton','TransitioningContentControl','TiltBehavior','MetroContentControl','RevealImage','Tile','ToggleSwitch','ToUpperConverter','ToLowerConverter' )

C:\PS> Set-Content .\MahApps.Metro\MahApps.Metro.psd1 $((Get-Content .\MahApps.Metro\MahApps.Metro.psd1) -replace ",''")

C:\PS> ipmo MahApps.Metro -Passthru

ModuleType Name                           ExportedCommands
---------- ----                           ----------------
Script     MahApps.Metro                  {New-BindableResourceBehavior, New-BorderlessWindowBehavior, New-CloseTabItem...

If you want my copy of the module files, I put it up on GitHub as a Gist
Apr 19, 2015 at 5:42 AM
Can you try with the 4.5 folder and see what the results are, all of my tests are with 4.5.

Matthew Ratzke

Apr 19, 2015 at 6:46 AM
Oops, didn't even notice that was there. I can, but not tonight ;)

Apr 20, 2015 at 4:00 PM
Confirmed this works with 4.5 using latest dev branch.