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


C# ImageButton.CallOnClick方法代码示例

本文整理汇总了C#中ImageButton.CallOnClick方法的典型用法代码示例。如果您正苦于以下问题:C# ImageButton.CallOnClick方法的具体用法?C# ImageButton.CallOnClick怎么用?C# ImageButton.CallOnClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageButton的用法示例。


在下文中一共展示了ImageButton.CallOnClick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View view = inflater.Inflate(Resource.Layout.PopularActivity, container, false);


			Scope = "Local";
			Type = "Timed";

			TopTimedGlobalPostFeedFragment = new PostFeedFragment();
			TopTimedGlobalPostFeedFragment.EmptyTableString = Strings.no_active_posts;
			TopTimedGlobalPostFeedFragment.Master = this;
			TopTimedGlobalPostFeedFragment.Target = FeedTypeEnum.FeedType.PopularGlobalTimedFeed;
			TopTimedGlobalPostFeedFragment.NewPageContainerID = Resource.Id.fragment_container_page;

			TopTimedLocalFeedFragment = new PostFeedFragment();
			TopTimedLocalFeedFragment.EmptyTableString = Strings.no_active_posts;
			TopTimedLocalFeedFragment.Master = this;
			TopTimedLocalFeedFragment.Target = FeedTypeEnum.FeedType.PopularLocalTimedFeed;
			TopTimedLocalFeedFragment.NewPageContainerID = Resource.Id.fragment_container_page;

			TopTimersGlobalUserFeedFragment = new UserFeedFragment();
			TopTimersGlobalUserFeedFragment.EmptyTableString = Strings.no_users_found;
			TopTimersGlobalUserFeedFragment.Master = this;
			TopTimersGlobalUserFeedFragment.Target = FeedTypeEnum.FeedType.PopularGlobalTimersFeed;

			TopTimersLocalUserFeedFragment = new UserFeedFragment();
			TopTimersLocalUserFeedFragment.EmptyTableString = Strings.no_users_found;
			TopTimersLocalUserFeedFragment.Master = this;
			TopTimersLocalUserFeedFragment.Target = FeedTypeEnum.FeedType.PopularLocalTimersFeed;

			View toolbarLayout = view.FindViewById(Resource.Id.toolbarLayout);
			((TextView)toolbarLayout.FindViewById(Resource.Id.toolbar_titleCenter)).Text = "Popular";


			timersButton = (Button)view.FindViewById(Resource.Id.timers);
			timersButton.Click += delegate
			{
				timedButton.SetBackgroundResource(Resource.Drawable.LeftSegmentedControl);
				timedButton.SetTextColor(Android.Graphics.Color.ParseColor("#338a9e"));
				timersButton.SetBackgroundResource(Resource.Drawable.RightSegmentedControlSelected);
				timersButton.SetTextColor(Android.Graphics.Color.White);
				Type = "Timers";
				ShowCorrectPage();
			};

			timedButton = (Button)view.FindViewById(Resource.Id.timed);
			timedButton.Click += delegate
			{
				timedButton.SetBackgroundResource(Resource.Drawable.LeftSegmentedControlSelected);
				timedButton.SetTextColor(Android.Graphics.Color.White);
				timersButton.SetBackgroundResource(Resource.Drawable.RightSegmentedControl);
				timersButton.SetTextColor(Android.Graphics.Color.ParseColor("#338a9e"));
				Type = "Timed";
				ShowCorrectPage();
			};


			localButton = (ImageButton)view.FindViewById(Resource.Id.local);
			localButton.Click += delegate
			{
				localButton.SetImageResource(Resource.Drawable.localselected);
				globalButton.SetImageResource(Resource.Drawable.global);
				Scope = "Local";
				ShowCorrectPage();
			};

			globalButton = (ImageButton)view.FindViewById(Resource.Id.global);
			globalButton.Click += delegate
			{
				localButton.SetImageResource(Resource.Drawable.local);
				globalButton.SetImageResource(Resource.Drawable.globalselected);
				Scope = "Global";
				ShowCorrectPage();
			};

			timedButton.CallOnClick();
			localButton.CallOnClick();

			return view;

		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:81,代码来源:PopularFragment.cs


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