public MainUserControl() { InitializeComponent(); using (ShopDB db = new ShopDB()) { Devices = db.GetDevices(); } deviceList.ItemsSource = Devices; notifier = new Notifier(cfg => { cfg.PositionProvider = new WindowPositionProvider( parentWindow: Application.Current.MainWindow, corner: Corner.BottomRight, offsetX: 10, offsetY: 10); cfg.LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor( notificationLifetime: TimeSpan.FromSeconds(3), maximumNotificationCount: MaximumNotificationCount.FromCount(5)); cfg.Dispatcher = Application.Current.Dispatcher; }); }
public SearchUserControl() { InitializeComponent(); using (ShopDB db = new ShopDB()) { Devices = new ObservableCollection <Device>(db.GetDevices()); } notifier = new Notifier(cfg => { cfg.PositionProvider = new WindowPositionProvider( parentWindow: Application.Current.MainWindow, corner: Corner.BottomRight, offsetX: 5, offsetY: 5); cfg.LifetimeSupervisor = new TimeAndCountBasedLifetimeSupervisor( notificationLifetime: TimeSpan.FromSeconds(3), maximumNotificationCount: MaximumNotificationCount.FromCount(5)); cfg.Dispatcher = Application.Current.Dispatcher; }); }