private bool OpenWindow(string controlName, string title = "Public Window") { Dispatcher.BeginInvoke(new Action(() => { string namespaceName = "ES.UI.Setups"; TryCatch.BeginTryCatch(() => { MainWindow main = (MainWindow)Utilities.GetMainWindow(); if (main != null && main.MainContainer != null) { var myObj = Activator.CreateInstance(Type.GetType(namespaceName + "." + controlName)); if (main.MainContainer.Content == null || MainWinContainer.MainWindowContainerContent.Content == null || (myObj != null && MainWinContainer.MainWindowContainerContent.Content.GetType().Name != myObj.GetType().Name)) { MainWinContainer.WindowTitle.Text = title; MainWinContainer.MainWindowContainerContent.Content = myObj; main.MainContainer.Content = MainWinContainer; } } }); })); return(true); }
public void OpenPopUp(BaseUserControl control, string title = "Testing Window", int width = 300, int height = 300) { TryCatch.BeginTryCatch(new Action(() => { PopUpWindow ne = new PopUpWindow(control, title, width, height); ne.ShowDialog(); })); }
private void ExportClick(object sender, System.Windows.RoutedEventArgs e) { if (string.IsNullOrEmpty(txtPdfFileLocation.Text)) { return; } TryCatch.BeginTryCatch(() => grid.ExportToPdf(txtPdfFileLocation.Text, (ExcelTableStyle)style.SelectedValue, true)); }
private void ExportClick(object sender, System.Windows.RoutedEventArgs e) { if (string.IsNullOrEmpty(txtCsvFileLocation.Text)) { return; } TryCatch.BeginTryCatch(() => grid.ExportToCsv("Test", txtCsvFileLocation.Text, true)); }
private void ButtonClick(object sender, System.Windows.RoutedEventArgs e) { TryCatch.BeginTryCatch(() => { var sd = new SaveFileDialog(); sd.Filter = "Excel documents (*.xls, *.xlsx)|*.xls;*.xlsx"; sd.ShowDialog(); if (!string.IsNullOrEmpty(sd.FileName)) { txtExcelFileLocation.Text = sd.FileName; } }); }
void TimerElapsed(object sender, ElapsedEventArgs e) { TryCatch.BeginTryCatch(() => { _counter = _counter + 20; ProgressBarValue = (double)_counter / Max * 100; if (_counter != Max) { return; } _timer.Stop(); _timer.Dispose(); }); }
private void WindowLoaded(object sender, System.Windows.RoutedEventArgs e) { TryCatch.BeginTryCatch(() => { if (ApplicationDeployment.IsNetworkDeployed) { txtVersion.Text = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); } else { txtVersion.Text = Application.ProductVersion; } } ); }
private void btnExportToPDF_Click(object sender, RoutedEventArgs e) { TryCatch.BeginTryCatch(() => { var filePath = ""; var sd = new SaveFileDialog { Filter = "Pdf documents (*.pdf)|*.pdf" }; sd.ShowDialog(); if (!string.IsNullOrEmpty(sd.FileName)) { filePath = sd.FileName; } if (!string.IsNullOrEmpty(sd.FileName)) { _iCommandServiceForUI.ExportToPDFCommand(filePath); } } ); }
private void WindowLoaded(object sender, System.Windows.RoutedEventArgs e) { TryCatch.BeginTryCatch(() => { }); }
private void btnDeleteItem_Click(object sender, RoutedEventArgs e) { TryCatch.BeginTryCatch(() => _iCommandServiceForUI.DeleteCommand()); }