本文整理汇总了C#中Xamarin.Forms.SelectedItemChangedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SelectedItemChangedEventArgs类的具体用法?C# SelectedItemChangedEventArgs怎么用?C# SelectedItemChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SelectedItemChangedEventArgs类属于Xamarin.Forms命名空间,在下文中一共展示了SelectedItemChangedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: OnItemSelected
void OnItemSelected (object sender, SelectedItemChangedEventArgs e) {
var property = (PersonViewModel.Property)e.SelectedItem;
System.Diagnostics.Debug.WriteLine ("Property clicked " + property.Type + " " + property.Value);
switch (property.Type) {
case PersonViewModel.PropertyType.Email:
// use OpenUri
// Device.OpenUri (new Uri ("mailto:"+property.Value));
// or use platform-specific code
PhoneFeatureService.Email (property.Value);
break;
case PersonViewModel.PropertyType.Twitter:
PhoneFeatureService.Tweet (property.Value);
break;
case PersonViewModel.PropertyType.Url:
PhoneFeatureService.Browse (property.Value);
break;
case PersonViewModel.PropertyType.Phone:
PhoneFeatureService.Call (property.Value);
break;
case PersonViewModel.PropertyType.Address:
PhoneFeatureService.Map (property.Value);
break;
}
}
开发者ID:Randy3W,项目名称:xamarin-forms-samples,代码行数:26,代码来源:EmployeeXaml.xaml.cs
示例17: OnItemSelected
void OnItemSelected (object sender, SelectedItemChangedEventArgs e)
{
var todoItem = e.SelectedItem as TodoItem;
var todoPage = new TodoItemPage ();
todoPage.BindingContext = todoItem;
Navigation.PushAsync (todoPage);
}
开发者ID:zhenningshao,项目名称:xamarin-forms-samples,代码行数:7,代码来源:TodoListPage.xaml.cs
示例18: OnItemSelected
// public void OnDelete (object sender, EventArgs e)
// {
// //Person p = new Person ();
//
// var x1 = (MenuItem)sender;
// var x2 = x1.BindingContext;
// Person x3 = (Person)x2;
// x3.del (x3.key);
//
// MessagingCenter.Send (this, "delete");
// this.Navigation.PushAsync (new FootballPlayerPage ());
//
//
//
// }
void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
if (e.SelectedItem == null) {
return; //ItemSelected is called on deselection, which results in SelectedItem being set to null
}
this.Navigation.PushAsync (new FootballPlayerDetailsPage (e.SelectedItem));
}
开发者ID:ctsxamarintraining,项目名称:cts458703,代码行数:23,代码来源:FootballPlayerPage.xaml.cs
示例19: OnItemSelected
public void OnItemSelected (object sender, SelectedItemChangedEventArgs e) {
var p = e.SelectedItem as Person;
var em = new EmployeeXaml();
var pvm = new PersonViewModel (p, favoritesRepository);
em.BindingContext = pvm;
Navigation.PushAsync(em);
}
开发者ID:JeffHarms,项目名称:xamarin-forms-samples-1,代码行数:8,代码来源:EmployeeListXaml.xaml.cs
示例20: TheList_ItemSelected
void TheList_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
if (theList.SelectedItem == null)
return;
Global.CurrentExhibition = theList.SelectedItem as Exhibition;
theList.SelectedItem = null;
Navigation.PushModalAsync (new PageExhibition (), true);
}
开发者ID:BorisFR,项目名称:astromech,代码行数:8,代码来源:ViewExhibitions.xaml.cs
注:本文中的Xamarin.Forms.SelectedItemChangedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论