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


C# Forms.SelectedItemChangedEventArgs類代碼示例

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


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

示例1: DeviceSelected

		void DeviceSelected (object sender, SelectedItemChangedEventArgs e)
		{
			var device = e.SelectedItem as IDevice;
			if (device != null) {
				App.BluetoothAdapter.ConnectToDevice(device);
			}
		}
開發者ID:CocoFeng,項目名稱:Xamarin.BluetoothLE,代碼行數:7,代碼來源:DeviceListPage.xaml.cs

示例2: OnSelected

        // Event handlers
        public async void OnSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var todo = e.SelectedItem as TodoItemViewModel;

            if (todo != null)
            {
                var detailsView = new TodoItemDetailsView();
                detailsView.BindingContext = todo;

                await Navigation.PushAsync(detailsView);
            }

            //if (Device.OS != TargetPlatform.iOS && todo != null)
            //{
            //    // Not iOS - the swipe-to-delete is discoverable there
            //    if (Device.OS == TargetPlatform.Android)
            //    {
            //        await DisplayAlert(todo.Name, "Press-and-hold to delete task " + todo.Name, "Got it!");
            //    }
            //    else
            //    {
            //        // Windows, not all platforms support the Context Actions yet
            //        if (await DisplayAlert("Delete?", "Do you wish to delete " + todo.Name + "?", "Delete", "Cancel"))
            //        {
            //            await DeleteItem(todo);
            //        }
            //    }
            //}
            // prevents background getting highlighted
            todoList.SelectedItem = null;
        }
開發者ID:fabiocav,項目名稱:MobileAppsFilesSample,代碼行數:32,代碼來源:TodoList.xaml.cs

示例3: List_ItemSelected

        private async void List_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var vm = e.SelectedItem as ExampleViewCellModel;
            var list = sender as ListView;

            if (vm == null || list == null)
            {
                return;
            }

            var pageType = _pages[vm];

            // create the page object
            var page = Activator.CreateInstance(pageType) as Page;

            if (page == null)
            {
                await MainPage.DisplayAlert("Error", "Couldn't display page.", "OK");
                return;
            }

            page.Title = vm.Title;

            var animation = vm.TappedAnimation as IAsyncCommand;
            var reset = vm.Reset;

            if (animation != null)
            {
                await animation.ExecuteAsync(null);
            }

            await MainPage.Navigation.PushAsync(page, true);
            list.SelectedItem = null;
            reset.Execute(null);
        }
開發者ID:michaeled,項目名稱:FormsAnimations,代碼行數:35,代碼來源:App.cs

示例4: OnItemSelected

		public void OnItemSelected (object sender, SelectedItemChangedEventArgs e) {
			var r = (Restaurant)e.SelectedItem;

			var rPage = new RestaurantDetail();
			rPage.BindingContext = r;
			Navigation.PushAsync(rPage);
		}
開發者ID:BobSchlitten,項目名稱:xamarin-forms-samples,代碼行數:7,代碼來源:RestaurantList.xaml.cs

示例5: OnListItemSelected

		public async void OnListItemSelected(object sender, SelectedItemChangedEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine("hmm");

			try
			{
				categoryList.ScrollTo(categoryList.SelectedItem, ScrollToPosition.Center, true);
				EventCategoryListItem selectedCategory = categoryList.SelectedItem as EventCategoryListItem;
				categoryImage.Source = selectedCategory.ImageSource;
				await Task.Delay(500);
				categoryImage.IsVisible = true;
				categoryImage.FadeTo(0, 300, null);
				await categoryImage.ScaleTo(2, 150, null);
				categoryList.IsVisible = false;
				await categoryImage.ScaleTo(4, 150, null);
				categoryImage.Scale = 1;
				categoryImage.Opacity = 1;
				categoryImage.IsVisible = false;
				searchBar.Text = "#" + selectedCategory.Category;
				categoryList.SelectedItem = null;
			}
			catch (Exception ex)
			{

			}


		}
開發者ID:todibbang,項目名稱:HowlOutApp,代碼行數:28,代碼來源:ExploreEventCategories.xaml.cs

示例6: AnswerList_ItemSelected

        void AnswerList_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            if (Device.OS == TargetPlatform.Android)
            {

            }
        }
開發者ID:auxua,項目名稱:Qurvey,代碼行數:7,代碼來源:SurveyPage.xaml.cs

示例7: OnListItemSelected

		public void OnListItemSelected (object sender, SelectedItemChangedEventArgs e)
		{
			if (e.SelectedItem != null) {
				if (e.SelectedItem is CategoryViewModel) {
					Category selectedCategory = ((CategoryViewModel)e.SelectedItem).Category;

					//probably should not display category at all, but now its better than crash
					if (selectedCategory.Articles.Count == 0)
						return; 
				
					ContentPage nextPage;
					if (selectedCategory.Articles.Count > 1) {
						nextPage = new ArticleListPage () { ViewModel = new ArticleListViewModel (selectedCategory)  };
					} else {
						nextPage = new TextArticlePage () { ViewModel = new ArticleViewModel (selectedCategory.Articles [0]) };
					}
					Navigation.PushAsync (nextPage);
				} else if (e.SelectedItem is ArticleViewModel) {
					ArticleViewModel selectedSearchArtile = (ArticleViewModel)e.SelectedItem;
					var articlePage = new TextArticlePage () { ViewModel = selectedSearchArtile };
					Navigation.PushAsync (articlePage);						
				}
				myListView.SelectedItem = null;
			}
		}
開發者ID:Memorado,項目名稱:refugermany,代碼行數:25,代碼來源:CategoryListPage.xaml.cs

示例8: OnSelection

		void OnSelection (object sender, SelectedItemChangedEventArgs e)
		{
			if (e.SelectedItem == null) {
				return; //ItemSelected is called on deselection, which results in SelectedItem being set to null
			}

			Sections s = (Sections)e.SelectedItem;

			switch (s.SectionName) {
			case "Geometric Brownian Motion":
				SimulatingAndAnalyzingAssetPrices.RandomWalk rw = new SimulatingAndAnalyzingAssetPrices.RandomWalk (10.0);
				Navigation.PushAsync (new BrownianMotionChartPage (rw.BrownianSeq, rw.BrownianSeq1, rw.BrownianSeq2));
				break;
			case "MSFT Actual vs. GBM":
				var item = e.SelectedItem;
				Navigation.PushAsync (new CompareMsftHistoricalVolDriftChartPage ());
				break;
			case "Msft vs. Improved GBM":
				//			this is not properly implemented. needs non optimized drift/vol  
				//			SimulatingAndAnalyzingAssetPrices.RandomWalk rw = new SimulatingAndAnalyzingAssetPrices.RandomWalk (10.0);
							Navigation.PushAsync (new CompareMsftGbmChartPage ());
				break;
			}
			;

			((ListView)sender).SelectedItem = null; 
		}
開發者ID:IanLeatherbury,項目名稱:tryfsharpforms,代碼行數:27,代碼來源:SimulatingAndAnalyzingAssetPricesPage.cs

示例9: OrderList_OnItemSelected

 private async void OrderList_OnItemSelected(object sender, SelectedItemChangedEventArgs e)
 {
     if (e.SelectedItem == null) return;
     var selectedItem = e.SelectedItem as OrderItemViewModel;
     var orderDetailVm = await vm.GetViewModelForOrderDetail(selectedItem);
     await  Navigation.PushAsync(new OrderDetailsPage(orderDetailVm), true);
 }
開發者ID:nishanil,項目名稱:MyMenu,代碼行數:7,代碼來源:OrdersPage.xaml.cs

示例10: FoodList_OnItemSelected

        private async void FoodList_OnItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            if (e.SelectedItem == null) return;
            var selectedItem = vm.FoodItems.First(x => x.Name == (e.SelectedItem as Food).Name);

            await Navigation.PushAsync(new FoodDetailPage(new FoodDetailViewModel(selectedItem)), true);
        }
開發者ID:nishanil,項目名稱:MyMenu,代碼行數:7,代碼來源:FoodListPage.xaml.cs

示例11: ListPages_ItemSelected

		void ListPages_ItemSelected (object sender, SelectedItemChangedEventArgs e)
		{
			if (e.SelectedItem != null) {
				this.Navigation.PushAsync ((Page)e.SelectedItem);
			}
			listPages.SelectedItem = null;
		}
開發者ID:ChandrakanthBCK,項目名稱:xamarin-forms-samples,代碼行數:7,代碼來源:ListPage.xaml.cs

示例12: OnItemSelected

 private void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
 {
     var listView = sender as CustomListView;
     if (listView != null) {
         listView.SelectedItem = null;
     }
     var todoModel = e.SelectedItem as TodoModel;
     if (todoModel != null) {
         var todoDetails = new TodoDetailsPage (rootPage, todoModel);
         todoDetails.BackButtonClicked += (s, arg) => {
             contentPageArea.Children.Remove (todoDetails);
         };
         todoDetails.RemoveButtonClicked += (sender1, args) => {
             App.DataBase.RemoveTodo (todoModel.Id);
             ResetListData ();
             contentPageArea.Children.Remove (todoDetails);
         };
         todoDetails.SaveButtonClicked += (sender1, args) => {
             var todo = args.Todo;
             App.DataBase.AddOrUpdateTodo (todo);
             ResetListData ();
             contentPageArea.Children.Remove (todoDetails);
         };
         contentPageArea.Children.Add (todoDetails, new Rectangle (0f, 0f, 1f, 1f), AbsoluteLayoutFlags.All);
     }
 }
開發者ID:KtitarevEugene,項目名稱:TODOs-Xamarin,代碼行數:26,代碼來源:TodosPage.xaml.cs

示例13: OnSelect

 public void OnSelect(object sender, SelectedItemChangedEventArgs e)
 {
     if (EditMode)
     {
         // Get the item selected
         var rcLD = (ListData)e.SelectedItem;
         // Display the Details view.
         var view = new ListDataDetailsView(_sListType, rcLD);
         Navigation.PushAsync(view);
     }
     else
     {
         // get the item selected
         var ListD = (ListData)e.SelectedItem;
         switch (_sListType)
         {
             case "ITEMTYPE":
                 App.selectedItemType = ListD.ListDesc;
                 break;
             case "ACTIVITYTYPE":
                 App.selectedActivityType = ListD.ListDesc;
                 break;
             case "MANUFACTURER":
                 // get the item selected
                 var ListI = (ListItem)e.SelectedItem;
                 App.selectedManufacturer = ListI.ListDesc;
                 break;
         }
         // tell the navigator to show the new view
         Navigation.PopAsync();
     }
 }
開發者ID:wspeerbrecker,項目名稱:RCInventory,代碼行數:32,代碼來源:ListDataListView.xaml.cs

示例14: OnItemSelected

		public void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
		{
			if (e.SelectedItem == null) return; // has been set to null, do not 'process' tapped event
			var memberBarrier = ((ListView)sender).SelectedItem as MemberBarriers;
			((ListView)sender).SelectedItem = null; // de-select the row
			Navigation.PushModalAsync(new BarrierStrategyModal(SelectedUser, null, memberBarrier));
		}
開發者ID:MobileFit,項目名稱:CoachV2,代碼行數:7,代碼來源:mpBarriersPage.xaml.cs

示例15: Onselected

        // Determines what happens when an element from the list is chosen by the user.
        void Onselected(object sender, SelectedItemChangedEventArgs e)
        {
            if (e.SelectedItem == null){
                return;
            }

            // This deselects the item after it is selected.
            ((ListView)sender).SelectedItem = null;
            var select = e.SelectedItem as OnlineVViewModel;

            if (Helpers.Settings.SpeechSetting)
            {
                CrossTextToSpeech.Current.Speak(select.Title);
            }

            VideoPage temp = new VideoPage(select.Title, select.URL);
            if (Device.OS == TargetPlatform.iOS)
            {
                NavigationPage.SetHasNavigationBar(temp, true);
            }
            else
            {
                NavigationPage.SetHasNavigationBar(temp, false);
            }

            // Show the selected video to the user.
            Navigation.PushAsync(temp);
        }
開發者ID:Un1XX388,項目名稱:LOSS,代碼行數:29,代碼來源:PlaylistPage.cs


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