Can I import XAML into PowerShell when using Installed NuGet Packages - wpf
So I use Visual Studio to make my GUIs. I use a script to import my XAML into powershell which typically works. This time I installed NuGet packages to use for my GUI in visual studio(LiveCharts and MaterialThemes). When I go to run the script in PowerShell I get the following error:
Exception calling "Load" with "1" argument(s): "Cannot create unknown type '{clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf}CartesianChart'."
Same story with MaterialThemes. I am aware that it doesn't like this code. I'm looking to see if there is a way to make these packages work with PowerShell.
$inputXML = #"
<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:Hardware_Monitor"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:Wpf="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
mc:Ignorable="d"
Title="Hardware Monitor/Admin Center" Height="4000" Width="2000" WindowStartupLocation="CenterScreen" WindowState="Maximized">
<ScrollViewer VerticalScrollBarVisibility="Hidden">
<TabControl>
<TabControl>
<TabItem Header="Overview" Margin="-2,-2,0,0" HorizontalAlignment="Left" Width="120" OpacityMask="White">
<TabItem.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="White"/>
<GradientStop Color="#FF4AD2FF" Offset="1"/>
</LinearGradientBrush>
</TabItem.Background>
<Grid Background="White" OpacityMask="White" Width="1998">
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Rectangle HorizontalAlignment="Center" Height="100" Margin="0,10,0,0" VerticalAlignment="Top" Width="1998" Fill="#FF2E40A2"/>
<Label Content="Admin Center/Hardware Monitor" HorizontalAlignment="Left" Margin="38,0,0,0" VerticalAlignment="Top" FontSize="72" Foreground="White" Height="123" Width="1883"/>
<Rectangle HorizontalAlignment="Left" Height="224" Margin="396,166,0,0" VerticalAlignment="Top" Width="1484" Fill="White" Stroke="#FF585858"/>
<Label Content="RemoteHost" HorizontalAlignment="Left" Margin="413,192,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold"/>
<Label Content="Status" HorizontalAlignment="Left" Margin="821,192,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold"/>
<Label Content="CredSSP" HorizontalAlignment="Left" Margin="1109,192,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold"/>
<Label Content="DateTime" HorizontalAlignment="Left" Margin="1453,192,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold"/>
<Rectangle HorizontalAlignment="Left" Height="3" Margin="413,283,0,0" Stroke="#FF5D5D5D" VerticalAlignment="Top" Width="1442" Fill="#FF929292" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBox HorizontalAlignment="Left" Margin="407,291,0,0" TextWrapping="Wrap" Text="DESKTOP-TEST" VerticalAlignment="Top" Width="242" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="821,291,0,0" TextWrapping="Wrap" Text="Connected" VerticalAlignment="Top" Width="242" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1109,291,0,0" TextWrapping="Wrap" Text="Disabled" VerticalAlignment="Top" Width="242" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1453,291,0,0" TextWrapping="Wrap" Text="09-19-18_07:54:19PM" VerticalAlignment="Top" Width="242" FontSize="24" BorderBrush="White"/>
<Label Content="Overview" HorizontalAlignment="Left" Margin="15,430,0,0" VerticalAlignment="Top" FontSize="72" Foreground="Black" Height="124" Width="323" Background="White"/>
<Label Content="NOTE: Domain Group Policy trumps controls with an asterisk (*)" HorizontalAlignment="Left" Margin="15,530,0,0" VerticalAlignment="Top" FontSize="36"/>
<Button Content="Restart" HorizontalAlignment="Left" Margin="28,685,0,0" VerticalAlignment="Top" Height="65" Width="458" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Button Content="Shutdown" HorizontalAlignment="Left" Margin="526,685,0,0" VerticalAlignment="Top" Height="65" Width="458" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Button Content="Set Disk Metrics" HorizontalAlignment="Left" Margin="1028,685,0,0" VerticalAlignment="Top" Height="65" Width="458" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Button Content="Disable CredSSP*" HorizontalAlignment="Left" Margin="1529,685,0,0" VerticalAlignment="Top" Height="65" Width="458" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Button Content="Remote Desktop*" HorizontalAlignment="Left" Margin="28,793,0,0" VerticalAlignment="Top" Height="65" Width="458" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Button Content="SSH" HorizontalAlignment="Left" Margin="526,793,0,0" VerticalAlignment="Top" Height="65" Width="458" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Button Content="Edt Computer ID" HorizontalAlignment="Left" Margin="1028,793,0,0" VerticalAlignment="Top" Height="65" Width="959" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Button Content="Environment Variables" HorizontalAlignment="Left" Margin="28,902,0,0" VerticalAlignment="Top" Height="65" Width="1959" Background="#FF2E40A2" FontSize="36" FontWeight="Normal" Foreground="White"/>
<Label Content="Summary" HorizontalAlignment="Left" Margin="15,1000,0,0" VerticalAlignment="Top" FontSize="60" Foreground="Black" Height="93" Width="323" Background="White"/>
<Rectangle HorizontalAlignment="Left" Height="224" Margin="35,1098,0,0" VerticalAlignment="Top" Width="1953" Fill="White" Stroke="#FF585858"/>
<Label Content="Computer _Name" HorizontalAlignment="Left" Margin="58,1124,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="197"/>
<Label Content="Domain" HorizontalAlignment="Left" Margin="434,1124,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="108"/>
<Label Content="Operating System" HorizontalAlignment="Left" Margin="710,1124,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="271"/>
<Label Content="Version" HorizontalAlignment="Left" Margin="1257,1124,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="155"/>
<Rectangle HorizontalAlignment="Left" Height="3" Margin="58,1215,0,0" Stroke="#FF5D5D5D" VerticalAlignment="Top" Width="1897" Fill="#FF929292" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBox HorizontalAlignment="Left" Margin="50,1223,0,0" TextWrapping="Wrap" Text="DESKTOP-TEST" VerticalAlignment="Top" Width="318" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="434,1223,0,0" TextWrapping="Wrap" Text="clift.local" VerticalAlignment="Top" Width="213" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="710,1223,0,0" TextWrapping="Wrap" Text="Windows 11" VerticalAlignment="Top" Width="319" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1257,1223,0,0" TextWrapping="Wrap" Text="10.0.14393" VerticalAlignment="Top" Width="193" FontSize="24" BorderBrush="White"/>
<Rectangle HorizontalAlignment="Left" Height="224" Margin="37,1386,0,0" VerticalAlignment="Top" Width="1954" Fill="White" Stroke="#FF585858"/>
<Label Content="C DiskSpace FreeVsTotal" HorizontalAlignment="Left" Margin="60,1412,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="280"/>
<Label Content="Processors" HorizontalAlignment="Left" Margin="409,1412,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="148"/>
<Label Content="Manufacturer" HorizontalAlignment="Left" Margin="970,1412,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="186"/>
<Label Content="Model" HorizontalAlignment="Left" Margin="1232,1412,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="156"/>
<Rectangle HorizontalAlignment="Left" Height="3" Margin="60,1503,0,0" Stroke="#FF5D5D5D" VerticalAlignment="Top" Width="1898" Fill="#FF929292" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBox HorizontalAlignment="Left" Margin="52,1511,0,0" TextWrapping="Wrap" Text="41GB/60GB" VerticalAlignment="Top" Width="205" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="409,1511,0,0" TextWrapping="Wrap" Text="Intel(R) Core(TM) i7-3770 CPU # 3.4GHz" VerticalAlignment="Top" Width="454" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="970,1511,0,0" TextWrapping="Wrap" Text="Microsoft Corporation" VerticalAlignment="Top" Width="245" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1232,1511,0,0" TextWrapping="Wrap" Text="OptiPlex 7090" VerticalAlignment="Top" Width="318" FontSize="24" BorderBrush="White"/>
<Rectangle HorizontalAlignment="Left" Height="224" Margin="37,1665,0,0" VerticalAlignment="Top" Width="1954" Fill="White" Stroke="#FF585858"/>
<Label Content="Windows Defender" HorizontalAlignment="Left" Margin="60,1691,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="229"/>
<Label Content="NICs" HorizontalAlignment="Left" Margin="596,1691,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="106"/>
<Label Content="Uptime" HorizontalAlignment="Left" Margin="976,1691,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="136"/>
<Label Content="LocalUserCount" HorizontalAlignment="Left" Margin="1429,1691,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="200"/>
<Rectangle HorizontalAlignment="Left" Height="3" Margin="60,1782,0,0" Stroke="#FF5D5D5D" VerticalAlignment="Top" Width="1898" Fill="#FF929292" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBox HorizontalAlignment="Left" Margin="52,1790,0,0" TextWrapping="Wrap" Text="Real-Time protection: On" VerticalAlignment="Top" Width="318" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="584,1790,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="67" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="976,1790,0,0" TextWrapping="Wrap" Text="1.04:25:53" VerticalAlignment="Top" Width="319" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1429,1790,0,0" TextWrapping="Wrap" Text="7" VerticalAlignment="Top" Width="46" FontSize="24" BorderBrush="White"/>
<Label Content="Installed Memory" HorizontalAlignment="Left" Margin="1579,1124,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="251"/>
<TextBox HorizontalAlignment="Left" Margin="1579,1223,0,0" TextWrapping="Wrap" Text="8 GB" VerticalAlignment="Top" Width="317" FontSize="24" BorderBrush="White"/>
<Label Content="Logical Processors" HorizontalAlignment="Left" Margin="1654,1412,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="244"/>
<TextBox HorizontalAlignment="Left" Margin="1654,1511,0,0" TextWrapping="Wrap" Text="2" VerticalAlignment="Top" Width="52" FontSize="24" BorderBrush="White"/>
<Label Content="Processor (CPU) and Memory (RAM) Info" HorizontalAlignment="Left" Margin="17,1926,0,0" VerticalAlignment="Top" FontSize="60" Foreground="Black" Height="93" Width="1095" Background="White"/>
<Rectangle HorizontalAlignment="Left" Height="224" Margin="37,2013,0,0" VerticalAlignment="Top" Width="919" Fill="White" Stroke="#FF585858"/>
<Label Content="CPU Utilization" HorizontalAlignment="Left" Margin="48,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="196"/>
<Label Content="ClockSpeed" HorizontalAlignment="Left" Margin="256,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="143"/>
<Label Content="Processes" HorizontalAlignment="Left" Margin="446,2038,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="140"/>
<Label Content="Threads" HorizontalAlignment="Left" Margin="649,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="111"/>
<Rectangle HorizontalAlignment="Left" Height="3" Margin="48,2130,0,0" Stroke="#FF5D5D5D" VerticalAlignment="Top" Width="892" Fill="#FF929292" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBox HorizontalAlignment="Left" Margin="44,2138,0,0" TextWrapping="Wrap" Text="1%" VerticalAlignment="Top" Width="83" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="262,2138,0,0" TextWrapping="Wrap" Text="3.31GHz" VerticalAlignment="Top" Width="108" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="446,2137,0,0" TextWrapping="Wrap" Text="38" VerticalAlignment="Top" Width="50" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="649,2138,0,0" TextWrapping="Wrap" Text="490" VerticalAlignment="Top" Width="56" FontSize="24" BorderBrush="White"/>
<Rectangle HorizontalAlignment="Left" Height="224" Margin="975,2013,0,0" VerticalAlignment="Top" Width="1017" Fill="White" Stroke="#FF585858"/>
<Label Content="RAM Utilization" HorizontalAlignment="Left" Margin="988,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="192"/>
<Label Content="Total" HorizontalAlignment="Left" Margin="1199,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="88"/>
<Label Content="InUse" HorizontalAlignment="Left" Margin="1292,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="84"/>
<Label Content="Available" HorizontalAlignment="Left" Margin="1400,2038,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="116"/>
<Rectangle HorizontalAlignment="Left" Height="3" Margin="988,2130,0,0" Stroke="#FF5D5D5D" VerticalAlignment="Top" Width="987" Fill="#FF929292" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBox HorizontalAlignment="Left" Margin="982,2138,0,0" TextWrapping="Wrap" Text="7.88%" VerticalAlignment="Top" Width="81" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1193,2138,0,0" TextWrapping="Wrap" Text="16GB" VerticalAlignment="Top" Width="74" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1292,2138,0,0" TextWrapping="Wrap" Text="0.85GB" VerticalAlignment="Top" Width="86" FontSize="24" BorderBrush="White"/>
<TextBox HorizontalAlignment="Left" Margin="1400,2137,0,0" TextWrapping="Wrap" Text="7.18GB" VerticalAlignment="Top" Width="104" FontSize="24" BorderBrush="White"/>
<Label Content="Handles" HorizontalAlignment="Left" Margin="814,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="111"/>
<TextBox HorizontalAlignment="Left" Margin="821,2138,0,0" TextWrapping="Wrap" Text="13265" VerticalAlignment="Top" Width="104" FontSize="24" BorderBrush="White"/>
<Label Content="Committed" HorizontalAlignment="Left" Margin="1579,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="146"/>
<TextBox HorizontalAlignment="Left" Margin="1579,2138,0,0" TextWrapping="Wrap" Text="0.73GB" VerticalAlignment="Top" Width="104" FontSize="24" BorderBrush="White"/>
<Label Content="Cached" HorizontalAlignment="Left" Margin="1776,2039,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="116"/>
<TextBox HorizontalAlignment="Left" Margin="1776,2138,0,0" TextWrapping="Wrap" Text="0.03GB" VerticalAlignment="Top" Width="104" FontSize="24" BorderBrush="White"/>
<Wpf:CartesianChart HorizontalAlignment="Left" Margin="37,2353,0,0" VerticalAlignment="Top" Height="527" Width="919"/>
<Wpf:CartesianChart HorizontalAlignment="Left" Margin="982,2353,0,0" VerticalAlignment="Top" Height="527" Width="1006"/>
<Label Content="Network Interface Info" HorizontalAlignment="Left" Margin="35,2912,0,0" VerticalAlignment="Top" FontSize="60" Foreground="Black" Height="93" Width="743" Background="White"/>
<Rectangle HorizontalAlignment="Left" Height="161" Margin="37,3010,0,0" VerticalAlignment="Top" Width="1267" Fill="White" Stroke="#FF585858"/>
<Label Content="Name" HorizontalAlignment="Left" Margin="53,3029,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="239" Height="42"/>
<Label Content="Description" HorizontalAlignment="Left" Margin="174,3029,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="186" Height="42"/>
<Label Content="Sent" HorizontalAlignment="Left" Margin="688,3028,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="105" Height="42"/>
<Label Content="Recieved" HorizontalAlignment="Left" Margin="795,3028,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="144" Height="42"/>
<Rectangle HorizontalAlignment="Left" Height="2" Margin="53,3094,0,0" Stroke="#FF5D5D5D" VerticalAlignment="Top" Width="1229" Fill="#FF929292" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBox HorizontalAlignment="Left" Margin="46,3101,0,0" TextWrapping="Wrap" Text="Ethernet" VerticalAlignment="Top" Width="101" FontSize="24" BorderBrush="White" Height="54"/>
<TextBox HorizontalAlignment="Left" Margin="172,3099,0,0" TextWrapping="Wrap" Text="Microsoft Hyper-V Network Adapter" VerticalAlignment="Top" Width="398" FontSize="24" BorderBrush="White" Height="52"/>
<TextBox HorizontalAlignment="Left" Margin="688,3100,0,0" TextWrapping="Wrap" Text="0.01GB" VerticalAlignment="Top" Width="107" FontSize="24" BorderBrush="White" Height="54"/>
<TextBox HorizontalAlignment="Left" Margin="795,3099,0,0" TextWrapping="Wrap" Text="0.08GB" VerticalAlignment="Top" Width="130" FontSize="24" BorderBrush="White" Height="54"/>
<Label Content="DeltaSent" HorizontalAlignment="Left" Margin="933,3029,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="182" Height="42"/>
<TextBox HorizontalAlignment="Center" Margin="0,3100,0,0" TextWrapping="Wrap" Text="27.64KB" VerticalAlignment="Top" Width="130" FontSize="24" BorderBrush="White" Height="53"/>
<Label Content="DeltaReceived" HorizontalAlignment="Left" Margin="1086,3029,0,0" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Width="229" Height="42"/>
<TextBox HorizontalAlignment="Left" Margin="1086,3099,0,0" TextWrapping="Wrap" Text="57.37KB" VerticalAlignment="Top" Width="130" FontSize="24" BorderBrush="White" Height="54"/>
<Label Content="CPU Utilization %" HorizontalAlignment="Left" Margin="28,2255,0,0" VerticalAlignment="Top" FontSize="36" Foreground="Black" Height="60" Width="300" Background="White"/>
<Label Content="Memory (RAM) Utilization %" HorizontalAlignment="Left" Margin="988,2242,0,0" VerticalAlignment="Top" FontSize="36" Foreground="Black" Height="60" Width="586" Background="White"/>
<Wpf:CartesianChart HorizontalAlignment="Left" Margin="37,3268,0,0" VerticalAlignment="Top" Height="527" Width="1258"/>
<Label Content=""Ethernet" Interface Delta Sent KB" HorizontalAlignment="Left" Margin="38,3176,0,0" VerticalAlignment="Top" FontSize="36" Foreground="Black" Height="60" Width="586" Background="White"/>
</Grid>
</TabItem>
<TabItem Header="Certificates" HorizontalAlignment="Left" Margin="-880,-2,0,0" Width="120">
<TabItem.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="White"/>
<GradientStop Color="#FF4AD2FF" Offset="1"/>
</LinearGradientBrush>
</TabItem.Background>
<Grid Background="White">
<Rectangle HorizontalAlignment="Center" Height="100" Margin="0,10,0,0" VerticalAlignment="Top" Width="2000" Fill="#FF2E40A2"/>
<Label Content="Admin Center/Hardware Monitor" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" FontSize="72" Foreground="White" Height="91" Width="1911"/>
</Grid>
</TabItem>
</TabControl>
</TabControl>
</ScrollViewer>
</Window>
"#
$inputXML = $inputXML -replace 'mc:Ignorable="d"','' -replace "x:N",'N' -replace '^<Win.*', '<Window'
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
[xml]$XAML = $inputXML
#Check for a text changed value (which we cannot parse)
If ($xaml.SelectNodes("//*[#Name]") | ? TextChanged){write-error "This Snippet can't convert any lines which contain a 'textChanged' property. `n please manually remove these entries"
$xaml.SelectNodes("//*[#Name]") | ? TextChanged | % {write-warning "Please remove the TextChanged property from this entry $($_.Name)"}
return}
#Read XAML
$reader=(New-Object System.Xml.XmlNodeReader $xaml)
try{$Form=[Windows.Markup.XamlReader]::Load( $reader )}
catch [System.Management.Automation.MethodInvocationException] {
Write-Warning "We ran into a problem with the XAML code. Check the syntax for this control..."
write-host $error[0].Exception.Message -ForegroundColor Red
if ($error[0].Exception.Message -like "*button*"){
write-warning "Ensure your <button in the `$inputXML does NOT have a Click=ButtonClick property. PS can't handle this`n`n`n`n"}
}
catch{#if it broke some other way :D
Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
}
#===========================================================================
# Store Form Objects In PowerShell
#===========================================================================
$xaml.SelectNodes("//*[#Name]") | %{Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name)}
Function Get-FormVariables{
if ($global:ReadmeDisplay -ne $true){Write-host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow;$global:ReadmeDisplay=$true}
write-host "Found the following interactable elements from our form" -ForegroundColor Cyan
get-variable WPF*
}
Get-FormVariables
#===========================================================================
# Use this space to add code to the various form elements in your GUI
#===========================================================================
#===========================================================================
# Shows the form
#===========================================================================
$Form.ShowDialog() | Out-Null
Related
How to get country list as autocomplete for combobox in XAML
I am working on a project using XAML with PowerShell, this is my first project using XAML. I have a form where user enters a country name and Combobox should autocomplete the country name. I am not able to achieve this. XAML code for Combobox I am using as below CountryList - I am picking it from a csv file and CountryList is the Header column. It's not working for me. Any help on this, please? I am using PowerShell script. <ComboBox Name="country" HorizontalAlignment="Left" Height="32" Margin="194,227,0,0" VerticalAlignment="Top" Width="330" FontSize="16" VerticalContentAlignment="Center" IsEditable="True" IsTextSearchEnabled="True" TextSearch.TextPath="countryList" ItemsSource=" {Binding countryList}"/> I get the result like this. Combobox XAML code: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="GreenLake FlexCapacity" Height="500" Width="850"> <Grid> <TextBox Name="ASM" HorizontalAlignment="Left" Height="32" Margin="194,48,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330" FontSize="16"/> <TextBox Name="email" HorizontalAlignment="Left" Height="32" Margin="194,104,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330" FontSize="16"/> <TextBox Name="company" HorizontalAlignment="Left" Height="32" Margin="194,165,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330" FontSize="16"/> <ComboBox Name="country" HorizontalAlignment="Left" Height="32" Margin="194,227,0,0" VerticalAlignment="Top" Width="330" FontSize="16" VerticalContentAlignment="Center" IsEditable="True" IsTextSearchEnabled="True" TextSearch.TextPath="countryList"/> <TextBlock Name="ASM_name" HorizontalAlignment="Left" Height="26" Margin="102,54,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="92" FontSize="16" RenderTransformOrigin="0.864,0.918"><Run Text="ASM Name"/><LineBreak/><Run/></TextBlock> <TextBlock Name="ASM_email" HorizontalAlignment="Left" Height="26" Margin="102,110,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="92" FontSize="16" RenderTransformOrigin="0.864,0.918"><Run Text="ASM Email"/><LineBreak/><Run/></TextBlock> <TextBlock Name="company_name" HorizontalAlignment="Left" Height="26" Margin="66,171,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="128" FontSize="16" RenderTransformOrigin="0.864,0.918"><Run Text="Company Name"/><LineBreak/><Run/></TextBlock> <TextBlock Name="country_name" HorizontalAlignment="Left" Height="26" Margin="124,226,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="65" FontSize="16" RenderTransformOrigin="0.864,0.918" Text="Country"/> <Button Name="create" Content="Create ID" HorizontalAlignment="Left" Height="34" Margin="194,281,0,0" VerticalAlignment="Top" Width="164" FontSize="16"/> <Button Name="cancel" Content="Cancel" HorizontalAlignment="Left" Height="34" Margin="381,281,0,0" VerticalAlignment="Top" Width="143" FontSize="16"/> <TextBlock Name="Cust_ID" HorizontalAlignment="Left" Height="48" Margin="159,348,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="389" FontSize="18" FontWeight="Bold"/> </Grid> </Window> CSV file saved here Code from PowerShell script: $country = $window.findname("country") $countryList = Import-Csv -Path "C:\Country-codes.csv" | Select-Object -ExpandProperty 'Country Name' | Out-String $country.ItemsSource = $countryList
Using what you have given me, I removed the following parts: TextSearch.TextPath="countryList" from the combobox in XAML Removed Out-String from your CSV import This is what I'm using: Add-Type -AssemblyName PresentationFramework, System.Drawing, System.Windows.Forms, WindowsFormsIntegration [xml]$xaml = #" <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="GreenLake FlexCapacity" Height="500" Width="850"> <Grid> <TextBox Name="ASM" HorizontalAlignment="Left" Height="32" Margin="194,48,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330" FontSize="16"/> <TextBox Name="email" HorizontalAlignment="Left" Height="32" Margin="194,104,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330" FontSize="16"/> <TextBox Name="company" HorizontalAlignment="Left" Height="32" Margin="194,165,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330" FontSize="16"/> <ComboBox Name="country" HorizontalAlignment="Left" Height="32" Margin="194,227,0,0" VerticalAlignment="Top" Width="330" FontSize="16" VerticalContentAlignment="Center" IsEditable="True" IsTextSearchEnabled="True"/> <TextBlock Name="ASM_name" HorizontalAlignment="Left" Height="26" Margin="102,54,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="92" FontSize="16" RenderTransformOrigin="0.864,0.918"><Run Text="ASM Name"/><LineBreak/><Run/></TextBlock> <TextBlock Name="ASM_email" HorizontalAlignment="Left" Height="26" Margin="102,110,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="92" FontSize="16" RenderTransformOrigin="0.864,0.918"><Run Text="ASM Email"/><LineBreak/><Run/></TextBlock> <TextBlock Name="company_name" HorizontalAlignment="Left" Height="26" Margin="66,171,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="128" FontSize="16" RenderTransformOrigin="0.864,0.918"><Run Text="Company Name"/><LineBreak/><Run/></TextBlock> <TextBlock Name="country_name" HorizontalAlignment="Left" Height="26" Margin="124,226,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="65" FontSize="16" RenderTransformOrigin="0.864,0.918" Text="Country"/> <Button Name="create" Content="Create ID" HorizontalAlignment="Left" Height="34" Margin="194,281,0,0" VerticalAlignment="Top" Width="164" FontSize="16"/> <Button Name="cancel" Content="Cancel" HorizontalAlignment="Left" Height="34" Margin="381,281,0,0" VerticalAlignment="Top" Width="143" FontSize="16"/> <TextBlock Name="Cust_ID" HorizontalAlignment="Left" Height="48" Margin="159,348,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="389" FontSize="18" FontWeight="Bold"/> </Grid> </Window> "# $reader=(New-Object System.Xml.XmlNodeReader $xaml) $window=[Windows.Markup.XamlReader]::Load($reader) $country = $window.FindName("country") $countryList = Import-Csv -Path C:\Users\harwoodm\Desktop\Country-codes.csv | Select-Object -ExpandProperty "Country Name" $country.ItemsSource = $countryList $window.ShowDialog() | Out-Null And this is a screenshot of the form in action:
Orientation of WPF status bar and label are in wrong place when the window is maximised
In my serial port WPF application , the labels (BaudRate,Parity,DataBits and stopBit) and the StatusBar (for displaying PortStatus) are in wrong place when I maximise the window. I would like to have suggestion from expertise to resolve my issue. So please let me know if I can make any changes/edit on my xaml file to have these orientation on the same place as it is in Normal window mode. <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:SerialReadAndWrite" xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="ATR220ReadAndWrite.MainWindow" mc:Ignorable="d" Title="ATR220ReadAndWrite" Height="450" Width="800"> <Grid Margin="0,0,-71,-107"> <ComboBox x:Name="ComPortComboBox" HorizontalAlignment="Left" Height="14" Margin="115,20,0,0" VerticalAlignment="Top" Width="98" SelectionChanged="ComPort_SelectionChanged" DropDownOpened="ComPort_DropDownOpened" VerticalContentAlignment="Stretch" IsSynchronizedWithCurrentItem="False" FontSize="9" FontFamily="Arial"/> <Label Content="PortNumber :" HorizontalAlignment="Left" Margin="21,14,0,0" VerticalAlignment="Top"/> <Label Content="PortSettings :" HorizontalAlignment="Left" Margin="21,58,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.546,3.143" FontSize="10" FontFamily="Arial"/> <Image HorizontalAlignment="Left" Height="26" Margin="359,14,0,0" VerticalAlignment="Top" Width="29" RenderTransformOrigin="-0.23,0.36"/> <ComboBox x:Name="BaudRateComboBox" HorizontalAlignment="Left" Margin="115,84,0,0" VerticalAlignment="Top" Width="98" Height="17" SelectionChanged="BaudRate_SelectionChanged" IsEnabled="False" IsReadOnly="True" FontSize="9" FontFamily="Arial"> <System:String>115200</System:String> <System:String>57600</System:String> <System:String>38400</System:String> <System:String>19200</System:String> <System:String>14400</System:String> <System:String>9600</System:String> <System:String>4800</System:String> </ComboBox> <ComboBox x:Name="ParityComboBox" HorizontalAlignment="Left" Height="17" Margin="308,86,0,0" VerticalAlignment="Top" Width="98" SelectionChanged="Parity_SelectionChanged" IsEnabled="False" FontSize="9" FontFamily="Arial"> <System:String>Even</System:String> <System:String>Mark</System:String> <System:String>None</System:String> <System:String>Odd</System:String> <System:String>Space</System:String> </ComboBox> <ComboBox x:Name="DataBitsComboBox" HorizontalAlignment="Left" Height="17" Margin="115,125,0,0" VerticalAlignment="Top" Width="98" SelectionChanged="DataBits_SelectionChanged" IsEnabled="False" FontSize="8" FontFamily="Arial"> <System:String>5</System:String> <System:String>6</System:String> <System:String>7</System:String> <System:String>8</System:String> </ComboBox> <ComboBox x:Name="StopBitsComboBox" HorizontalAlignment="Left" Height="17" Margin="308,123,0,0" VerticalAlignment="Top" Width="98" SelectionChanged="StopBits_SelectionChanged" IsEnabled="False" FontSize="10" FontFamily="Arial"> <System:String>One</System:String> <System:String>Two</System:String> <System:String>OnePointFive</System:String> </ComboBox> <Label Content="Baudrate :" HorizontalAlignment="Center" Margin="47,81,753,423" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Height="22" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="10" FontStyle="Italic" Width="63"/> <Label Content="Parity :" HorizontalAlignment="Center" Margin="234,81,573,423" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Height="22" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="10" FontStyle="Italic" Width="56"/> <Label Content="DataBits :" HorizontalAlignment="Center" Margin="48,123,753,382" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Height="22" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="10" FontStyle="Italic" Width="62"/> <Label Content="StopBit :" HorizontalAlignment="Center" Margin="238,123,567,382" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Height="22" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontSize="10" FontStyle="Italic" Width="58"/> <Button x:Name="ConnectButton" Content="Connect" HorizontalAlignment="Left" Margin="308,20,0,0" VerticalAlignment="Top" Width="75" Click="ConnectButton_Click" IsEnabled="False" Height="14" FontSize="10" FontFamily="Arial"/> <Label Content="ProtocolCustomWndow :" HorizontalAlignment="Left" Margin="21,172,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.546,3.143" FontSize="10" FontFamily="Arial"/> <ComboBox x:Name="ProtocolTypeComboBox" HorizontalAlignment="Left" Height="14" Margin="141,177,0,0" VerticalAlignment="Top" Width="98" SelectionChanged="ProtocolTypeComboBox_SelectionChanged" VerticalContentAlignment="Stretch" IsReadOnly="True" IsSynchronizedWithCurrentItem="True" FontSize="9" FontFamily="Arial" IsEnabled="False"> <System:String>WLink</System:String> </ComboBox> ***<StatusBar HorizontalAlignment="Left" Height="28" Margin="0,396,0,0" VerticalAlignment="Top" Width="794"> <StatusBarItem FontSize="9" FontFamily="Arial" TextOptions.TextHintingMode="Fixed"> <TextBlock Name= "PortStatus"/> </StatusBarItem> </StatusBar>*** </Grid> </Window> Images of the correct and wrong pics are attached. wrong position Wrong Position Correct position Correct position
Try something like this: <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <TextBlock Text="PortNumber :" HorizontalAlignment="Center"/> <ComboBox FontSize="9" FontFamily="Arial" Grid.Column="1"> <ComboBoxItem IsSelected="True">COM 3</ComboBoxItem> </ComboBox> <Button Content="Connect" Grid.Row="0" Grid.Column="3"></Button> <TextBlock Text="PortSettings :" FontSize="10" FontFamily="Arial" Grid.Row="1" HorizontalAlignment="Center"/> <TextBlock Text="Baudrate :" FontStyle="Italic" Grid.Row="2" HorizontalAlignment="Center"/> <ComboBox IsEnabled="False" IsReadOnly="True" FontSize="9" FontFamily="Arial" Grid.Row="2" Grid.Column="1"> <System:String>115200</System:String> <System:String>57600</System:String> <System:String>38400</System:String> <System:String>19200</System:String> <System:String>14400</System:String> <System:String>9600</System:String> <System:String>4800</System:String> </ComboBox> <TextBlock Text="Parity :" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Center"/> <ComboBox Grid.Row="2" Grid.Column="3"/> </Grid> Pay special attention to use of Grid.Row and Grid.Column, you will need to set the Horizontal Alignment on these elements but this will show you how to position things in WPF.
Textbox Border Not Showing - WPF
The textbox top and bottom border is not showing. I have provided the entire XAML code for the main window. I have tried increasing the BorderThickness and also changed the BorderBrush. That did not work. XAML: <Window x:Class="WpfApplication6.Window1" 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:WpfApplication6" mc:Ignorable="d" Title="Activation Window" Height="300" Width="518.797"> <Grid> <TextBox x:Name="txtFirstDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="23,171,0,76" BorderThickness="1" BorderBrush="Black" /> <TextBox x:Name="txtSecondDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="81,171,0,76"/> <TextBox x:Name="txtThirdDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="138,171,0,76"/> <TextBox x:Name="txtFourthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="195,171,0,76"/> <TextBox x:Name="txtFifthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="252,171,0,76"/> <Label x:Name="label" Content="Product key:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,142,0,0"/> <TextBox x:Name="txtFirstDigit_Copy" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="274" Margin="23,111,0,136" /> <Label x:Name="label_Copy" Content="Email:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,81,0,0"/> <TextBox x:Name="txtFirstDigit_Copy1" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="23,55,0,192" /> <Label x:Name="label_Copy1" Content="First Name:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,25,0,0"/> <TextBox x:Name="txtFirstDigit_Copy2" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="167,55,0,192" /> <Button x:Name="button" Content="Next" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="142,220,0,0"/> <Button x:Name="button1" Content="Cancel" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="222,220,0,0" Click="button1_Click"/> <TextBlock x:Name="textBlock" HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Margin="350,147,0,0"/> </Grid> </Window>
I'd try something like this: <Grid> <Grid.RowDefinitions> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition> </Grid.RowDefinitions> <Label x:Name="label_Copy1" Grid.Row="0" Content="First Name:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,0,0,0" /> <StackPanel Orientation="Horizontal" Grid.Row="1"> <TextBox x:Name="txtFirstDigit_Copy1" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="23,0,0,0" /> <TextBox x:Name="txtFirstDigit_Copy2" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="11.5,0,0,0" /> </StackPanel> <Label x:Name="label_Copy" Grid.Row="2" Content="Email:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,0,0,0" /> <TextBox x:Name="txtFirstDigit_Copy" Grid.Row="3" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="270" Margin="23,0,0,0" /> <Label x:Name="label" Grid.Row="4" Content="Product key:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,0,0,0" /> <StackPanel Orientation="Horizontal" Grid.Row="5"> <TextBox x:Name="txtFirstDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="23,0,0,0" BorderThickness="1" /> <TextBox x:Name="txtSecondDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" /> <TextBox x:Name="txtThirdDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" /> <TextBox x:Name="txtFourthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" /> <TextBox x:Name="txtFifthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" /> </StackPanel> <StackPanel Orientation="Horizontal" Grid.Row="6"> <Button x:Name="button" Content="Next" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="132,0,0,0" /> <Button x:Name="button1" Content="Cancel" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="11.5,0,0,0" /> </StackPanel> </Grid>
Could not find windows runtime type windows.UI.Xaml.Tickbar
After running my program on my device I get the error Could not find windows runtime type windows.UI.Xaml.Tickbar in my xaml. I have overlooked the Xaml many times but I can't see any error in it I hope the people from Stackoverflow can help me The piece of xaml where the error is in: <DataTemplate> <ScrollViewer Height="543" Margin="0,0,-0.167,0" HorizontalScrollMode="Disabled" VerticalScrollMode="Auto" > <Grid Height="708" Name="ProfileContent"> <Image x:Name="ProfileImage" HorizontalAlignment="Left" Height="149" Margin="10,10,0,0" VerticalAlignment="Top" Width="143" Source="{Binding image}" Stretch="Fill"/> <Button x:Name="BtnChangePic" Content="Change" HorizontalAlignment="Left" Margin="175,0,0,0" VerticalAlignment="Top" Click="BtnChangePic_Click" Width="156" x:Uid="BtnChangePic"/> <TextBox HorizontalAlignment="Left" Margin="109,180,0,0" TextWrapping="Wrap" Text="{Binding name, Mode=TwoWay}" VerticalAlignment="Top" Width="222"/> <TextBlock x:Name="TBlockName" HorizontalAlignment="Left" Margin="10,195,0,0" TextWrapping="Wrap" x:Uid="TBlockName" Text="Name" VerticalAlignment="Top" FontSize="20"/> <TextBox HorizontalAlignment="Left" Margin="109,224,0,0" TextWrapping="Wrap" Text="{Binding location[4], Mode=TwoWay}" VerticalAlignment="Top" Width="222" Height="39"/> <TextBlock x:Name="TBlockLand" HorizontalAlignment="Left" Margin="10,245,0,0" TextWrapping="Wrap" Text="Land" VerticalAlignment="Top" FontSize="20" x:Uid="TBlockLand"/> <Button x:Name="BtnImgDel" Content="Delete" HorizontalAlignment="Left" Margin="175,62,0,0" VerticalAlignment="Top" Click="BtnImgDel_Click" Width="156" x:Uid="BtnImgDel"/> <TextBlock x:Name="Seo_name" HorizontalAlignment="Left" Margin="289,10,0,0" TextWrapping="Wrap" Text="{Binding seo_name}" VerticalAlignment="Top" Opacity="0"/> <TextBox HorizontalAlignment="Left" Margin="109,268,0,0" TextWrapping="Wrap" Text="{Binding location[3], Mode=TwoWay}" VerticalAlignment="Top" Width="222" Height="39"/> <TextBox HorizontalAlignment="Left" Margin="109,312,0,0" TextWrapping="Wrap" Text="{Binding location[2], Mode=TwoWay}" VerticalAlignment="Top" Width="222" Height="39"/> <TextBlock x:Name="TBlockProvincie" HorizontalAlignment="Left" Margin="10,289,0,0" TextWrapping="Wrap" Text="Provincie" VerticalAlignment="Top" FontSize="20" x:Uid="TBlockProvincie"/> <TextBlock x:Name="TBlockCity" HorizontalAlignment="Left" Margin="10,327,0,0" TextWrapping="Wrap" Text="Stad" VerticalAlignment="Top" FontSize="20" x:Uid="TBlockCity"/> <TextBlock x:Name="TBlockStreet" HorizontalAlignment="Left" Margin="10,371,0,0" TextWrapping="Wrap" Text="Straat" VerticalAlignment="Top" FontSize="20" x:Uid="TBlockStreet"/> <TextBox HorizontalAlignment="Left" Margin="109,356,0,0" TextWrapping="Wrap" Text="{Binding location[1], Mode=TwoWay}" VerticalAlignment="Top" Width="222" Height="39"/> <TextBlock x:Name="TBlockHouseNumber" HorizontalAlignment="Left" Margin="10,400,0,0" TextWrapping="Wrap" Text="Huisnummer" VerticalAlignment="Top" FontSize="20" Width="94"/> <TextBox HorizontalAlignment="Left" Margin="109,400,0,0" TextWrapping="Wrap" Text="{Binding location[0], Mode=TwoWay}" VerticalAlignment="Top" Width="222" Height="39" x:Uid="TBlockHouseNumber"/> <TextBlock HorizontalAlignment="Left" Margin="10,459,0,0" TextWrapping="Wrap" Text="Telefoon" VerticalAlignment="Top" FontSize="20"/> <TextBox HorizontalAlignment="Left" Margin="109,444,0,0" TextWrapping="Wrap" Text="{Binding phone, Mode=TwoWay}" VerticalAlignment="Top" Width="222" Height="39"/> <TextBlock x:Name="TBlockHide" HorizontalAlignment="Left" Margin="10,500,0,0" TextWrapping="Wrap" Text="Verbergen" VerticalAlignment="Top" FontSize="20" x:Uid="TBlockHide"/> <CheckBox Content="" HorizontalAlignment="Left" Margin="116,484,0,0" VerticalAlignment="Top" Height="55" IsChecked="{Binding hidephone, Mode=TwoWay}"/> <Button x:Name="BtnSaveProfile" Content="Button" HorizontalAlignment="Left" Margin="10,551,0,0" VerticalAlignment="Top" Width="321"/> </Grid> </ScrollViewer> </DataTemplate> Thank you
Found the error in my Xaml after deleting all the X:Uid codes the problems was fixed. Thank you Physikbuddha for helping
PivotItem ScrollViewer can't scroll down
PivotItem ScrollViewer can't scroll down For whatever the reason just won't scroll down when content that is bound inside the pivot item is longer than the height of the page. I tried adding a grid inside the pivotitem with height set to auto, but to no avail. <controls:PivotItem> <controls:PivotItem.Header> <Grid> <TextBlock Name="TextBlockPropertyDetail" FontSize="31" Text="Property Detail" /> </Grid> </controls:PivotItem.Header> <ScrollViewer> <Grid Height="Auto"> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,41,0,0" Name="textBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,77,0,0" Name="textBlock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,113,0,0" Name="textBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,149,0,0" Name="textBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,185,0,0" Name="textBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" Margin="12,221,279,0" Name="textBlock7" Text="Insured" VerticalAlignment="Top" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,257,0,0" Name="textBlock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,293,0,0" Name="textBlock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,329,0,0" Name="textBlock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,365,0,0" Name="textBlock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="Black" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,5,0,0" Name="tbkPropertyId" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,41,0,0" Name="tbkCounty" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,77,0,0" Name="tbkParcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,113,0,0" Name="tbkMarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,149,0,0" Name="tbkDocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,185,0,0" Name="tbkValueRange" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,221,0,0" Name="tbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,257,0,0" Name="tbkCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,293,0,0" Name="tbkRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,329,0,0" Name="tbkRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,365,0,0" Name="tbkRecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" /> </Grid> </ScrollViewer> </controls:PivotItem> Thanks for any advice.
Use the Stackpanel in the grid Element and try this. <controls:Pivot Title="MY APPLICATION"> <!--Pivot item one--> <controls:PivotItem Header="first" Height="580" > <!--Double line list with text wrapping--> <ScrollViewer> <Grid> <StackPanel> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" Margin="12,5,279,0" Name="textBlock7" Text="Insured" VerticalAlignment="Top" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-385,0,0" Name="tbkPropertyId" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-350,0,0" Name="tbkCounty" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-315,0,0" Name="tbkParcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-275,0,0" Name="tbkMarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-240,0,0" Name="tbkDocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-205,0,0" Name="tbkValueRange" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-170,0,0" Name="tbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-135,0,0" Name="tbkCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-100,0,0" Name="tbkRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-65,0,0" Name="tbkRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-30,0,0" Name="tbkRecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlsock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlocsk7" Text="Insured" VerticalAlignment="Top" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlsock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBsock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="White" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-380,0,0" Name="tbkPropsertyId" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-345,0,0" Name="tbkCosunty" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-310,0,0" Name="tbkPasrcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-275,0,0" Name="tbkMsarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-240,0,0" Name="tbkDsocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-205,0,0" Name="s" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-170,0,0" Name="tsbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-135,0,0" Name="tbskCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-100,0,0" Name="tbskRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-70,0,0" Name="tbksRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" /> <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-35,0,0" Name="tbkRsecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" /> </StackPanel> </Grid> </ScrollViewer> </controls:PivotItem> </controls:Pivot> And I hope you will get the Solution.