void WindowOnActivated(object sender, WindowActivatedEventArgs windowActivatedEventArgs) { // If the TimePicker is in a TableView or ListView, when the application loses focus // the TextBlock/ComboBox controls (UWP and 8.1, respectively) which display its selected value // will go blank. // To fix this, we have to signal the renderer to invalidate if // Window.Activated occurs. ForceInvalidate?.Invoke(this, EventArgs.Empty); }
void PickerOnDropDownClosed(object sender, object o) { // If the TimePicker is in a TableView or ListView and the user // opens one of the dropdowns but does not actually change the value, // when the dropdown closes, the selected value will go blank // To fix this, we have to invalidate the control // This only applies to Windows 8.1 ForceInvalidate?.Invoke(this, EventArgs.Empty); }