mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-13 18:07:20 -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:
+778
-764
File diff suppressed because it is too large
Load Diff
@@ -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'
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +280,9 @@ function Initialize-UIControls {
|
||||
# Settings page
|
||||
$State.Controls.cmbThemeMode = $window.FindName('cmbThemeMode')
|
||||
|
||||
# Shared page shell
|
||||
$State.Controls.txtPageTitle = $window.FindName('txtPageTitle')
|
||||
|
||||
# Navigation controls
|
||||
$State.Controls.lstNavigation = $window.FindName('lstNavigation')
|
||||
$State.Controls.lstNavSettings = $window.FindName('lstNavSettings')
|
||||
@@ -473,9 +476,20 @@ function Initialize-UIDefaults {
|
||||
}
|
||||
}
|
||||
|
||||
# Set default navigation selection to Home and show the Home page
|
||||
# Set default navigation selection to Home and initialize the shared page title
|
||||
if ($null -ne $State.Controls.lstNavigation) {
|
||||
$State.Controls.lstNavigation.SelectedIndex = 0
|
||||
|
||||
# Keep the shell header aligned with the selected navigation item on first render
|
||||
if ($null -ne $State.Controls.txtPageTitle) {
|
||||
$selectedNavigationItem = $State.Controls.lstNavigation.SelectedItem
|
||||
if ($null -ne $selectedNavigationItem -and -not [string]::IsNullOrWhiteSpace([string]$selectedNavigationItem.Tag)) {
|
||||
$State.Controls.txtPageTitle.Text = [string]$selectedNavigationItem.Tag
|
||||
}
|
||||
else {
|
||||
$State.Controls.txtPageTitle.Text = 'Home'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Set initial state for Office panel visibility
|
||||
|
||||
Reference in New Issue
Block a user