當前位置: 首頁>>代碼示例>>C#>>正文


C# Navigation.NavigationEventArgs類代碼示例

本文整理匯總了C#中Windows.UI.Xaml.Navigation.NavigationEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# NavigationEventArgs類的具體用法?C# NavigationEventArgs怎麽用?C# NavigationEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NavigationEventArgs類屬於Windows.UI.Xaml.Navigation命名空間,在下文中一共展示了NavigationEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if(e.Parameter != null)
            {
                //we got any parameter, insert it into the textfield
                if (MainPage.position > -1)
                {
                    //split string into [0,pos] and [pos+1,end]
                    // var firstpart = MainPage.code.Substring(0, MainPage.position);
                    //var secondpart = MainPage.code.Substring(MainPage.position, MainPage.code.Length - firstpart.Length);
                    //this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, firstpart + e.Parameter as string + secondpart);
                    this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, MainPage.code);
                    //this.textBox.Document.Selection.SetIndex(Windows.UI.Text.TextRangeUnit.Character, MainPage.position, false);
                    this.textBox.Document.Selection.SetRange(MainPage.position, MainPage.position);
                    this.textBox.Document.Selection.Text = e.Parameter as String + "\n";

                }
                else
                {
                    this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, MainPage.code + e.Parameter as string + "\n");
                }

            }
        }
開發者ID:18padx08,項目名稱:PPTexEditor,代碼行數:25,代碼來源:MainPage.xaml.cs

示例2: OnNavigatedTo

 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     history = new HistoriesViewModel();
     histories = history.getHistory();
     //listViewHistory.Items.Add(histories);
     try
     {
         if (histories != null)
         {
             foreach (var hist in histories)
             {
                 listViewHistory.Items.Add(hist.ID + " :Used :" + hist.USED_UNITS + " Remained " + hist.REMAINING_UNITS + " DATE: " + hist.DATE + "");
             }
         }
         else
         {
             messageBox("No history in the database");
         }
     }
     catch (Exception ex)
     {
         messageBox("error " + ex.Message);
     }
     base.OnNavigatedTo(e);
 }
開發者ID:sovenga,項目名稱:ElectricityApp,代碼行數:25,代碼來源:HistoryPage.xaml.cs

示例3: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _dataTransferManager = DataTransferManager.GetForCurrentView();
            _dataTransferManager.DataRequested += OnDataRequested;

            base.OnNavigatedTo(e);
        }
開發者ID:mateerladnam,項目名稱:DJNanoSampleApp,代碼行數:7,代碼來源:InstagramDetailPage.cs

示例4: OnNavigatedTo

 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     _args = e.Parameter as HistoryNavigationArgs;
     if(_args == null)
         ViewModelLocator.NavMgr.ResetMainBackNav();
     base.OnNavigatedTo(e);
 }
開發者ID:Mordonus,項目名稱:MALClient,代碼行數:7,代碼來源:HistoryPage.xaml.cs

示例5: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.Items = new ObservableCollection<object>(PhotosDataSource.GetItems());
            this.ItemTemplate = Resources["Hero"] as DataTemplate;

            base.OnNavigatedTo(e);
        }
開發者ID:ridomin,項目名稱:waslibs,代碼行數:7,代碼來源:CarouselPage.xaml.cs

示例6: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Sqlite sqlData = new Sqlite();
            var plan = (Plans)e.Parameter;
            Days d;

            //startDate.Text = "From " + plan.StartDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo) + " To " + plan.EndDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo);
            startDate.Text = "From " + plan.StartDate.ToString("dd/MM/yyyy") + " To " + plan.EndDate.ToString("dd/MM/yyyy");
            location.Text = "in " + plan.Location;
            maxDay.Text = plan.MaxDay.ToString();
            if (plan.MaxDay == 0)
            {
                addNewEvent.IsEnabled = false;
            }
            //DaysList = DayList.getDayList(plan.StartDate, plan.EndDate);

            // Initialize date instance
            var queryDay = from pd in sqlData.conn.Table<Days>()
                           where pd.PlanID_FK.Equals(plan.PlanID)
                           select pd;

            // create date if there is no date
            if (queryDay.Count<Days>() == 0)
            {
                for (int i = 1; i <= Convert.ToInt16(maxDay.Text); i++)
                {
                    d = new Days(plan.PlanID, "No Activities on this day!", "Day " + i.ToString());
                    sqlData.conn.Insert(d);
                }
            }
            DaysList = DayList.getDayList(plan);
        }
開發者ID:nhansky,項目名稱:TripPlanner,代碼行數:32,代碼來源:PlanDetails.xaml.cs

示例7: OnNavigatedTo

        protected override void OnNavigatedTo( NavigationEventArgs e )
        {
            base.OnNavigatedTo( e );
            Logger.Log( ID, string.Format( "OnNavigatedTo: {0}", e.SourcePageType.Name ), LogType.INFO );

            ViewFile( e.Parameter as StorageFile );
        }
開發者ID:tgckpg,項目名稱:wenku10,代碼行數:7,代碼來源:DirectTextViewer.xaml.cs

示例8: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ScrollViewer.SetVerticalScrollMode(CategoryPageGridView, ScrollMode.Disabled);
            CategoryPageViewModel categoryPageViewModel =
                           (CategoryPageViewModel)Resources["CategoryPageViewModel"];
            NavigationItem navigationItem = e.Parameter as NavigationItem;
            var task = Task.Factory.StartNew(async () =>
            {
                var bundle = await DownloadNavigationItem(navigationItem.ReferralId);
                var navigationItems = await DownloadNavigationItemsAsync();

                await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                    () =>
                    {
                        categoryPageViewModel.Content = bundle.Content[0];
                        var items =  new List<Content>(bundle.Content);
                        items.RemoveAt(0);
                        bundle.Content = items.ToArray();
                        categoryPageViewModel.Bundle = bundle;
                        categoryPageViewModel.NavigationItems = navigationItems;
                        LoadingGrid.Visibility = Visibility.Collapsed;
                        MySplitView.Visibility = Visibility.Visible;
                    }
                );
            });
            base.OnNavigatedTo(e);
        }
開發者ID:arnvanhoutte,項目名稱:DeRedactie,代碼行數:27,代碼來源:CategoryPage.xaml.cs

示例9: OnNavigatedTo

 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     CompositionTarget.SurfaceContentsLost += CompositionTarget_SurfaceContentsLost;
     DisplayInformation.GetForCurrentView().DpiChanged += OnDpiChanged;
     rootPage.MainPageResized += rootPage_MainPageResized;
     UpdateOutputLayout();
 }
開發者ID:oldnewthing,項目名稱:old-Windows8-samples,代碼行數:12,代碼來源:Scenario1.xaml.cs

示例10: OnNavigatedTo

 protected override void OnNavigatedTo(NavigationEventArgs e) 
 {
     postInfo_list.ItemsSource = CommentList;
     pid = (int)e.Parameter;
     HttpRequestAsync(async () =>
     {
         string resourceAddress = postServer + pid;
         string responseBody;
         HttpResponseMessage response = await httpClient.GetAsync(new Uri(resourceAddress)).AsTask(cts.Token);
         responseBody = await response.Content.ReadAsStringAsync().AsTask(cts.Token);
         var serializer = new DataContractJsonSerializer(typeof(postInfo));   //將json字符串解析成class
         var mStream = new MemoryStream(Encoding.Unicode.GetBytes(responseBody));
         postinfo = (postInfo)serializer.ReadObject(mStream);
         init_post(postinfo.post);
         resourceAddress = commentServer + pid;
         response = await httpClient.GetAsync(new Uri(resourceAddress)).AsTask(cts.Token);
         responseBody = await response.Content.ReadAsStringAsync().AsTask(cts.Token);
         serializer = new DataContractJsonSerializer(typeof(floorInfo));   //將json字符串解析成class
         mStream = new MemoryStream(Encoding.Unicode.GetBytes(responseBody));
         floors = (floorInfo)serializer.ReadObject(mStream);
         init_comment(floors);
         return responseBody;
     });
     
 }
開發者ID:BLUESTC,項目名稱:SeTieba_APP,代碼行數:25,代碼來源:Post.xaml.cs

示例11: OnNavigatedTo

 /// <summary>
 /// 在此頁將要在 Frame 中顯示時進行調用。
 /// </summary>
 /// <param name="e">描述如何訪問此頁的事件數據。
 /// 此參數通常用於配置頁。</param>
 protected   override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter != null)
     {
         GetContact(e.Parameter .ToString ());
     }
 }
開發者ID:745322878,項目名稱:Code,代碼行數:12,代碼來源:EditContact.xaml.cs

示例12: OnNavigatedTo

 protected override void OnNavigatedTo(NavigationEventArgs e) {
     if (accounts == null) {
         lvAccounts.Visibility = Visibility.Collapsed;
         spLVHeader.Visibility = Visibility.Collapsed;
         spCreateNewAccount.Visibility = Visibility.Visible;
     }
 }
開發者ID:AndrejLavrionovic,項目名稱:MobAppProject,代碼行數:7,代碼來源:HomePage.xaml.cs

示例13: OnNavigatedTo

        /// <summary>
        /// 在此頁將要在 Frame 中顯示時進行調用。
        /// </summary>
        /// <param name="e">描述如何訪問此頁的事件數據。
        /// 此參數通常用於配置頁。</param>
        async protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            EditAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
            AddAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
            FindAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
            DeleteAppbar.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            //if (e.Parameter != null)
            //{
            //    cityname.city = e.Parameter.ToString();
            //    cityName.Add(cityname);
                
            //}
            //colCityName.ItemsSource = cityName;
            
             Files.Items.Clear();
            //創建文件夾
            StorageFolder storage = await ApplicationData.Current.LocalFolder.CreateFolderAsync("CityList", CreationCollisionOption.OpenIfExists);
            //獲取當前文件夾中的文件
            var files = await storage.GetFilesAsync();
            //便利 每一個文件
            foreach (StorageFile file in files)
            {
                XmlDocument doc=await XmlDocument.LoadFromFileAsync (file );
                //cityname.city = doc.DocumentElement.Attributes.GetNamedItem ("city").NodeValue.ToString ();
                cityname = new Citys();
                cityname.city = file.DisplayName;
                if (cityname.city == "City")
                    continue;
                else
                    cityName.Add(cityname);

            }
            Files.ItemsSource = cityName;
        }
開發者ID:745322878,項目名稱:Code,代碼行數:39,代碼來源:CollectionCity.xaml.cs

示例14: OnNavigatedTo

 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     var data = e.Parameter as string[];
     uid = data[0];
     rid = data[1];
     LoadData();
 }
開發者ID:yszhangyh,項目名稱:KuGouMusic-UWP,代碼行數:7,代碼來源:MyMusicListInfo.xaml.cs

示例15: OnNavigatedTo

        protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
        {
            Debug.WriteLine("MainPage::OnNavigatedTo");

            byte adc = 0;
            for (int i = 0; i < 50; i++)
            {
                int readVal = await mcp3008.ReadADC(adc);

                // The raw voltage read
                float voltage = readVal * SourceVoltage;

                voltage /= MaxADCValue;

                // Remove the TMP36 .5v offset
                voltage -= VoltageOffset;


                Debug.WriteLine("Read value: " + readVal.ToString());
                var temperatureInC = voltage * 100;
                var temperatureInF = temperatureInC * 9 / 5 + 32;
                Debug.WriteLine(string.Format("V: {0} C: {1} F: {2}", voltage + VoltageOffset, temperatureInC, temperatureInF));
                await Task.Delay(100);
            }
        }
開發者ID:apdutta,項目名稱:prototype,代碼行數:25,代碼來源:MainPage.xaml.cs


注:本文中的Windows.UI.Xaml.Navigation.NavigationEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。