All NetworkComms.Net implementation can be found here and in ChatAppBase
상속: ChatAppBase
        /// <summary>
        /// Initialisation of the settings page
        /// </summary>
        public SettingsPage()
        {
            InitializeComponent();

            //Set the local controls based on stored values
            ChatAppWP8 chatApplication = (App.Current as App).ChatApplication;

            ServerIPInputBox.Text = chatApplication.ServerIPAddress;
            ServerIPInputBox.Select(ServerIPInputBox.Text.Length, 0);

            ServerPortInputBox.Text = chatApplication.ServerPort.ToString();
            LocalNameInputBox.Text  = chatApplication.LocalName;

            UseEncryptionCheckBox.IsChecked = chatApplication.EncryptionEnabled;
            LocalServerEnabled.IsChecked    = chatApplication.LocalServerEnabled;

            if (chatApplication.ConnectionType == ConnectionType.TCP)
            {
                this.TCPRadioButton.IsChecked = true;
            }
            else
            {
                this.UDPRadioButton.IsChecked = true;
            }

            if (chatApplication.Serializer.GetType() == typeof(ProtobufSerializer))
            {
                this.ProtobufRadioButton.IsChecked = true;
            }
            else
            {
                this.JSONRadioButton.IsChecked = true;
            }
        }
        /// <summary>
        /// Update the application settings and refresh NetworkComms.Net configuration when we go back to the main page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BackKeyPressHandler(object sender, System.ComponentModel.CancelEventArgs e)
        {
            //Update the chatApplication values based on new values
            ChatAppWP8 chatApplication = (App.Current as App).ChatApplication;

            chatApplication.LocalServerEnabled = (bool)LocalServerEnabled.IsChecked;
            chatApplication.ServerIPAddress    = ServerIPInputBox.Text;
            chatApplication.ServerPort         = int.Parse(ServerPortInputBox.Text);
            chatApplication.LocalName          = LocalNameInputBox.Text;
            chatApplication.EncryptionEnabled  = (bool)UseEncryptionCheckBox.IsChecked;

            //To finish update the configuration with any changes
            chatApplication.RefreshNetworkCommsConfiguration();
        }