mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Improves UI structure with a shared page shell and dynamic titles
Wraps the application's content area in a stylized border and introduces a centralized, dynamic page header to provide a more cohesive look. - Adds `Tag` attributes to navigation list items to define each view's display title - Implements event handlers to automatically update the header text based on user navigation - Removes redundant embedded titles from individual content pages to streamline the layouts
This commit is contained in:
@@ -117,6 +117,14 @@ function Register-EventHandlers {
|
||||
if ($selectedIndex -lt $localState.Controls.navigationPages.Count) {
|
||||
$localState.Controls.navigationPages[$selectedIndex].Visibility = 'Visible'
|
||||
}
|
||||
|
||||
# Update the shared page title to match the selected navigation item
|
||||
if ($null -ne $localState.Controls.txtPageTitle) {
|
||||
$selectedNavigationItem = $eventSource.SelectedItem
|
||||
if ($null -ne $selectedNavigationItem -and -not [string]::IsNullOrWhiteSpace([string]$selectedNavigationItem.Tag)) {
|
||||
$localState.Controls.txtPageTitle.Text = [string]$selectedNavigationItem.Tag
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -145,6 +153,17 @@ function Register-EventHandlers {
|
||||
if ($null -ne $localState.Controls.pageSettings) {
|
||||
$localState.Controls.pageSettings.Visibility = 'Visible'
|
||||
}
|
||||
|
||||
# Update the shared page title to match the selected navigation item
|
||||
if ($null -ne $localState.Controls.txtPageTitle) {
|
||||
$selectedNavigationItem = $eventSource.SelectedItem
|
||||
if ($null -ne $selectedNavigationItem -and -not [string]::IsNullOrWhiteSpace([string]$selectedNavigationItem.Tag)) {
|
||||
$localState.Controls.txtPageTitle.Text = [string]$selectedNavigationItem.Tag
|
||||
}
|
||||
else {
|
||||
$localState.Controls.txtPageTitle.Text = 'Settings'
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user