Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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;
     }
 }
Exemplo n.º 3
0
        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);
        }