示例#1
0
        private DispatcherTimer timer;      //时间定时器
        public AdminWindow()
        {
            InitializeComponent();
            this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            //创建所有页面的对象
            pages[0]            = new RouteMapPage();
            pages[1]            = new QueryPage();
            pages[2]            = new OpenAccountPage();
            pages[3]            = new RechargePage();
            pages[4]            = new DelAccountPage();
            admin_frame.Content = pages[0];

            //定时器
            timer          = new DispatcherTimer();
            timer.Tick    += timer_Tick;
            timer.Interval = TimeSpan.FromMilliseconds(100);
            timer.Start();
        }
示例#2
0
        private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Border border = sender as Border;

            if (border != null)
            {
                switch (border.Name)
                {
                case "route":
                    pages[0]            = new RouteMapPage();
                    admin_frame.Content = pages[0];
                    break;

                case "query":
                    pages[1]            = new QueryPage();
                    admin_frame.Content = pages[1];
                    break;

                case "openAccount":
                    pages[2]            = new OpenAccountPage();
                    admin_frame.Content = pages[2];
                    break;

                case "recharge":
                    pages[3]            = new RechargePage();
                    admin_frame.Content = pages[3];
                    break;

                case "delAccount":
                    pages[4]            = new DelAccountPage();
                    admin_frame.Content = pages[4];
                    break;

                default:
                    break;
                }
            }
        }