protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
 {
     if (goTo == 0)
     {
         Client.Leave_Out();
         goTo = 0;
     }
     base.OnNavigatedFrom(e);
 }
Exemple #2
0
        private void onConnect(object sender, RoutedEventArgs e)
        {
            Ipstring = this.txtServerIP.Text;
            wp_hx_Client.Leave_Out();                      //与主服务器断开连接
            Boolean key = Client.Connect(this.txtServerIP.Text);

            if (key)
            {
                Debug.WriteLine("wwwwwwwwww", DateTime.Now.ToLongTimeString());
                //Dispatcher.BeginInvoke(() => this.NavigationService.Navigate(new Uri("/Information.xaml", UriKind.Relative)));
                this.NavigationService.Navigate(new Uri("/Information.xaml", UriKind.Relative));
            }
            else
            {
                MessageBox.Show("连接失败!!!");
                Client.Leave_Out();
            }
        }