I found some excellent topics here, but can't find the answer. I am creating a GUI using Visual Studio and copying / pasting XAML into PowerShell. I know that I have to do this in C #, but since my knowledge is not there yet, this is pure PowerShell for me.
So, I have my GUI, but I canβt fill in my data fields. Doing other things, such as text fields, was feasible, but I can't get this listview / data table to fill in the values.

At this point, the connection to Azure is removed until I can solve this problem by adding items to my list.
Xaml to draw my form
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') [xml]$XAML = @' <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:Azure" Title="Azure Accelerator" Height="300" Width="315"> <Grid Margin="0,0,174,0"> <Image Name="image" HorizontalAlignment="Left" Height="46" Margin="10,10,-97,0" VerticalAlignment="Top" Width="210" Source="C:\Users\stephen\Dropbox\My Code\Powershell\WPF\mslogo.png"/> <TextBlock Name="textBlock" HorizontalAlignment="Left" Height="21" Margin="10,61,-140,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="248" Text="VM PickerUse"/> <Button Name="btnOK" Content="OK" HorizontalAlignment="Left" Margin="217,268,-160,0" VerticalAlignment="Top" Width="75" Height="23"/> <Button Name="btnExit" Content="Cancel" HorizontalAlignment="Left" Margin="12,268,0,0" VerticalAlignment="Top" Width="75" Height="23"/> <ListView Name="listView" HorizontalAlignment="Left" Height="108" Margin="12,107,-140,0" VerticalAlignment="Top" Width="246"> <ListView.View> <GridView> <GridViewColumn Header="VMName" DisplayMemberBinding ="{Binding VMName}"/> <GridViewColumn Header="Status" DisplayMemberBinding ="{Binding Status}"/> <GridViewColumn Header="Other"/> </GridView> </ListView.View> </ListView> </Grid> </Window> '@
Load XAML into memory / create objects
#Read XAML $reader=(New-Object System.Xml.XmlNodeReader $xaml) try{$Form=[Windows.Markup.XamlReader]::Load( $reader )} catch{Write-Host "Unable to load Windows.Markup.XamlReader. Some possible causes for this problem include: .NET Framework is missing PowerShell must be launched with PowerShell -sta, invalid XAML code was encountered."}
Where I probably need help
#Try to setup a dummy entry $vmpicklistView.items.Add( @{'VMName'='1';Status="AccessDenied";'Other'='1'})
As you can see from my screenshot, when I added the binding to the columns (which, as I thought, instantiated the columns and allowed me to insert values ββfor them ... nope), they no longer update when I try to add a new item. However, the Other column, to which I did not apply the binding, at least shows someput, but it does not list Collection correctly, as if it is trying to display the entire hash table.
So my last question is how to add items to the list?