• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Xaml.RoutedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Windows.UI.Xaml.RoutedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# RoutedEventArgs类的具体用法?C# RoutedEventArgs怎么用?C# RoutedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RoutedEventArgs类属于Windows.UI.Xaml命名空间,在下文中一共展示了RoutedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
            }
        }
开发者ID:yavuzgedik,项目名称:Windows10_UWP,代码行数:30,代码来源:LoginPage.xaml.cs


示例2: AssociatedPageLoaded

 private void AssociatedPageLoaded(object sender, RoutedEventArgs e)
 {
     _associatedPage.Loaded -= AssociatedPageLoaded;
     _associatedPage.SizeChanged += PageBaseSizeChanged;
     DisplayInformation.GetForCurrentView().OrientationChanged += PageBaseOrientationChanged;
     DispatcherHelper.RunAsync(CheckOrientationForPage);
 }
开发者ID:CADTraveller,项目名称:RecipeMaster,代码行数:7,代码来源:OrientationStateBehavior.cs


示例3: BackButtonClicked

        private void BackButtonClicked(object sender, RoutedEventArgs e)
        {
            if (this.Parent is Popup)
                (this.Parent as Popup).IsOpen = false;

            SettingsPane.Show();
        }
开发者ID:Emilage,项目名称:App,代码行数:7,代码来源:ContactUs.xaml.cs


示例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;
                }
            }
        }
开发者ID:guglielmino,项目名称:pushetta-net-library,代码行数:26,代码来源:MainPage.xaml.cs


示例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);
     }
 }
开发者ID:mbin,项目名称:Win81App,代码行数:34,代码来源:Scenario6.xaml.cs


示例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();
            }
        }
开发者ID:nanderto,项目名称:Thinktecture.AuthorizationServer,代码行数:26,代码来源:MainPage.xaml.cs


示例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.");
            }
        }
开发者ID:oldnewthing,项目名称:old-Windows8-samples,代码行数:34,代码来源:BuildNewRss.Xaml.cs


示例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");
            }
        }
开发者ID:t-angma,项目名称:Windows-universal-samples,代码行数:39,代码来源:scenario2_history.xaml.cs


示例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;
            }
        }
开发者ID:cheahengsoon,项目名称:Windows10UWP-HandsOnLab,代码行数:27,代码来源:BBQRecipePage.xaml.cs


示例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);
 }
开发者ID:StartupMobilite,项目名称:MyDry,代码行数:7,代码来源:Message.cs


示例11: OnAdd

        private void OnAdd(object sender, RoutedEventArgs e)
        {
            if (Added != null)
                Added();

            if (Cancelled != null) Cancelled();
        }
开发者ID:modulexcite,项目名称:MarkPadRT,代码行数:7,代码来源:LinkDialog.xaml.cs


示例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);
            }
        }
开发者ID:mbin,项目名称:Win81App,代码行数:29,代码来源:LaunchUri.xaml.cs


示例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";
            }

        }
开发者ID:vivianaraujo,项目名称:DejandoHuella,代码行数:25,代码来源:EditFundacion.xaml.cs


示例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;
        }
开发者ID:prabaprakash,项目名称:Visual-Studio-2013,代码行数:30,代码来源:CameraCaptureControlPage.xaml.cs


示例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;
        }
开发者ID:yunamarth,项目名称:Demo10,代码行数:32,代码来源:MainPage.xaml.cs


示例16: AuthenticateButton_Click

        /// <summary>
        /// This is the click handler for the 'Authenticate' button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void AuthenticateButton_Click(object sender, RoutedEventArgs args)
        {
            AuthenticateButton.IsEnabled = false;

#if WINDOWS_PHONE_APP
            // For windows phone we just skip authentication because native WISPr is not supported.
            // Here you can implement custom authentication.
            authenticationContext.SkipAuthentication();
            rootPage.NotifyUser("Authentication skipped", NotifyType.StatusMessage);
#else
            HotspotCredentialsAuthenticationResult result = await authenticationContext.IssueCredentialsAsync(
                ConfigStore.UserName, ConfigStore.Password, ConfigStore.ExtraParameters, ConfigStore.MarkAsManualConnect);
            if (result.ResponseCode == HotspotAuthenticationResponseCode.LoginSucceeded)
            {
                rootPage.NotifyUser("Issuing credentials succeeded", NotifyType.StatusMessage);
                Uri logoffUrl = result.LogoffUrl;
                if (logoffUrl != null)
                {
                    rootPage.NotifyUser("The logoff URL is: " + logoffUrl.OriginalString, NotifyType.StatusMessage);
                }
            }
            else
            {
                rootPage.NotifyUser("Issuing credentials failed", NotifyType.ErrorMessage);
            }
#endif
            AuthenticateButton.IsEnabled = true;
        }
开发者ID:ckc,项目名称:WinApp,代码行数:33,代码来源:AuthByForegroundApp.xaml.cs


示例17: AppBarButton_Click

        //ini method event handler appbar
        private void AppBarButton_Click(object sender, RoutedEventArgs e)
        {
            var appbar = sender as AppBarButton;

            if (appbar != null)
            {
                switch (appbar.Tag.ToString())
                {
                    case "Lv":
                        Frame.Navigate(typeof(VListView));
                        break;
                    case "Pv":
                        Frame.Navigate(typeof(VPivot));
                        break;
                    case "Hb":
                        Frame.Navigate(typeof(VHub));
                        break;
                    case "Fv":
                        Frame.Navigate(typeof(VFlipView));
                        break;
                    case "Gv":
                        Frame.Navigate(typeof(VMain));
                        break;

                }
            }

        }
开发者ID:faisalishak,项目名称:Collection-Data-Windows-Phone,代码行数:29,代码来源:VListView.xaml.cs


示例18: ButtonCamera_Click

        private async void ButtonCamera_Click(object sender, RoutedEventArgs e)
        {
            CameraCaptureUI captureUI = new CameraCaptureUI();
            captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
            captureUI.PhotoSettings.CroppedSizeInPixels = new Size(600, 600);

            StorageFile photo = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);

            if (photo != null)
            {
                BitmapImage bmp = new BitmapImage();
                IRandomAccessStream stream = await photo.
                                                   OpenAsync(FileAccessMode.Read);
                bmp.SetSource(stream);
                BBQImage.Source = bmp;

                FileSavePicker savePicker = new FileSavePicker();
                savePicker.FileTypeChoices.Add
                                      ("jpeg image", new List<string>() { ".jpeg" });

                savePicker.SuggestedFileName = "New picture";

                StorageFile savedFile = await savePicker.PickSaveFileAsync();

                (this.DataContext as BBQRecipeViewModel).imageSource = savedFile.Path;

                if (savedFile != null)
                {
                    await photo.MoveAndReplaceAsync(savedFile);
                }
            }
        }
开发者ID:cheahengsoon,项目名称:Windows10UWP-HandsOnLab,代码行数:32,代码来源:BBQRecipePage.xaml.cs


示例19: saveConf_Click

        private async void saveConf_Click(object sender, RoutedEventArgs e)
        {
            if(serverExt.Text == "" && token.Text == "" && port.Text == "" && serverInt.Text == "")
            {
                MessageDialog msgbox = new MessageDialog("Un ou plusieurs champs sont vide...");
                await msgbox.ShowAsync(); 
            }
            else
            {
                localSettings.Values["savedServerExt"] = serverExt.Text;
                localSettings.Values["savedServerInt"] = serverInt.Text;
                localSettings.Values["savedToken"] = token.Text;
                localSettings.Values["savedPort"] = port.Text;

                if (tts.IsOn)
                {
                    localSettings.Values["tts"] = true;
                }
                else localSettings.Values["tts"] = false;

                Frame.Navigate(typeof(PageAction));
            }
            
           
        }
开发者ID:gwenoleR,项目名称:yana_for_WP8.1,代码行数:25,代码来源:configPage.xaml.cs


示例20: HandleMultiple1

        public void HandleMultiple1(object sender, RoutedEventArgs e)
        {
            try
            {
                // run...
                var conn = this.GetConnection();
                conn.CreateTableAsync<Customer>().ContinueWith(async (r) =>
                {
                    // go...
                    Customer customer = new Customer("foo", "bar", "1");
                    await customer.InsertAsync(conn);
                    int result1 = customer.CustomerId;

                    // go...
                    customer = new Customer("foo", "bar", "2");
                    await customer.InsertAsync(conn);
                    int result2 = customer.CustomerId;

                    // go...
                    customer = new Customer("foo", "bar", "3");
                    await customer.InsertAsync(conn);
                    int result3 = customer.CustomerId;

                    // get all...
                    var all = await conn.TableAsync<Customer>();
                    await this.ShowAlertAsync(string.Format("Results: {0}, {1}, {2}, count: {3}", result1, result2, result3, all.Count()));

                });
            }
            catch (Exception ex)
            {
                this.ShowAlertAsync(ex);
            }
        }
开发者ID:mbrit,项目名称:callisto,代码行数:34,代码来源:SqliteSample.xaml.cs



注:本文中的Windows.UI.Xaml.RoutedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Xaml.SizeChangedEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Xaml.FrameworkElement类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap