Adds browse button for Office configuration file

Implements the click handler for the browse button associated with the Office configuration XML file path.

This change enables users to select the configuration file via a file dialog, automatically populating the path into the text field and improving usability.
This commit is contained in:
rbalsleyMSFT
2025-07-16 14:09:16 -07:00
parent 906f73f303
commit bc32a8a10e
2 changed files with 11 additions and 0 deletions
@@ -553,6 +553,16 @@ function Register-EventHandlers {
}
})
$State.Controls.btnBrowseOfficeConfigXMLFile.Add_Click({
param($eventSource, $routedEventArgs)
$window = [System.Windows.Window]::GetWindow($eventSource)
$localState = $window.Tag
$selectedPath = Invoke-BrowseAction -Type 'OpenFile' -Title "Select Office Configuration XML File" -Filter "XML files (*.xml)|*.xml"
if ($selectedPath) {
$localState.Controls.txtOfficeConfigXMLFilePath.Text = $selectedPath
}
})
$State.Controls.chkInstallOffice.Add_Checked({
param($eventSource, $routedEventArgs)
$window = [System.Windows.Window]::GetWindow($eventSource)
@@ -118,6 +118,7 @@ function Initialize-UIControls {
$State.Controls.txtProductKey = $window.FindName('txtProductKey')
$State.Controls.txtOfficePath = $window.FindName('txtOfficePath')
$State.Controls.txtOfficeConfigXMLFilePath = $window.FindName('txtOfficeConfigXMLFilePath')
$State.Controls.btnBrowseOfficeConfigXMLFile = $window.FindName('btnBrowseOfficeConfigXMLFile')
$State.Controls.txtDriversFolder = $window.FindName('txtDriversFolder')
$State.Controls.txtPEDriversFolder = $window.FindName('txtPEDriversFolder')
$State.Controls.chkCopyPEDrivers = $window.FindName('chkCopyPEDrivers')