private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { string severityName = e.AddedItems[0].ToString(); switch (severityName) { case "Critical": severity = InfoBarSeverity.Critical; break; case "Warning": severity = InfoBarSeverity.Warning; break; case "Informational": severity = InfoBarSeverity.Informational; break; case "Success": severity = InfoBarSeverity.Success; break; case "Default": severity = InfoBarSeverity.Default; break; } }
public void ShowStatus(string title, string message, InfoBarSeverity severity) { statusInfo.Title = title; statusInfo.Message = message; statusInfo.Severity = severity; statusInfo.IsOpen = true; }
internal void RaiseOpenedEvent(InfoBarSeverity severity, string displayString) { //if (IAutomationPeer7 automationPeer7 = this) { this.RaiseNotificationEvent( AutomationNotificationKind.Other, GetProcessingForSeverity(severity), displayString, "InfoBarOpenedActivityId"); } }
private AutomationNotificationProcessing GetProcessingForSeverity(InfoBarSeverity severity) { AutomationNotificationProcessing processing = AutomationNotificationProcessing.CurrentThenMostRecent; if (severity == InfoBarSeverity.Error || severity == InfoBarSeverity.Warning) { processing = AutomationNotificationProcessing.ImportantAll; } return(processing); }
internal void RaiseClosedEvent(InfoBarSeverity severity, string displayString) { //AutomationNotificationProcessing processing = AutomationNotificationProcessing.CurrentThenMostRecent; //if (IAutomationPeer7 automationPeer7 = this) { this.RaiseNotificationEvent( AutomationNotificationKind.Other, GetProcessingForSeverity(severity), displayString, "InfoBarClosedActivityId"); } }
private string GetIconSeverityLevelResourceName(InfoBarSeverity severity) { switch (severity) { case InfoBarSeverity.Success: return("InfoBarIconSeveritySuccessName"); case InfoBarSeverity.Warning: return("InfoBarIconSeverityWarningName"); case InfoBarSeverity.Error: return("InfoBarIconSeverityErrorName"); } ; return("InfoBarIconSeverityInformationalName"); }
public void NotifyUser(string strMessage, InfoBarSeverity severity, bool isOpen = true) { // If called from the UI thread, then update immediately. // Otherwise, schedule a task on the UI thread to perform the update. if (DispatcherQueue.HasThreadAccess) { UpdateStatus(strMessage, severity, isOpen); } else { DispatcherQueue.TryEnqueue(() => { UpdateStatus(strMessage, severity, isOpen); }); } }
private void UpdateStatus(string strMessage, InfoBarSeverity severity, bool isOpen) { infoBar.Message = strMessage; infoBar.IsOpen = isOpen; infoBar.Severity = severity; }
public void SetLabel(string label, InfoBarSeverity severity = InfoBarSeverity.Informational) { Label = label; Severity = severity; }