Enterwell / Wpf.Notifications

WPF notifications UI controls (as seen in VS Code)
MIT License
394 stars 39 forks source link

Notifications for a dynamically generated UserControl Window #30

Closed Julian243 closed 3 years ago

Julian243 commented 3 years ago

Hello, I'm currently developing an application that monitors vital data. I want to use your notification to inform users about connection losses from the monitor. The application consists of a MainWindow with UserControls, arranged in a grid. Each one of these UserControl-Windows should receive a NotificationMessageManager in order to have error messages on top of each window. Unbenannt Unbenannt1 As you can see it works for one UserControl. My question is if there is a way to get this working for all UserControl-Windows. As far as I understood I need to somehow dynamically generate NotificationMessageManagers in my MainWindow, as they have to be instantiated there as it seems. The NotificationMessageManagers must then be binded dynamically which can't be in XAML.

I'm really thankful for any advice because I'm pretty new to C# and stuck on this issue for quite a while! Thanks a lot!

Julian243 commented 3 years ago

Is there really no one that can help me? I'm still stuck on this issue.

Julian243 commented 3 years ago

Seems to be working with private INotificationMessageManager _notificationManager; public INotificationMessageManager NotificationManager { get { return _notificationManager; } set { _notificationManager = value; } } public VitaldatenMonitor(NpgsqlDataReader dr) { InitializeComponent(); NotificationManager = new NotificationMessageManager();