示例#1
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UserControl usercontrol = null;

            GridMain.Children.Clear();

            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "MenuQuanLyPhong":
                usercontrol = new UserControlQuanLyPhong();
                GridMain.Children.Add(usercontrol);
                break;

            case "MenuQuanLyPhieuThue":
                usercontrol = new UserControlQuanLyPhieuThue();
                GridMain.Children.Add(usercontrol);
                break;

            case "MenuBaoCaoThang":
                usercontrol = new UserControlBaoCaoThang();
                GridMain.Children.Add(usercontrol);
                break;

            default:
                break;
            }
        }
示例#2
0
        private void btnHuy_Click(object sender, RoutedEventArgs e)
        {
            UserControl usercontrol = new UserControlQuanLyPhieuThue();
            Grid        gridmain    = ((Grid)this.Parent);

            gridmain.Children.Clear();
            gridmain.Children.Add(usercontrol);
        }