本文整理汇总了C#中IMenu.FindItem方法的典型用法代码示例。如果您正苦于以下问题:C# IMenu.FindItem方法的具体用法?C# IMenu.FindItem怎么用?C# IMenu.FindItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMenu
的用法示例。
在下文中一共展示了IMenu.FindItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
// Inflate the menu
MenuInflater.Inflate (Resource.Menu.ActionBarActionProvider, menu);
// Set file with share history to the provider and set the share intent.
var action_item = menu.FindItem (Resource.Id.menu_item_share_action_provider_action_bar);
var action_provider = (ShareActionProvider)action_item.ActionProvider;
action_provider.SetShareHistoryFileName (ShareActionProvider.DefaultShareHistoryFileName);
// Note that you can set/change the intent any time,
// say when the user has selected an image.
action_provider.SetShareIntent (CreateShareIntent ());
// Set file with share history to the provider and set the share intent.
var overflow_item = menu.FindItem (Resource.Id.menu_item_share_action_provider_overflow);
var overflow_provider = (ShareActionProvider)overflow_item.ActionProvider;
overflow_provider.SetShareHistoryFileName (ShareActionProvider.DefaultShareHistoryFileName);
// Note that you can set/change the intent any time,
// say when the user has selected an image.
overflow_provider.SetShareIntent (CreateShareIntent ());
return true;
}
示例2: OnCreateOptionsMenu
public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
{
Activity.MenuInflater.Inflate (Resource.Menu.schedule_menu, menu);
//Handle share action provider
var shareMenuItem = menu.FindItem (Resource.Id.action_schedule_share);
var shareActionProvider =
(ShareActionProvider)shareMenuItem.ActionProvider;
shareActionProvider.SetShareIntent (CreateIntent ());
//Handle search action provider
var searchOption = menu.FindItem(Resource.Id.action_schedule_search);
//Handle expand/colapse of action bar
MenuItemCompat.SetOnActionExpandListener(searchOption, new SearchViewExpandListener(_adapter));
var searchItem = MenuItemCompat.GetActionView(searchOption);
_searchView = searchItem.JavaCast<SearchView>();
_searchView.QueryTextChange += (s, e) => _adapter.Filter.InvokeFilter(e.NewText);
_searchView.QueryTextSubmit += (s, e) =>
{
Toast.MakeText(Activity, "Searched for: " + e.Query, ToastLength.Short).Show();
e.Handled = true;
};
}
示例3: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
base.OnPrepareOptionsMenu(menu);
menu.FindItem(Resource.Id.refresh).SetVisible(_browser.Progress == 100 && !string.IsNullOrEmpty(_urlText.Text.ToString()));
menu.FindItem(Resource.Id.stop).SetVisible(_browser.Progress != 100);
menu.FindItem(Resource.Id.home).SetVisible(!string.IsNullOrEmpty(getHomePageUrl()));
return true;
}
示例4: OnPrepareOptionsMenu
public override void OnPrepareOptionsMenu(IMenu menu)
{
var pauseOnScrollItem = menu.FindItem(Resource.Id.item_pause_on_scroll);
pauseOnScrollItem.SetVisible(true);
pauseOnScrollItem.SetChecked(pauseOnScroll);
var pauseOnFlingItem = menu.FindItem(Resource.Id.item_pause_on_fling);
pauseOnFlingItem.SetVisible(true);
pauseOnFlingItem.SetChecked(pauseOnFling);
}
示例5: OnMenuOpened
public override bool OnMenuOpened(int featureId, IMenu menu)
{
menu.Clear();
MenuInflater.Inflate(Resource.Menu.ActionMenu, menu);
if (run)
menu.FindItem(Resource.Id.startstop).SetTitle("Stop");
else
menu.FindItem(Resource.Id.startstop).SetTitle("Start");
return base.OnMenuOpened(featureId, menu);
}
示例6: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
MenuInflater m = this.MenuInflater;
m.Inflate (Resource.Menu.menu_menuview, menu);
IMenuItem item = menu.FindItem (Resource.Id.menu_menu_user);
item.SetTitle (ViewModel.UserName);
item = menu.FindItem (Resource.Id.menu_menu_settings);
item.SetVisible (false);
var v = base.OnCreateOptionsMenu (menu);
this.Menu = menu;
return v;
}
示例7: OnCreateOptionsMenu
//create options menu
public override bool OnCreateOptionsMenu(IMenu m)
{
menu = m;
MenuInflater.Inflate(Resource.Menu.EigenschapSelectieMenu, menu);
IMenuItem item = menu.FindItem (Resource.Id.full);
item.SetVisible (false);
if(!IsProfileNull) {
IMenuItem save = menu.FindItem(Resource.Id.saveSelection);
save.SetVisible(false);
}
return base.OnCreateOptionsMenu(menu);
}
示例8: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu (IMenu menu) {
if(currentScreen == Screen.MemberList) {
menu.FindItem(Resource.Id.action_search).SetVisible(true);
menu.FindItem(Resource.Id.action_category).SetVisible(false);
}
else {
menu.FindItem(Resource.Id.action_search).SetVisible(false);
menu.FindItem(Resource.Id.action_category).SetVisible(true);
}
return true;
}
示例9: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu (IMenu menu)
{
MenuInflater.Inflate (Resource.Menu.ActionBarMenu, menu);
var shareMenuItem = menu.FindItem (Resource.Id.shareMenuItem);
var shareActionProvider = (ShareActionProvider)shareMenuItem.ActionProvider;
shareActionProvider.SetShareIntent (CreateIntent ());
var overflow_item = menu.FindItem (Resource.Id.overflowMenuItem);
var overflow_provider = (ShareActionProvider)overflow_item.ActionProvider;
overflow_provider.SetShareIntent (CreateIntent ());
return true;
}
示例10: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu (IMenu menu)
{
MenuInflater.Inflate (Resource.Menu.teamsview, menu);
removeAllButton = new MenuItemWrapper(menu.FindItem(Resource.Id.clear_teams));
clearResults = new MenuItemWrapper(menu.FindItem(Resource.Id.clear_results));
var bindingSet = this.CreateBindingSet<TeamsView, TeamsViewModel>();
bindingSet.Bind(removeAllButton).For(n => n.Visible).To(vm => vm.CanRemoveTeams);
bindingSet.Bind(clearResults).For(n => n.Visible).To(vm => vm.CanClearScore);
bindingSet.Apply();
return true;
}
示例11: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
MenuInflater.Inflate(Resource.Menu.Save, menu);
Menu = menu;
var save_button = Menu.FindItem(Resource.Id.save_action_button);
save_button.SetVisible(false);
var fav_button = Menu.FindItem(Resource.Id.favorite_action_button);
fav_button.SetIcon(Resource.Drawable.ic_star_empty);
fav_button.SetVisible(false);
return base.OnCreateOptionsMenu(menu);
}
示例12: OnCreateOptionsMenu
public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
{
base.OnCreateOptionsMenu (menu, inflater);
inflater.Inflate (Resource.Menu.question, menu);
_timeText = menu.FindItem (Resource.Id.time).ActionView as TextView;
_startButton = new MenuItemWrapper (menu.FindItem (Resource.Id.start_timer));
_stopButton = new MenuItemWrapper (menu.FindItem (Resource.Id.stop_timer));
var bindingSet = this.CreateBindingSet<QuestionView, QuestionViewModel> ();
bindingSet.Bind (_timeText).For (n => n.Text).To (vm => vm.Time).WithConversion ("Timer");
bindingSet.Bind (_startButton).For (n => n.Visible).To (vm => vm.IsTimerStopped);
bindingSet.Bind (_stopButton).For (n => n.Visible).To (vm => vm.IsTimerStarted);
bindingSet.Apply ();
}
示例13: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu (IMenu menu)
{
// Inflate your menu.
SupportMenuInflater.Inflate (Resource.Menu.share_action_provider, menu);
// Set file with share history to the provider and set the share intent.
var actionItem = menu.FindItem (Resource.Id.menu_item_share_action_provider_action_bar);
var actionProvider = (ShareActionProvider)actionItem.ActionProvider;
actionProvider.SetShareHistoryFileName (ShareActionProvider.DefaultShareHistoryFileName);
// Note that you can set/change the intent any time,
// say when the user has selected an image.
actionProvider.SetShareIntent (CreateShareIntent ());
//XXX: For now, ShareActionProviders must be displayed on the action bar
// Set file with share history to the provider and set the share intent.
//MenuItem overflowItem = menu.findItem(R.id.menu_item_share_action_provider_overflow);
//ShareActionProvider overflowProvider =
// (ShareActionProvider) overflowItem.getActionProvider();
//overflowProvider.setShareHistoryFileName(
// ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
// Note that you can set/change the intent any time,
// say when the user has selected an image.
//overflowProvider.setShareIntent(createShareIntent());
return true;
}
示例14: OnPrepareOptionsMenu
public override void OnPrepareOptionsMenu(IMenu menu)
{
IMenuItem fav_item = menu.FindItem(Resource.Id.favorite_action_button);
fav_item.SetVisible(true);
base.OnPrepareOptionsMenu(menu);
}
示例15: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
menu.FindItem(Resource.Id.action_showmap)
.SetVisible(_playServicesInstalled);
return base.OnPrepareOptionsMenu(menu);
}