protected virtual DXWindow CreateDialogWindow(object content, bool isEditingMode = false) { DXDialog dialog = new DXDialog { Tag = content, Buttons = DialogButtons.OkCancel, Title = isEditingMode ? "Edit Row" : "Add New Row", SizeToContent = SizeToContent.WidthAndHeight }; ContentControl c = new ContentControl { Content = content }; if (isEditingMode) { dialog.Title = "Edit Row"; c.ContentTemplate = EditRowForm; } else { dialog.Title = "Add New Row"; c.ContentTemplate = NewRowForm; } dialog.Content = c; return(dialog); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { dg = this.Parent as DXDialog; if (dg != null) { dg.OkButton.Visibility = Visibility.Hidden; } }
private void SetBeginQZID_Load(Object sender, EventArgs e) { dg = this.Parent as DXDialog; if (dg != null) { dg.OkButton.Visibility = Visibility.Hidden; dg.CancelButton.Visibility = Visibility.Hidden; } }
public static void Show(string message, DialogResultDelegate onClosedCallback) { DXDialog dlg = new DXDialog(); dlg.Content = new TextBlock() { Text = message }; dlg.Closed += (s, e) => { onClosedCallback(((DXDialog)s).DialogResult); }; dlg.ShowDialog(); }
/// <summary> /// Shows the data in a <see cref="DataTable"/> in a model <see cref="DXDialog"/> /// </summary> /// <param name="table"> /// The <see cref="DataTable"/> /// </param> /// <param name="allowEdit"> /// Indicates if editting data in the table is allowed /// </param> public static void ShowDataTable(DataTable table, bool allowEdit = false) { var dialog = new DXDialog(table.TableName); var dataGrid = new DataGrid(); dataGrid.HorizontalAlignment = HorizontalAlignment.Stretch; dataGrid.VerticalAlignment = VerticalAlignment.Stretch; dataGrid.ItemsSource = table.DefaultView; dataGrid.IsReadOnly = !allowEdit; dialog.Content = dataGrid; dialog.ShowDialog(); }
private void bAuditUser_ItemClick(object sender, ItemClickEventArgs e) { DXDialog dg = new DXDialog() { Content = new View.AuditUser() }; dg.Width = 700; dg.Height = 750; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); }
private void bCountry_ItemClick(object sender, ItemClickEventArgs e) { DXDialog dg = new DXDialog() { Content = new View.CountryAdmin() }; dg.Width = 700; dg.Height = 750; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); }
void EditCustomer(Customers customer, string windowTitle, EventHandler closedDelegate) { control = new ContentControl { Template = (ControlTemplate)Resources["EditRecordTemplate"] }; control.DataContext = customer; DXDialog dialog = new DXDialog(windowTitle, DialogButtons.OkCancel); dialog.Content = control; dialog.Closed += closedDelegate; dialog.ShowDialog(); }
void setQZID() { try { View.SetBeginQZID BeginQZIDObj = new View.SetBeginQZID(); DXDialog dg = new DXDialog() { Content = BeginQZIDObj, Title = "设置签证起始号码" }; dg.Width = 400; dg.Height = 200; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OKCancel); QZIDnum = BeginQZIDObj.SetQZIDnum; QZIDstring = BeginQZIDObj.SetQZIDstring; this.CurrentItem = null; string QZID = ""; int i = Convert.ToInt32(QZIDnum); foreach (var sendModel in sendCollection.Where(s => s.FSelectItem == true)) { QZID = GetVisaNumberString(QZIDstring, i.ToString().Length, ref i); sendModel.FQZID = QZID.ToUpper(); i++; } //for (int j = 0; j < this.gridMain.VisibleRowCount; j++) //{ // QZID = GetVisaNumberString(QZIDstring, i.ToString().Length,ref i); // gridMain.SetCellValue(j,"FQZID",QZID); // i++; //} //(this.gridMain.CurrentItem as sp_SelectPrintSendInfo_Result).FQZID = GetVisaNumberString(QZIDstring, i.ToString().Length, i); //foreach (var sendModel in sendCollection) //{ // QZID = GetVisaNumberString(QZIDstring, i.ToString().Length, i); // sendModel.FQZID = QZID; // i++; //} } catch (System.Exception ex) { MessageBox.Show(ex.Message); Log.WriteLog.WriteErorrLog(ex); } //gridMain.ItemsSource = sendCollection; }
/// <summary> /// 数据备份还原事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bBackup_Click(object sender, ItemClickEventArgs e) { DXDialog dg = new DXDialog() { Content = new View.DataBackup(), Title = "数据备份还原" }; dg.Width = 500; dg.Height = 500; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); }
void SettingsMenuOnClick(object sender, EventArgs eventArgs) { DXDialog dialog = new DXDialog(); dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; dialog.Content = new RootSettingsControl() { DataContext = Options }; dialog.SizeToContent = SizeToContent.WidthAndHeight; if (dialog.ShowDialog(MessageBoxButton.OKCancel) == MessageBoxResult.OK) { SerializeHelper.SerializeSettings(Options); ToolWindowViewModel.Update(); } }
private void btnStyle2_Click(object sender, RoutedEventArgs e) { DXDialog dg = new DXDialog() { Content = new View.SetPrintStyle(2), Title = "设置打印位置风格二" }; dg.Width = 300; dg.Height = 650; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); SetControlPositionInReport(report, 2); MainPreview.Model = new XtraReportPreviewModel(report); report.CreateDocument(); }
private void ShowPrintPreview(GridControl grid) { DocumentPreview preview = new DocumentPreview(); PrintableControlLink link = new PrintableControlLink(grid.View as IPrintableControl); link.ExportServiceUri = "../ExportService.svc"; LinkPreviewModel model = new LinkPreviewModel(link); preview.Model = model; link.CreateDocument(true); DXDialog dlg = new DXDialog(); dlg.Content = preview; dlg.Height = 640; dlg.Left = 150; dlg.Top = 150; dlg.ShowDialog(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { // TableView1.ShowPrintPreview(this); DocumentPreview preview = new DocumentPreview(); PrintableControlLink link = new PrintableControlLink(grid.View as IPrintableControl); link.ExportServiceUri = "../ExportService.svc"; LinkPreviewModel model = new LinkPreviewModel(link); preview.Model = model; link.CreateDocument(true); DXDialog dlg = new DXDialog(); dlg.Content = preview; dlg.Height = 640; dlg.Left = 150; dlg.Top = 150; dlg.ShowDialog(); }
private void ShowPrintPreviewButton_Click(object sender, RoutedEventArgs e) { DocumentPreview preview = new DocumentPreview(); PrintableControlLink link = new PrintableControlLink(grid.View as IPrintableControl); link.PageFooterTemplate = (DataTemplate)this.Resources["pageFooterTemplate"]; #if SILVERLIGHT link.ExportServiceUri = "../ExportService.svc"; #endif LinkPreviewModel model = new LinkPreviewModel(link); preview.Model = model; link.CreateDocument(true); DXDialog dlg = new DXDialog(); dlg.Content = preview; dlg.Height = 640; dlg.Left = 150; dlg.Top = 150; dlg.ShowDialog(); }
private void btnCheckUnRead_Click(object sender, RoutedEventArgs e) { //if (Sendoc.Count < 1) //{ // MessageBox.Show("还未有扫描签证"); // return; //} ChkUnScan ChkUnScanList = new ChkUnScan(); DXDialog dg = new DXDialog() { Content = ChkUnScanList, Title = "查看未扫描签证" }; dg.Width = 750; dg.Height = 500; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); }
private void button1_Click(object sender, RoutedEventArgs e) { DXDialog d = new DXDialog("Information", DialogButtons.OkCancel, true); PropertyGrid p = new PropertyGrid() { DataContext = vm }; // Dialog view and Main view are both bound to the same viewmodel instance here. d.Content = p; d.SizeToContent = System.Windows.SizeToContent.WidthAndHeight; d.Owner = this; d.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; var result = d.ShowDialog(); if (result == true) { this.button1.Content = vm.Customer1; } else { // write the logic for "Cancel" button click. You can revert the Datacontext to the earlier value //of the ViewModel by having saved its cloned object in this same method } }
private void btnCheckUnRead_Click(object sender, RoutedEventArgs e) { //if (Sendoc.Count < 1) //{ // MessageBox.Show("还未有扫描签证"); // return; //} ChkUnScan ChkUnScanList = new ChkUnScan(); DXDialog dg = new DXDialog() { Content = ChkUnScanList, Title = "查看未扫描签证" }; dg.Width = 750; dg.Height = 500; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { dg = this.Parent as DXDialog; if (dg != null) { dg.OkButton.Visibility = Visibility.Hidden; } }
void setQZID() { try { View.SetBeginQZID BeginQZIDObj = new View.SetBeginQZID(); DXDialog dg = new DXDialog() { Content = BeginQZIDObj, Title = "设置签证起始号码" }; dg.Width = 400; dg.Height = 200; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OKCancel); QZIDnum = BeginQZIDObj.SetQZIDnum; QZIDstring = BeginQZIDObj.SetQZIDstring; this.CurrentItem = null; string QZID = ""; int i = Convert.ToInt32(QZIDnum); foreach (var sendModel in sendCollection.Where(s => s.FSelectItem == true)) { QZID = GetVisaNumberString(QZIDstring, i.ToString().Length, ref i); sendModel.FQZID = QZID.ToUpper(); i++; } //for (int j = 0; j < this.gridMain.VisibleRowCount; j++) //{ // QZID = GetVisaNumberString(QZIDstring, i.ToString().Length,ref i); // gridMain.SetCellValue(j,"FQZID",QZID); // i++; //} //(this.gridMain.CurrentItem as sp_SelectPrintSendInfo_Result).FQZID = GetVisaNumberString(QZIDstring, i.ToString().Length, i); //foreach (var sendModel in sendCollection) //{ // QZID = GetVisaNumberString(QZIDstring, i.ToString().Length, i); // sendModel.FQZID = QZID; // i++; //} } catch (System.Exception ex) { MessageBox.Show(ex.Message); Log.WriteLog.WriteErorrLog(ex); } //gridMain.ItemsSource = sendCollection; }
private void btnStyle2_Click(object sender, RoutedEventArgs e) { DXDialog dg = new DXDialog() { Content = new View.SetPrintStyle(2), Title = "设置打印位置风格二" }; dg.Width = 300; dg.Height = 650; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); SetControlPositionInReport(report, 2); MainPreview.Model = new XtraReportPreviewModel(report); report.CreateDocument(); }
private void SetBeginQZID_Load(Object sender, EventArgs e) { dg = this.Parent as DXDialog; if (dg != null) { dg.OkButton.Visibility = Visibility.Hidden; dg.CancelButton.Visibility = Visibility.Hidden; } }
/// <summary> /// 用户管理事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bPort_Click(object sender, ItemClickEventArgs e) { DXDialog dg = new DXDialog() { Content = new View.PortAdmin(), Title = "端口管理" }; dg.Width = 700; dg.Height = 750; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); }
/// <summary> /// 数据备份还原事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void bBackup_Click(object sender, ItemClickEventArgs e) { DXDialog dg = new DXDialog() { Content = new View.DataBackup(), Title = "数据备份还原" }; dg.Width = 500; dg.Height = 500; dg.HorizontalAlignment = HorizontalAlignment.Center; dg.VerticalAlignment = VerticalAlignment.Center; dg.ShowDialog(MessageBoxButton.OK); }