public MainWindow()
        {
            InitializeComponent();
            #region 启动动画
            this.BeginAnimation(HeightProperty, new DoubleAnimation(600, new Duration(TimeSpan.FromMilliseconds(1200)), FillBehavior.Stop)
            {
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseOut, Exponent = -5
                }
            });
            #endregion
            #region 定时器
            var DateTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(1)
            };
            DateTimer.Tick += (object sender, EventArgs e) =>
            {
                DateTime datetime = DateTime.Now;
                dateLabel.Content = datetime.ToString("D");
                timeLabel.Content = datetime.ToString("HH:mm:ss");
            };
            DateTimer.Start();
            #endregion

            Entities.ReUser          user      = new Entities.ReUser();
            List <Entities.Hospital> hospitals = new List <Entities.Hospital>();
            NetService netservice = new NetService();
            netservice.CreatBroadcastLinker();
            netservice.NewServer += () =>
            {
                isConnected = true;
            };
            netServiceConfirm = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(5)
            };
            netServiceConfirm.Tick += (object sender, EventArgs e) =>
            {
                if (!isConnected && netservice.isConnecting == false)
                {
                    ThreadPool.QueueUserWorkItem(( object args ) =>
                    {
                        netservice.isConnecting = true;
                        netservice.ConnectServer();
                        netservice.isConnecting = false;
                    }, null);
                }
                else
                {
                }
            };
        }
        public MainWindow()
        {
            InitializeComponent();
            #region 启动动画
            this.BeginAnimation( HeightProperty, new DoubleAnimation( 600, new Duration( TimeSpan.FromMilliseconds( 1200 ) ) ,FillBehavior.Stop)
            {
                EasingFunction = new ExponentialEase() { EasingMode = EasingMode.EaseOut, Exponent = -5 }
            } );
            #endregion
            #region 定时器
            var DateTimer = new DispatcherTimer() { Interval = TimeSpan.FromSeconds( 1 ) };
            DateTimer.Tick += ( object sender, EventArgs e ) =>
            {
                DateTime datetime = DateTime.Now;
                dateLabel.Content = datetime.ToString( "D" );
                timeLabel.Content = datetime.ToString( "HH:mm:ss" );
            };
            DateTimer.Start();
            #endregion

            Entities.ReUser user = new Entities.ReUser();
            List<Entities.Hospital> hospitals = new List<Entities.Hospital>();
            NetService netservice = new NetService();
            netservice.CreatBroadcastLinker();
            netservice.NewServer += () =>
            {
                isConnected = true;
            };
            netServiceConfirm = new DispatcherTimer() { Interval = TimeSpan.FromSeconds( 5 ) };
            netServiceConfirm.Tick += ( object sender, EventArgs e ) =>
            {
                if ( !isConnected && netservice.isConnecting == false )
                {
                    ThreadPool.QueueUserWorkItem( ( object args ) =>
                     {
                         netservice.isConnecting = true;
                         netservice.ConnectServer();
                         netservice.isConnecting = false;
                     }, null );
                }
                else
                {

                }
            };
        }