mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
fix settings ui issue
This commit is contained in:
@@ -406,6 +406,15 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
|||||||
return string.Join(System.Environment.NewLine, lines);
|
return string.Join(System.Environment.NewLine, lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Refreshes the ColorTemperature property binding to force UI re-evaluation.
|
||||||
|
/// Called after AvailableColorPresets is populated to sync ComboBox selection.
|
||||||
|
/// </summary>
|
||||||
|
public void RefreshColorTemperatureBinding()
|
||||||
|
{
|
||||||
|
OnPropertyChanged(nameof(ColorTemperature));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a color temperature preset item for VCP code 0x14
|
/// Represents a color temperature preset item for VCP code 0x14
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -327,9 +327,12 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
// Sort by VCP value for consistent ordering
|
// Sort by VCP value for consistent ordering
|
||||||
presetList = presetList.OrderBy(p => p.VcpValue).ToList();
|
presetList = presetList.OrderBy(p => p.VcpValue).ToList();
|
||||||
|
|
||||||
// Create new collection and assign it - this triggers property setter
|
// Create new collection and assign it
|
||||||
// which will call UpdateSelectedColorPresetFromTemperature() to sync the selection
|
|
||||||
monitor.AvailableColorPresets = new ObservableCollection<MonitorInfo.ColorPresetItem>(presetList);
|
monitor.AvailableColorPresets = new ObservableCollection<MonitorInfo.ColorPresetItem>(presetList);
|
||||||
|
|
||||||
|
// Refresh ColorTemperature binding to force ComboBox to re-evaluate SelectedValue
|
||||||
|
// and match it against the newly populated AvailableColorPresets
|
||||||
|
monitor.RefreshColorTemperatureBinding();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user