mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Improve architecture handling for msstore applications
Refactors the application download logic to correctly handle packages from the 'msstore' source, which does not support architecture specification. - The download process no longer passes an architecture parameter for msstore apps. - The architecture selection dropdown in the UI is now disabled for msstore apps to prevent invalid configurations. - Imported or searched msstore apps will display 'NA' for their architecture.
This commit is contained in:
@@ -411,7 +411,7 @@ function Initialize-DynamicUIElements {
|
||||
$comboBoxFactory = New-Object System.Windows.FrameworkElementFactory([System.Windows.Controls.ComboBox])
|
||||
|
||||
# The ItemsSource for the ComboBox
|
||||
$availableArchitectures = @('x86', 'x64', 'arm64', 'x86 x64')
|
||||
$availableArchitectures = @('x86', 'x64', 'arm64', 'x86 x64', 'NA')
|
||||
$comboBoxFactory.SetValue([System.Windows.Controls.ItemsControl]::ItemsSourceProperty, $availableArchitectures)
|
||||
|
||||
# Bind the text property to the 'Architecture' property of the data item.
|
||||
@@ -420,6 +420,18 @@ function Initialize-DynamicUIElements {
|
||||
$binding.Mode = [System.Windows.Data.BindingMode]::TwoWay
|
||||
$comboBoxFactory.SetBinding([System.Windows.Controls.ComboBox]::TextProperty, $binding)
|
||||
|
||||
# Create a style to disable the ComboBox for 'msstore' source
|
||||
$comboBoxStyle = New-Object System.Windows.Style
|
||||
$comboBoxStyle.TargetType = [System.Windows.Controls.ComboBox]
|
||||
|
||||
$dataTrigger = New-Object System.Windows.DataTrigger
|
||||
$dataTrigger.Binding = New-Object System.Windows.Data.Binding("Source")
|
||||
$dataTrigger.Value = "msstore"
|
||||
$dataTrigger.Setters.Add((New-Object System.Windows.Setter([System.Windows.Controls.ComboBox]::IsEnabledProperty, $false)))
|
||||
|
||||
$comboBoxStyle.Triggers.Add($dataTrigger)
|
||||
$comboBoxFactory.SetValue([System.Windows.FrameworkElement]::StyleProperty, $comboBoxStyle)
|
||||
|
||||
$archCellTemplate.VisualTree = $comboBoxFactory
|
||||
$archColumn.CellTemplate = $archCellTemplate
|
||||
$wingetGridView.Columns.Add($archColumn)
|
||||
|
||||
Reference in New Issue
Block a user