public PopupNotify(NotifyModel model) { InitializeComponent(); notifyModel = model; description.Text = model.Text; time.Text = model.DateTime.ToString("HH:mm"); if (model.Color != null) { description.Foreground = new BrushConverter().ConvertFromString(model.Color) as SolidColorBrush; } closeBtn.Click += (s, e) => ClickClose?.Invoke(this, e); }
public PopupNotify(Type type, string status, string text, int delayMs) { InitializeComponent(); switch (type) { case Type.Normal: border.Background = new SolidColorBrush(Color.FromArgb(255, 9, 188, 0)); border.BorderBrush = new SolidColorBrush(Color.FromArgb(242, 0, 255, 102)); smile.Source = (ImageSource)Application.Current.Resources["HappySmile"]; break; case Type.Error: border.Background = new SolidColorBrush(Color.FromArgb(255, 188, 0, 0)); border.BorderBrush = new SolidColorBrush(Color.FromArgb(242, 255, 0, 0)); smile.Source = (ImageSource)Application.Current.Resources["SadSmile"]; break; } this.status.Text = status; description.Text = text; closeBtn.Click += (s, e) => ClickClose?.Invoke(this, e); DelayMs = delayMs; }
private void menuItemClose_Click(object sender, EventArgs e) { ClickClose?.Invoke(this, e); }