当前位置: 首页>>代码示例>>C#>>正文


C# IMenu.FindItem方法代码示例

本文整理汇总了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;
        }
开发者ID:ogborstad,项目名称:monodroid-samples,代码行数:27,代码来源:ActionBarActionProviderActivity.cs

示例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;
            };
        }
开发者ID:jheerman,项目名称:LGSAMobile,代码行数:26,代码来源:ScheduleFragment.cs

示例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;
        }
开发者ID:jorik041,项目名称:Sample-Projects,代码行数:10,代码来源:BrowserActivity.cs

示例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);
        }
开发者ID:cyecp,项目名称:XamarinComponents,代码行数:10,代码来源:AbsListViewBaseFragment.cs

示例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);
        }
开发者ID:236422,项目名称:Krokomierz,代码行数:11,代码来源:PedometerActivity.cs

示例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;
 }
开发者ID:ralexey-egocms,项目名称:SmartDock,代码行数:12,代码来源:MenuView.cs

示例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);
 }
开发者ID:FrederickEskens,项目名称:Totem,代码行数:13,代码来源:EigenschappenActivity.cs

示例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;
		}
开发者ID:Trojka,项目名称:monoCPVanity,代码行数:13,代码来源:MainActivity.cs

示例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;
 }
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:14,代码来源:Activity1.cs

示例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;
		}
开发者ID:fatelord,项目名称:chgk,代码行数:14,代码来源:TeamsView.cs

示例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);
        }
开发者ID:erdennis13,项目名称:EthansList,代码行数:14,代码来源:MainActivity.cs

示例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 ();
		}
开发者ID:fatelord,项目名称:chgk,代码行数:15,代码来源:QuestionView.cs

示例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;
		}
开发者ID:adbk,项目名称:spikes,代码行数:26,代码来源:ShareActionProvider.cs

示例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);
        }
开发者ID:erdennis13,项目名称:EthansList,代码行数:7,代码来源:CategoryPickerFragment.cs

示例15: OnPrepareOptionsMenu

        public override bool OnPrepareOptionsMenu(IMenu menu)
        {
            menu.FindItem(Resource.Id.action_showmap)
                .SetVisible(_playServicesInstalled);

            return base.OnPrepareOptionsMenu(menu);
        }
开发者ID:Cheesebaron,项目名称:AppCompatAndMaps,代码行数:7,代码来源:Activity1.cs


注:本文中的IMenu.FindItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。