本文整理匯總了C#中Windows.UI.Xaml.RoutedEventArgs類的典型用法代碼示例。如果您正苦於以下問題:C# RoutedEventArgs類的具體用法?C# RoutedEventArgs怎麽用?C# RoutedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RoutedEventArgs類屬於Windows.UI.Xaml命名空間,在下文中一共展示了RoutedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Button_Click
private async void Button_Click(object sender, RoutedEventArgs e)
{
if (CountryPhoneCode.SelectedItem != null)
{
var _id = Guid.NewGuid().ToString("N");
var _countryPhoneCode = (CountryPhoneCode.SelectedItem as Country).PhoneCode;
var _countryName = (CountryPhoneCode.SelectedItem as Country).CountryName;
var _name = FullName.Text;
var _phoneNumber = PhoneNumber.Text;
var _password = Password.Password;
var client = new HttpClient()
{
BaseAddress = new Uri("http://yochat.azurewebsites.net/chat/")
};
var json = await client.GetStringAsync("createuser?id=" + _id + "&fullName=" + _name + "&password=" + _password + "&phoneNumber=" + _phoneNumber + "&countryPhoneCode=" + _countryPhoneCode);
var serializer = new DataContractJsonSerializer(typeof(User));
var ms = new MemoryStream();
var user = serializer.ReadObject(ms) as User;
Frame.Navigate(typeof(MainPage), user);
}
else
{
MessageDialog dialog = new MessageDialog("Lütfen Ülkenizi Seçiniz!");
await dialog.ShowAsync();
}
}
示例2: AssociatedPageLoaded
private void AssociatedPageLoaded(object sender, RoutedEventArgs e)
{
_associatedPage.Loaded -= AssociatedPageLoaded;
_associatedPage.SizeChanged += PageBaseSizeChanged;
DisplayInformation.GetForCurrentView().OrientationChanged += PageBaseOrientationChanged;
DispatcherHelper.RunAsync(CheckOrientationForPage);
}
示例3: BackButtonClicked
private void BackButtonClicked(object sender, RoutedEventArgs e)
{
if (this.Parent is Popup)
(this.Parent as Popup).IsOpen = false;
SettingsPane.Show();
}
示例4: btnReceive_Click
private void btnReceive_Click(object sender, RoutedEventArgs e)
{
if (receiver == null)
{
try
{
receiver = new PushettaReceiver(new PushettaConfig()
{
APIKey = txtAPIKey.Text
});
receiver.OnMessage += Receiver_OnMessage;
receiver.SubscribeChannel(txtChannel.Text);
lblMessageReceived.Visibility = Visibility.Visible;
lblMessageReceived.Text = "WAITING FOR MESSAGES....";
}
catch (PushettaException pex)
{
errorBlock.Visibility = Visibility.Visible;
txtError.Text = pex.Message;
}
}
}
示例5: Launch_Click
private async void Launch_Click(object sender, RoutedEventArgs e)
{
if (FacebookClientID.Text == "")
{
rootPage.NotifyUser("Please enter an Client ID.", NotifyType.StatusMessage);
return;
}
var uri = new Uri("https://graph.facebook.com/me");
HttpClient httpClient = GetAutoPickerHttpClient(FacebookClientID.Text);
DebugPrint("Getting data from facebook....");
var request = new HttpRequestMessage(HttpMethod.Get, uri);
try
{
var response = await httpClient.SendRequestAsync(request);
if (response.IsSuccessStatusCode)
{
string userInfo = await response.Content.ReadAsStringAsync();
DebugPrint(userInfo);
}
else
{
string str = "";
if (response.Content != null)
str = await response.Content.ReadAsStringAsync();
DebugPrint("ERROR: " + response.StatusCode + " " + response.ReasonPhrase + "\r\n" + str);
}
}
catch (Exception ex)
{
DebugPrint("EXCEPTION: " + ex.Message);
}
}
示例6: ButtonRequestToken_Click
private async void ButtonRequestToken_Click(object sender, RoutedEventArgs e)
{
var error = string.Empty;
try
{
var response = await WebAuthentication.DoImplicitFlowAsync(
endpoint: new Uri(Constants.AS.OAuth2AuthorizeEndpoint),
clientId: Constants.Clients.ImplicitClient,
scope: "read");
TokenVault.StoreToken(_resourceName, response);
RetrieveStoredToken();
}
catch (Exception ex)
{
error = ex.Message;
}
if (!string.IsNullOrEmpty(error))
{
var dialog = new MessageDialog(error);
await dialog.ShowAsync();
}
}
示例7: Scenario1BtnDefault_Click
/// <summary>
/// This is the click handler for the 'Scenario1BtnDefault' button.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Scenario1BtnDefault_Click(object sender, RoutedEventArgs e)
{
String rss = scenario1RssInput.Text;
if (null != rss && "" != rss)
{
try
{
String xml;
var doc = new Windows.Data.Xml.Dom.XmlDocument();
scenario1OriginalData.Document.GetText(Windows.UI.Text.TextGetOptions.None, out xml);
doc.LoadXml(xml);
// create a rss CDataSection and insert into DOM tree
var cdata = doc.CreateCDataSection(rss);
var element = doc.GetElementsByTagName("content").Item(0);
element.AppendChild(cdata);
Scenario.RichEditBoxSetMsg(scenario1Result, doc.GetXml(), true);
}
catch (Exception exp)
{
Scenario.RichEditBoxSetError(scenario1Result, exp.Message);
}
}
else
{
Scenario.RichEditBoxSetError(scenario1Result, "Please type in RSS content in the [RSS Content] box firstly.");
}
}
示例8: ScenarioGetActivityHistory
/// <summary>
/// This is the click handler for the 'Get Activity History' button.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
async private void ScenarioGetActivityHistory(object sender, RoutedEventArgs e)
{
// Reset fields and status
ScenarioOutput_Count.Text = "No data";
ScenarioOutput_Activity1.Text = "No data";
ScenarioOutput_Confidence1.Text = "No data";
ScenarioOutput_Timestamp1.Text = "No data";
ScenarioOutput_ActivityN.Text = "No data";
ScenarioOutput_ConfidenceN.Text = "No data";
ScenarioOutput_TimestampN.Text = "No data";
rootPage.NotifyUser("", NotifyType.StatusMessage);
var calendar = new Calendar();
calendar.SetToNow();
calendar.AddDays(-1);
var yesterday = calendar.GetDateTime();
// Get history from yesterday onwards
var history = await ActivitySensor.GetSystemHistoryAsync(yesterday);
ScenarioOutput_Count.Text = history.Count.ToString();
if (history.Count > 0)
{
var reading1 = history[0];
ScenarioOutput_Activity1.Text = reading1.Activity.ToString();
ScenarioOutput_Confidence1.Text = reading1.Confidence.ToString();
ScenarioOutput_Timestamp1.Text = reading1.Timestamp.ToString("u");
var readingN = history[history.Count - 1];
ScenarioOutput_ActivityN.Text = readingN.Activity.ToString();
ScenarioOutput_ConfidenceN.Text = readingN.Confidence.ToString();
ScenarioOutput_TimestampN.Text = readingN.Timestamp.ToString("u");
}
}
示例9: ButtonFilePick_Click
private async void ButtonFilePick_Click(object sender, RoutedEventArgs e)
{
var picker = new FileOpenPicker();
picker.ViewMode = PickerViewMode.Thumbnail;
picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
picker.FileTypeFilter.Add(".jpg");
picker.FileTypeFilter.Add(".jpeg");
picker.FileTypeFilter.Add(".png");
StorageFile file = await picker.PickSingleFileAsync();
if (file != null)
{
ImageProperties imgProp = await file.Properties.GetImagePropertiesAsync();
var savedPictureStream = await file.OpenAsync(FileAccessMode.Read);
//set image properties and show the taken photo
bitmap = new WriteableBitmap((int)imgProp.Width, (int)imgProp.Height);
await bitmap.SetSourceAsync(savedPictureStream);
BBQImage.Source = bitmap;
BBQImage.Visibility = Visibility.Visible;
(this.DataContext as BBQRecipeViewModel).imageSource = file.Path;
}
}
示例10: CheckBoxComplete_Checked
private void CheckBoxComplete_Checked(object sender, RoutedEventArgs e)
{
CheckBox cb = (CheckBox) sender;
Message message = cb.DataContext as Message;
message.Complete = true;
UpdateCheckedMessage(message);
}
示例11: OnAdd
private void OnAdd(object sender, RoutedEventArgs e)
{
if (Added != null)
Added();
if (Cancelled != null) Cancelled();
}
示例12: LaunchUriOpenWithButton_Click
/// <summary>
// Launch a URI. Show an Open With dialog that lets the user chose the handler to use.
/// </summary>
private async void LaunchUriOpenWithButton_Click(object sender, RoutedEventArgs e)
{
// Create the URI to launch from a string.
var uri = new Uri(UriToLaunch.Text);
// Calulcate the position for the Open With dialog.
// An alternative to using the point is to set the rect of the UI element that triggered the launch.
Point openWithPosition = GetOpenWithPosition(LaunchUriOpenWithButton);
// Next, configure the Open With dialog.
var options = new Windows.System.LauncherOptions();
options.DisplayApplicationPicker = true;
options.UI.InvocationPoint = openWithPosition;
options.UI.PreferredPlacement = Windows.UI.Popups.Placement.Below;
// Launch the URI.
bool success = await Windows.System.Launcher.LaunchUriAsync(uri, options);
if (success)
{
rootPage.NotifyUser("URI launched: " + uri.AbsoluteUri, NotifyType.StatusMessage);
}
else
{
rootPage.NotifyUser("URI launch failed.", NotifyType.ErrorMessage);
}
}
示例13: goToEdit
private void goToEdit(object sender, RoutedEventArgs e)
{
if (!string.IsNullOrWhiteSpace(nombre.Text) && !string.IsNullOrWhiteSpace(direccion.Text) && !string.IsNullOrWhiteSpace(correo.Text) && !string.IsNullOrWhiteSpace(descripcion.Text) && !string.IsNullOrWhiteSpace(cuenta_bancaria.Text))
{
FundacionParse obj = new FundacionParse();
itm.Nombre = nombre.Text;
itm.ObjectId = "Cic5apx3U3";
itm.Descripcion = descripcion.Text;
itm.Direccion = direccion.Text;
itm.Correo = correo.Text;
itm.Cuenta_bancaria = cuenta_bancaria.Text;
itm.Telefono = telefono.Text;
result.Text = "entra a cuardar";
//if (file != null)
//result.Text = itm.Foto;
itm.ArchivoImg = file;
obj.updateFundacion(itm);
//rootFrame.GoBack();
}
else
{
result.Text = "Todos los campos son obligatorios";
}
}
示例14: OnCapturePhotoButtonClick
private async void OnCapturePhotoButtonClick(object sender, RoutedEventArgs e)
{
var file = await TestedControl.CapturePhotoToStorageFileAsync(ApplicationData.Current.TemporaryFolder);
var bi = new BitmapImage();
IRandomAccessStreamWithContentType stream;
try
{
stream = await TryCatchRetry.RunWithDelayAsync<Exception, IRandomAccessStreamWithContentType>(
file.OpenReadAsync(),
TimeSpan.FromSeconds(0.5),
10,
true);
}
catch (Exception ex)
{
// Seems like a bug with WinRT not closing the file sometimes that writes the photo to.
#pragma warning disable 4014
new MessageDialog(ex.Message, "Error").ShowAsync();
#pragma warning restore 4014
return;
}
bi.SetSource(stream);
PhotoImage.Source = bi;
CapturedVideoElement.Visibility = Visibility.Collapsed;
PhotoImage.Visibility = Visibility.Visible;
}
示例15: buyButton_Click
private void buyButton_Click(object sender, RoutedEventArgs e)
{
string products = "";
if ((bool)milkCheck.IsChecked)
{
products += "milk ";
}
if ((bool)butterCheck.IsChecked)
{
products += "butter ";
}
if ((bool)beerCheck.IsChecked)
{
products += "beer ";
}
if ((bool)chickenCheck.IsChecked)
{
products += "chicken ";
}
if ((bool)lemonadeCheck.IsChecked)
{
products += "lemonade ";
}
listBox.Text = products;
}