当前位置: 首页>>代码示例>>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;未经允许,请勿转载。