Created
September 17, 2019 15:18
-
-
Save SteveL-MSFT/7aa29a32cc6a3496cafb81bd79371240 to your computer and use it in GitHub Desktop.
WPF Example
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 | |
$xaml = @" | |
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
x:Name="Window" Title="Initial Window" WindowStartupLocation = "CenterScreen" | |
Width = "400" Height = "300" ShowInTaskbar = "True"> | |
</Window> | |
"@ | |
$stream=[System.IO.MemoryStream]::new([System.Text.Encoding]::Unicode.GetBytes($xaml)) | |
$reader=[System.Xml.XmlReader]::Create($stream) | |
$Window=[System.Windows.Markup.XamlReader]::Load($reader) | |
$Window.Show() | |
Start-Sleep -Seconds 5 | |
$Window.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment