本文整理汇总了C#中System.Windows.Controls.ChildWindow.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# ChildWindow.ShowDialog方法的具体用法?C# ChildWindow.ShowDialog怎么用?C# ChildWindow.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.ChildWindow
的用法示例。
在下文中一共展示了ChildWindow.ShowDialog方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addOrder_Click_1
private void addOrder_Click_1(object sender, RoutedEventArgs e)
{
try
{
ChildWindow addWin = new ChildWindow();
AddOrdreUC addOrdUC = new AddOrdreUC();
addOrdUC.ParentWin = addWin;
addWin.forUC.Children.Add(addOrdUC);
addWin.SizeToContent = SizeToContent.WidthAndHeight;
addWin.Title = "Add Order";
bool? dialogRes = addWin.ShowDialog();
if (dialogRes.HasValue && dialogRes.Value)
{
if (orderManager.AddOrder(addOrdUC.CustomerId, addOrdUC.Time, addOrdUC.Cost, addOrdUC.Status, addOrdUC.OrderType))
{
MessageBox.Show("Sucsses");
orderCatalogViewModel.ResetCatalog();
this.dgCatalogUC.DataContext = orderCatalogViewModel.Catalog;
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例2: addPack_Click_1
private void addPack_Click_1(object sender, RoutedEventArgs e)
{
ChildWindow win = new ChildWindow();
AddPackageUC addPackUC = new AddPackageUC();
addPackUC.ParentWin = win;
win.forUC.Children.Add(addPackUC);
win.SizeToContent = SizeToContent.WidthAndHeight;
win.Title = "Новий товар";
bool? dialogRes = win.ShowDialog();
if (dialogRes.HasValue && dialogRes.Value)
{
MainWindow.catalogViewModel.ResetCatalog();
this.dgCatalogUC.DataContext = MainWindow.catalogViewModel.Catalog;
}
}
示例3: btnAddSubCategory_Click_1
private void btnAddSubCategory_Click_1(object sender, RoutedEventArgs e)
{
ChildWindow addWin = new ChildWindow();
AddSubCategoryUC addSubCatUC = new AddSubCategoryUC();
addSubCatUC.ParentWin = addWin;
addWin.forUC.Children.Add(addSubCatUC);
addWin.SizeToContent = SizeToContent.WidthAndHeight;
addWin.Title = "Додати Категорію";
bool? dialogRes = addWin.ShowDialog();
if (dialogRes.HasValue && dialogRes.Value)
{
if (MainWindow.categoryManager.AddSubCategory(CategoryID, addSubCatUC.subCategoryName))
{
MessageBox.Show(addSubCatUC.subCategoryName + " додано до " + CategoryName , "Додати підкатегорію", MessageBoxButton.OK
, MessageBoxImage.Information);
}
}
}
示例4: btnAddProduct_Click_1
private void btnAddProduct_Click_1(object sender, RoutedEventArgs e)
{
ChildWindow addWin = new ChildWindow();
addProductUC addProdUC = new addProductUC();
addProdUC.ParentWin = addWin;
addWin.forUC.Children.Add(addProdUC);
addWin.SizeToContent = SizeToContent.WidthAndHeight;
addWin.Title = "Додати Продукт";
bool? dialogRes = addWin.ShowDialog();
if (dialogRes.HasValue && dialogRes.Value)
{
if(MainWindow.productManager.AddProduct(addProdUC.ProductName , SubCategoryID, ProducerID))
{
cmbProduct.DataContext = CmbProductItems;
cmbProduct.SelectedIndex = cmbProduct.Items.IndexOf(addProdUC.ProductName);
MessageBox.Show(addProdUC.ProductName + "\r\n " + " Додано", "Додати продукт", MessageBoxButton.OK
, MessageBoxImage.Information);
}
}
}
示例5: btnAddProducer_Click_1
private void btnAddProducer_Click_1(object sender, RoutedEventArgs e)
{
ChildWindow addWin = new ChildWindow();
AddProducerUC addProdUC = new AddProducerUC();
addProdUC.ParentWin = addWin;
addWin.forUC.Children.Add(addProdUC);
addWin.SizeToContent = SizeToContent.WidthAndHeight;
addWin.Title = "Додати Виробника";
bool? DiagRes = addWin.ShowDialog();
if (DiagRes.HasValue && DiagRes.Value)
{
if (MainWindow.producerManager.AddProducer(addProdUC.ProducerName , addProdUC.ProducerAdress , addProdUC.ProducerPhone))
{
cmbProducer.DataContext = CmbProducerItems;
cmbProducer.SelectedIndex = cmbProducer.Items.IndexOf(addProdUC.ProducerName);
MessageBox.Show(addProdUC.ProducerName + "\r\n " + addProdUC.ProducerAdress + "\r\n " +addProdUC.ProducerPhone + " Додано", "Додати категорію", MessageBoxButton.OK
, MessageBoxImage.Information);
}
}
}
示例6: btnAddCategory_Click_1
private void btnAddCategory_Click_1(object sender, RoutedEventArgs e)
{
ChildWindow addWin = new ChildWindow();
addCategoryUC addCatUC = new addCategoryUC();
addCatUC.ParentWin = addWin;
addWin.forUC.Children.Add(addCatUC);
addWin.SizeToContent = SizeToContent.WidthAndHeight;
addWin.Title = "Додати Категорію";
bool? dialogRes = addWin.ShowDialog();
if (dialogRes.HasValue && dialogRes.Value)
{
if(MainWindow.categoryManager.AddCategory(addCatUC.CategoryName , addCatUC.subCategoryName))
{
cmbCategory.DataContext = CmbCategoryItems;
cmbCategory.SelectedIndex = cmbCategory.Items.IndexOf(addCatUC.CategoryName);
MessageBox.Show(addCatUC.CategoryName +"\r\n " + addCatUC.subCategoryName + " Додано" , "Додати категорію" , MessageBoxButton.OK
,MessageBoxImage.Information);
}
}
}
示例7: btnAddCust_Click_1
private void btnAddCust_Click_1(object sender, RoutedEventArgs e)
{
ChildWindow addWin = new ChildWindow();
AddCustomerUC addCustUC = new AddCustomerUC();
addCustUC.ParentWin = addWin;
addWin.forUC.Children.Add(addCustUC);
addWin.SizeToContent = SizeToContent.WidthAndHeight;
addWin.Title = "Add Customer";
bool? DiagRes = addWin.ShowDialog();
if (DiagRes.HasValue && DiagRes.Value)
{
if (customerManager.AddCustomer(addCustUC.CustomerName, addCustUC.Adress, addCustUC.Phone))
{
MessageBox.Show("Customer Added");
cmbCustomer.DataContext = CmbCustomerItems;
cmbCustomer.SelectedIndex = cmbCustomer.Items.IndexOf(addCustUC.CustomerName);
}
}
}