public static void Show(string message, string actionContent = "OK", Action actionHandler = null, bool closePopupAfterActionButtonClicked = true) { if (_singleton == null) { _singleton = new NotificationBar(); } _singleton.Initialize(message, actionContent, actionHandler, closePopupAfterActionButtonClicked); _singleton.IsOpen = false; _singleton.IsOpen = true; AutoCloseNotificationBar.Hide(); }
private void ToggleButton_OnClick(object sender, RoutedEventArgs e) { if (ToggleButton.IsChecked.Value) { AutoCloseNotificationBar.Show(CheckedMessage); Checked?.Invoke(this, null); ToggleButton.ToolTip = CheckedTooltip; } else { AutoCloseNotificationBar.Show(UncheckedMessage); Unchecked?.Invoke(this, null); ToggleButton.ToolTip = UncheckedTooltip; } }
private Button GetCopyButton(string codeToBeCopied) { var button = new Button { Margin = new Thickness(1), Width = 180, Content = $"Copy code {codeToBeCopied}", FontSize = 12, HorizontalAlignment = HorizontalAlignment.Center }; button.Click += (sender, args) => { Clipboard.SetDataObject(codeToBeCopied); AutoCloseNotificationBar.Show($"{codeToBeCopied} is copied to clipboard!"); button.Background = Brushes.DarkCyan; }; return(button); }