当前位置: 首页>>代码示例>>C#>>正文


C# ChildWindow.ShowDialog方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:28,代码来源:OrderUC.xaml.cs

示例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;
            }
        }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:17,代码来源:CatalogUC.xaml.cs

示例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);
                }
            }
        }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:19,代码来源:AddPackageUC.xaml.cs

示例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);
                }
            }
        }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:22,代码来源:AddPackageUC.xaml.cs

示例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);
                }
            }
        }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:22,代码来源:AddPackageUC.xaml.cs

示例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);

                }
            }
        }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:24,代码来源:AddPackageUC.xaml.cs

示例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);
                }
            }
        }
开发者ID:RoykoSerhiy,项目名称:visualStudio_projects,代码行数:20,代码来源:AddOrderUC.xaml.cs


注:本文中的System.Windows.Controls.ChildWindow.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。