コード例 #1
0
ファイル: LeagueCardView.cs プロジェクト: codnee/Scores-App
		public LeagueCardView(LeagueItem context)
		{
			BindingContext = context;

			Grid grid = new Grid {
				Padding = new Thickness(1,1,2,2),
				RowSpacing = 0,
				ColumnSpacing = 0,		
				BackgroundColor = Color.FromHex ("E3E3E3").MultiplyAlpha(0.5),
				RowDefinitions = {
					new RowDefinition { Height = new GridLength (100, GridUnitType.Absolute) }
				},
				ColumnDefinitions = {
					new ColumnDefinition { Width = new GridLength (4, GridUnitType.Absolute) },
					new ColumnDefinition {
						
					}
				}
			};

			grid.Children.Add (
				new FixtureCardStatusView ()
				,0,0);
			grid.Children.Add (new LeagueCardDetailsView (LeagueItem), 1, 0);

			var tgr = new TapGestureRecognizer { NumberOfTapsRequired = 1 };
			tgr.Tapped += (sender, args) => {
				OnCardClicked?.Invoke (LeagueItem);
			};
			grid.GestureRecognizers.Add (tgr);
			Content = grid;
		}
コード例 #2
0
		public LeagueCardDetailsView (LeagueItem item)
		{
			BindingContext = item;

			_leagueNameLabel = new Label {
				Text = item.Text,
				FontSize = 15,
				FontFamily = "AvenirNext-DemiBold",
				TextColor = LeagueItem.Favorites.TextColor,
				HorizontalTextAlignment = TextAlignment.Center,
				IsEnabled = true,
				InputTransparent = true
			};

			_leagueCountryLabel = new Label {
				Text = item.Description,
				FontSize = 10,
				FontFamily = "AvenirNext-DemiBold",
				TextColor = LeagueItem.Favorites.DescriptionColor,
				HorizontalTextAlignment = TextAlignment.Center,
				IsEnabled = true,
				InputTransparent = true
			};

			_flagImage = new Image {
				Source = LeagueItem.Image,
				VerticalOptions = LayoutOptions.FillAndExpand,
				Aspect = Aspect.AspectFill,
				WidthRequest = 120,
				HorizontalOptions = LayoutOptions.Start,
				IsEnabled = true,
				InputTransparent = true
			};

			Content = new StackLayout {
				HeightRequest = 100,
				HorizontalOptions = LayoutOptions.Fill,
				BackgroundColor = ScoresAppStyleKit.PageBackgroundColor,
				Orientation = StackOrientation.Horizontal,
				IsEnabled = true,
				InputTransparent = true,
				Children = {
					_flagImage,
					new StackLayout {
						Spacing = 5,
						HorizontalOptions = LayoutOptions.FillAndExpand,
						VerticalOptions = LayoutOptions.Center,
						Children = {
							_leagueNameLabel,
							_leagueCountryLabel
						},
						IsEnabled = true,
						InputTransparent = true
					}
				}
			};
		}
コード例 #3
0
ファイル: SqlManager.cs プロジェクト: codnee/Scores-App
		public void RemeveFromFavorite(LeagueItem item)
		{
			if (Favorites.FirstOrDefault (i => i.Id == item.Id) != null)
				Connection.Delete<LeagueItem> (item.Id);
			FavoritesViewModel.FavoritesViewModelManager.UpdateFavorites ();
		}
コード例 #4
0
ファイル: SqlManager.cs プロジェクト: codnee/Scores-App
		public void AddToFavorite(LeagueItem item)
		{
			if (Favorites.FirstOrDefault (i => i.Id == item.Id) == null)
				Connection.Insert (item);
			FavoritesViewModel.FavoritesViewModelManager.UpdateFavorites ();
		}
コード例 #5
0
ファイル: SqlManager.cs プロジェクト: codnee/Scores-App
		public bool IsFavorite(LeagueItem item)
		{
			var source = Favorites.FirstOrDefault( i => i.Id == item.Id);
			return source != null;
		}
コード例 #6
0
ファイル: WelcomePage.cs プロジェクト: codnee/Scores-App
		void OnCardClicked(LeagueItem item)
		{
			Title = "";
			Navigation.PushAsync (new LeagueResultsPage (item), true);
		}
コード例 #7
0
		public LeagueResultsPage (LeagueItem leagueItem)
		{
			BindingContext = leagueItem;
			Title = League.Text;
			BackgroundColor = ScoresAppStyleKit.PageBackgroundColor;
			CreateLayout ();
		}