コード例 #1
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.Window = ((Restaurant.ProductWindow)(target));
     
     #line 13 "..\..\ProductWindow.xaml"
     this.Window.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Window_MouseLeftButtonDown);
     
     #line default
     #line hidden
     return;
     case 2:
     this.StoryboardUnitFadeIn_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target));
     return;
     case 3:
     this.StoryboardGroupFadeIn_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target));
     return;
     case 4:
     this.StoryboardProductFadeIn_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target));
     return;
     case 5:
     this.StoryboardProductTreeFadeIn_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target));
     return;
     case 6:
     
     #line 127 "..\..\ProductWindow.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.CloseCommand_Executed);
     
     #line default
     #line hidden
     return;
     case 7:
     this.TabButtonUnit = ((System.Windows.Controls.Button)(target));
     
     #line 131 "..\..\ProductWindow.xaml"
     this.TabButtonUnit.Click += new System.Windows.RoutedEventHandler(this.TabButtonUnit_Click);
     
     #line default
     #line hidden
     return;
     case 8:
     this.TabButtonGroup = ((System.Windows.Controls.Button)(target));
     
     #line 132 "..\..\ProductWindow.xaml"
     this.TabButtonGroup.Click += new System.Windows.RoutedEventHandler(this.TabButtonGroup_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.TabButtonProduct = ((System.Windows.Controls.Button)(target));
     
     #line 133 "..\..\ProductWindow.xaml"
     this.TabButtonProduct.Click += new System.Windows.RoutedEventHandler(this.TabButtonProduct_Click);
     
     #line default
     #line hidden
     return;
     case 10:
     this.TabButtonProductTree = ((System.Windows.Controls.Button)(target));
     
     #line 134 "..\..\ProductWindow.xaml"
     this.TabButtonProductTree.Click += new System.Windows.RoutedEventHandler(this.TabButtonProductTree_Click);
     
     #line default
     #line hidden
     return;
     case 11:
     this.UnitsPane = ((Restaurant.UnitsUserControl)(target));
     return;
     case 12:
     this.GroupsPane = ((Restaurant.GroupsUserControl)(target));
     return;
     case 13:
     this.ProductsPane = ((Restaurant.ProductsUserControl)(target));
     return;
     case 14:
     this.ProductsTreePane = ((Restaurant.ProductTreeUserControl)(target));
     return;
     }
     this._contentLoaded = true;
 }
コード例 #2
0
        private void ProductsMenuItem_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string selectedTab = "Products";
                switch (((MenuItem)e.Source).Name)
                {
                    case "UnitsMenuItem": selectedTab = "Units";
                        break;
                    case "GroupsMenuItem": selectedTab = "Groups";
                        break;
                    default: selectedTab = "Products";
                        break;
                }

                this.Cursor = Cursors.Wait;
                ((Storyboard)this.Resources["StoryboardFadeOut"]).Begin(this);
                ProductWindow objProductWindow = new ProductWindow(selectedTab);
                objProductWindow.Owner = this;
                objProductWindow.ShowDialog();
                objProductWindow = null;
                ((Storyboard)this.Resources["StoryboardFadeIn"]).Begin(this);
                this.Cursor = Cursors.Arrow;
            }
            catch
            {
                MessageBox.Show(ErrorMessages.Default.UnhandledException, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }