Created
January 25, 2017 21:39
-
-
Save anonymous/f0a3d1f773a3549eec0567735334ca9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName PresentationFramework | |
Add-Type -AssemblyName System.Windows.Forms | |
# WPF GUI Windows | |
$inputXAML = @" | |
<Window | |
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:local="clr-namespace:GUI_test" | |
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" x:Class="GUI_test.MainWindow" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="350" Width="525"> | |
<Grid> | |
<xctk:DateTimePicker HorizontalAlignment="Left" Height="32" Margin="115,122,0,0" VerticalAlignment="Top" Width="282"/> | |
</Grid> | |
</Window> | |
"@ | |
[xml]$Form = $inputXAML -replace 'mc:Ignorable="d"','' -replace "x:N",'N' -replace '^<Win.*', '<Window' | |
$NR=(New-Object System.Xml.XmlNodeReader $Form) | |
$Win=[Windows.Markup.XamlReader]::Load($NR) | |
$Win.showdialog() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment