public MainPage_ViewModel()
        {
            toMathang_Command = new RelayCommand <Button>(p =>
            {
                return(true);
            }, p =>
            {
                Window win = getParent(p) as Window;

                View.View_Quanly.Mathang view = new View.View_Quanly.Mathang();
                view.WindowState           = win.WindowState;
                view.WindowStartupLocation = WindowStartupLocation.CenterScreen;

                show_waitingwd();

                view.Show();

                win.Close();
            });

            toKhachhang_Command = new RelayCommand <Button>(p =>
            {
                return(true);
            }, p =>
            {
                Window win = getParent(p) as Window;

                View.View_Quanly.Khachhang view = new View.View_Quanly.Khachhang();
                view.WindowState           = win.WindowState;
                view.WindowStartupLocation = WindowStartupLocation.CenterScreen;

                show_waitingwd();

                view.Show();

                win.Close();
            });

            toNhacungcap_Command = new RelayCommand <Button>(p =>
            {
                return(true);
            }, p =>
            {
                Window win = getParent(p) as Window;

                View.View_Quanly.Nhacungcap view = new View.View_Quanly.Nhacungcap();
                view.WindowState           = win.WindowState;
                view.WindowStartupLocation = WindowStartupLocation.CenterScreen;

                show_waitingwd();

                view.Show();

                win.Close();
            });

            toHethong_Command = new RelayCommand <Button>(p =>
            {
                return(true);
            }, p =>
            {
                Window win = getParent(p) as Window;

                View.View_Quanly.Quantrihethong view = new View.View_Quanly.Quantrihethong();
                view.WindowState           = win.WindowState;
                view.WindowStartupLocation = WindowStartupLocation.CenterScreen;

                show_waitingwd();

                view.Show();

                win.Close();
            });

            toNhanvien_Command = new RelayCommand <Button>(p =>
            {
                return(true);
            }, p =>
            {
                Window win = getParent(p) as Window;

                View.View_Quanly.Nhanvien view = new View.View_Quanly.Nhanvien();
                view.WindowState           = win.WindowState;
                view.WindowStartupLocation = WindowStartupLocation.CenterScreen;

                show_waitingwd();

                view.Show();

                win.Close();
            });
        }
예제 #2
0
        private void Select_Window(int i, WindowState wd, WindowStartupLocation wd_st)
        {
            switch (i)
            {
            case 1:
            {
                View.View_Quanly.Mathang view = new View.View_Quanly.Mathang();
                view.WindowState           = wd;
                view.WindowStartupLocation = wd_st;
                view.Show();
            }
            break;

            case 2:
            {
                View.View_Quanly.Khachhang view = new View.View_Quanly.Khachhang();
                view.WindowState           = wd;
                view.WindowStartupLocation = wd_st;
                view.Show();
            }
            break;

            case 3:
            {
                View.View_Quanly.Nhacungcap view = new View.View_Quanly.Nhacungcap();
                view.WindowState           = wd;
                view.WindowStartupLocation = wd_st;
                view.Show();
            }
            break;

            case 4:
            {
                View.View_Quanly.Quantrihethong view = new View.View_Quanly.Quantrihethong();
                view.WindowState           = wd;
                view.WindowStartupLocation = wd_st;
                view.Show();
            }
            break;

            case 5:
            {
                View.View_Quanly.Nhanvien view = new View.View_Quanly.Nhanvien();
                view.WindowState           = wd;
                view.WindowStartupLocation = wd_st;
                view.Show();
            }
            break;

            case 6:
            {
                View.View_Quanly.Thungrac view = new View.View_Quanly.Thungrac();
                view.WindowState           = wd;
                view.WindowStartupLocation = wd_st;
                view.Show();
            }
            break;

            default:
                break;
            }
        }