private void Connect() { OutputText.Text = "Attempting to connect!"; // Fill in the CellularApnContext CellularApnContext cellularApnContext = new CellularApnContext(); cellularApnContext.AccessPointName = AccessPointName.Text; cellularApnContext.ProviderId = ProviderId.Text; cellularApnContext.UserName = UserName.Text; cellularApnContext.Password = Password.Text; cellularApnContext.AuthenticationType = ParseCellularApnAuthenticationType(((ComboBoxItem)Authentication.SelectedItem).Content.ToString()); cellularApnContext.IsCompressionEnabled = ParseCompressionEnabled(((ComboBoxItem)Compression.SelectedItem).Content.ToString()); // Call AcquireConnectionAsync with the CellularApnContext, and set the handler connectionResult = Windows.Networking.Connectivity.ConnectivityManager.AcquireConnectionAsync(cellularApnContext); connectionResult.Completed = ConnectionCompletedHandler; // Transition button to Cancel state ConnectButton.Content = "Cancel"; }
/// <summary> /// Establishes a connection to a specific access point on a network. The /// request is defined using a CellularApnContext object. /// </summary> /// <param name="CellularApnContext">Provides specific details about the APN.</param> /// <returns>The established APN connection.</returns> public static IAsyncOperation<ConnectionSession> AcquireConnectionAsync( CellularApnContext CellularApnContext ) { throw new NotImplementedException(); }