This commit is contained in:
Mikael Karlsson
2021-07-12 20:24:27 +10:00
parent 06688e7193
commit fb46337f98
31 changed files with 907 additions and 182 deletions

View File

@@ -12,7 +12,7 @@ This module handles the WPF UI
function Get-ModuleVersion
{
'3.1.3'
'3.1.4'
}
function Start-CoreApp
@@ -914,14 +914,17 @@ function Add-SettingCheckBox
function Add-SettingComboBox
{
param($id, $value, $itemsData)
param($id, $value, $settingObj)
$nameProp = ?? $settingObj.DisplayMemberPath "Name"
$valueProp = ?? $settingObj.SelectedValuePath "Value"
$xaml = @"
<ComboBox $wpfNS Name="$($id)" DisplayMemberPath="Name" SelectedValuePath="ClientId" />
<ComboBox $wpfNS Name="$($id)" DisplayMemberPath="$($nameProp)" SelectedValuePath="$($valueProp)" />
"@
$xamlObj = [Windows.Markup.XamlReader]::Parse($xaml)
$xamlObj.ItemsSource = $itemsData
$xamlObj.ItemsSource = $settingObj.ItemsSource
if($value)
{
$xamlObj.SelectedValue = $value
@@ -979,7 +982,7 @@ function Add-SettingValue
}
elseif($settingValue.Type -eq "List")
{
$settingObj = Add-SettingComboBox $id $value $settingValue.ItemsSource
$settingObj = Add-SettingComboBox $id $value $settingValue
}
else
{