private void MainWindow_Loaded(object sender, RoutedEventArgs e) { //Check Database Service try { if (ServiceStatus.Stopped == DatabaseServiceStatus(Setting.DatabaseServiceName)) { MessageBox.Show("Service is running"); } LoginForm loginForm = new LoginForm(); loginForm.ShowDialog(); //Set UserControl Size TableControl tbControl = new TableControl(); tbControl.Height = _UIProperies.ActualHeight; tbControl.Width = _UIProperies.ActualWidth; mainPanelLeft.Children.Add(tbControl); //Time DispatcherTimer dispatcherClockTimer = new DispatcherTimer(); dispatcherClockTimer.Tick += DispatcherClockTimer_Tick; dispatcherClockTimer.Interval = new TimeSpan(0, 0, 1); dispatcherClockTimer.Start(); } catch (Exception ex) { //TODO Exception Service MessageBox.Show(ex.Message); } }
private void BtnHome_Click(object sender, RoutedEventArgs e) { mainPanelLeft.Children.Clear(); TableControl tbControl = new TableControl(); tbControl.Height = _UIProperies.ActualHeight; tbControl.Width = _UIProperies.ActualWidth; mainPanelLeft.Children.Add(tbControl); }