コード例 #1
0
        public MainAppWindow(User user1)
        {
            InitializeComponent();
            this.user   = user1;
            user.UserId = DataBaseSolution.GetUserId(user.Username);
            UserControl usc = null;

            usc = new UserControlAccount(this);
            GridMain.Children.Add(usc);
        }
コード例 #2
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UserControl usc = null;

            GridMain.Children.Clear();

            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "ItemAccount":
                usc = new UserControlAccount(this);
                GridMain.Children.Add(usc);
                break;

            case "ItemNotebook":
                usc = new UserControlNotebook(this);
                GridMain.Children.Add(usc);
                break;

            case "ItemFoodPlan":
                usc = new UserControlFoodPlan(this);
                GridMain.Children.Add(usc);
                break;

            case "ItemProducts":
                usc = new UserProductsRecipes(this);
                GridMain.Children.Add(usc);
                break;

            case "ItemSearch":
                usc = new UserControlSearch();
                GridMain.Children.Add(usc);
                break;

            default:
                break;
            }
        }