public vMain() { try { InitializeComponent(); controller = cMain.Instance; //Get the singleton DataContext = controller; controller.AlarmsChanged += new EventHandler(controller_AlarmsChanged); timer = new DispatcherTimer(DispatcherPriority.Background); timer.Start(); timer.Tick += new EventHandler(timer_Tick); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Initialize() { try { InitializeComponent(); controller = cMain.Instance; //Get the singleton DataContext = controller; } catch (Exception ex) { MessageBox.Show(ex.Message); } }