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


C# ScrollView.SetBinding方法代码示例

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


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

示例1: GameMainView

		/// <summary>
		/// Initializes a new instance of the <see cref="WF.Player.GameMainView"/> class.
		/// </summary>
		/// <param name="gameMainViewModel">Game main view model.</param>
		public GameMainView(GameMainViewModel gameMainViewModel) : base()
		{
			BindingContext = gameMainViewModel;

			NavigationPage.SetBackButtonTitle(this, string.Empty);

			this.SetBinding(GameMainView.TitleProperty, GameMainViewModel.TitelPropertyName);

			#if __IOS__

			var toolbarMenu = new ToolbarItem(Catalog.GetString("Menu"), null, () => { //"IconMenu.png", () => {
				App.Click();
				var cfg = new WF.Player.Services.UserDialogs.ActionSheetConfig().SetTitle(Catalog.GetString("Game Menu"));
				cfg.Add(Catalog.GetString("Save"), () => ((GameMainViewModel)BindingContext).HandleMenuAction(this, Catalog.GetString("Save")));
				cfg.Add(Catalog.GetString("Quit"), () => ((GameMainViewModel)BindingContext).HandleMenuAction(this, Catalog.GetString("Quit")));
				cfg.Cancel = new WF.Player.Services.UserDialogs.ActionSheetOption(Catalog.GetString("Cancel"), App.Click);
				DependencyService.Get<WF.Player.Services.UserDialogs.IUserDialogs>().ActionSheet(cfg);
			});
			this.ToolbarItems.Add (toolbarMenu);

			#endif

			#if __ANDROID__

			var toolbarSave = new ToolbarItem(Catalog.GetString("Save"), "", () =>
				{ 
					App.Click();
					((GameMainViewModel)BindingContext).HandleMenuAction(this, Catalog.GetString("Save")); 
				}) {
				Order = ToolbarItemOrder.Secondary,
			};
			ToolbarItems.Add(toolbarSave);
			var toolbarQuit = new ToolbarItem(Catalog.GetString("Quit"), "", () =>
				{ 
					App.Click();
					((GameMainViewModel)BindingContext).HandleMenuAction(this, Catalog.GetString("Quit")); 
				}) {
				Order = ToolbarItemOrder.Secondary,
			};
			ToolbarItems.Add(toolbarQuit);

			#endif

			var grid = new Grid() 
				{
					RowSpacing = 0,
					HorizontalOptions = LayoutOptions.FillAndExpand,
					VerticalOptions = LayoutOptions.FillAndExpand,
				};

			grid.RowDefinitions = new RowDefinitionCollection 
				{
					new RowDefinition { Height = new GridLength(1, GridUnitType.Star) },
					new RowDefinition { Height = 60 }
				};

			grid.ColumnDefinitions = new ColumnDefinitionCollection 
				{
					new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) },
				};

			var bottomLayout = new StackLayout() 
				{
					Spacing = 0,
					Orientation = StackOrientation.Vertical,
					HorizontalOptions = LayoutOptions.FillAndExpand,
					VerticalOptions = LayoutOptions.Fill,
				};

			#if __IOS__

			// Dark grey line on iOS
			var line = new BoxView () 
				{
					BackgroundColor = App.Colors.IsDarkTheme ? Color.FromRgb(0x26, 0x26, 0x26) : Color.FromRgb (0xAE, 0xAE, 0xAE),
					HeightRequest = 0.5f,
					HorizontalOptions = LayoutOptions.FillAndExpand,
				};

			bottomLayout.Children.Add(line);

			#endif

			TapGestureRecognizer tapRecognizer;

			var buttonLayout = new StackLayout() 
				{
					Orientation = StackOrientation.Horizontal,
					BackgroundColor = App.Colors.Bar,
					HeightRequest = 60,
					MinimumHeightRequest = 60,
					HorizontalOptions = LayoutOptions.FillAndExpand,
				};

			// Overview button
			this.buttonOverview = new GameToolBarButton("IconOverview.png") 
//.........这里部分代码省略.........
开发者ID:Surfoo,项目名称:WF.Player,代码行数:101,代码来源:GameMainView.cs


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