Пример #1
0
    public OpcionesCell()
    {
      var image = new Image
      {
        HorizontalOptions = LayoutOptions.Start,
      };
      image.SetBinding(Image.SourceProperty, new Binding("Imagen"));
      image.SetBinding(Image.BackgroundColorProperty, new Binding("ColorFondo", BindingMode.OneWay, new ColorConverter()));
      image.WidthRequest = image.HeightRequest = 24;

      var nameLabel = new Label
      {
        HorizontalOptions = LayoutOptions.FillAndExpand,
        TextColor = Color.Black,
        BackgroundColor = Color.Gray
      };
      nameLabel.SetBinding(Label.TextProperty, "Nombre");
      nameLabel.SetBinding(Label.BackgroundColorProperty, new Binding("ColorFondo", BindingMode.OneWay, new ColorConverter()));

      var viewLayout = new StackLayout()
      {
        Orientation = StackOrientation.Horizontal,
        VerticalOptions = LayoutOptions.CenterAndExpand,
        Children = { image, nameLabel}
      };
      viewLayout.SetBinding(StackLayout.BackgroundColorProperty, new Binding("ColorFondo", BindingMode.OneWay, new ColorConverter()));

      View = viewLayout;
    }
Пример #2
0
        public MenuImageCell()
            : base()
        {
            Label Text = new Label {
                TextColor = Color.FromHex ("DCDCDC"),
                XAlign = TextAlignment.Start,
                YAlign = TextAlignment.Center
            };
            Text.SetBinding (Label.TextProperty, "Title");

            Label pad = new Label {
                Text = " "
            };

            Image image = new Image {
                // Backup: Default icon to set
                //Source = "info.png",
                HeightRequest = 30,
            };

            image.SetBinding (Image.SourceProperty, "Icon");

            var layout = new StackLayout {
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions = LayoutOptions.Center,
                Children = { pad, image, pad, Text }
            };
            layout.SetBinding (Layout.BackgroundColorProperty, new Binding ("BackgroundColor"));

            if (Device.OS == TargetPlatform.WinPhone)
                layout.HeightRequest = 50;

            View = layout;
        }
Пример #3
0
            public MyCell()
            {
                //画像
                var picture = new Image() { Aspect = Aspect.AspectFit, WidthRequest = 50,HeightRequest=50 };
                picture.VerticalOptions = LayoutOptions.Start;//アイコンを行の上に詰めて表示
                picture.SetBinding(Image.SourceProperty, "Picture");

                //いいね数
                var likes = new Label { Font = Font.SystemFontOfSize(10), TextColor = Color.Black };
                likes.HeightRequest = 50;
                likes.YAlign = TextAlignment.Center;
                likes.SetBinding(Label.TextProperty, "Likes");

                var pictureLike = new Image() { Aspect = Aspect.AspectFit, WidthRequest = 60 };
                //picture.VerticalOptions = LayoutOptions.Start;//アイコンを行の上に詰めて表示
                pictureLike.Source = ImageSource.FromResource("FbSample.image.like.png");

                //いいね行
                var likesSub = new StackLayout {
                    Orientation = StackOrientation.Horizontal, //横に並べる
                    Children = { likes, pictureLike }
                };

                View = new StackLayout {
                    Padding = new Thickness(5),
                    Orientation = StackOrientation.Horizontal, //横に並べる
                    Children = { picture, likesSub} //アイコンとサブレイアウトを横に並べる
                };
            }
Пример #4
0
            public MyCell()
            {
                //画像
                var picture = new Image() { Aspect = Aspect.AspectFit, WidthRequest = 100, HeightRequest = 100};
                picture.VerticalOptions = LayoutOptions.Start;//アイコンを行の上に詰めて表示
                picture.SetBinding(Image.SourceProperty, "Picture");

                var createTime = new Label { Font = Font.SystemFontOfSize(10), TextColor = Color.Gray };
                createTime.SetBinding(Label.TextProperty, "CreateTime");

                var message = new Label { Font = Font.SystemFontOfSize(10), TextColor = Color.Black };
                message.SetBinding(Label.TextProperty, "Message");

                var url = new Label { Font = Font.SystemFontOfSize(9), TextColor = Color.Black };
                url.SetBinding(Label.TextProperty, "Url");

                //いいね行
                var likesSub = new StackLayout {
                    //Orientation = StackOrientation.Horizontal, //横に並べる
                    Children = { message,createTime,url }
                };

                View = new StackLayout {
                    Padding = new Thickness(5),
                    Orientation = StackOrientation.Horizontal, //横に並べる
                    Children = { picture, likesSub }
                };
            }
			public CustomVeggieCell()
			{
				//instantiate each of our views
				var image = new Image();
				var nameLabel = new Label();
				var typeLabel = new Label();
				var verticaLayout = new StackLayout();
				var horizontalLayout = new StackLayout() { BackgroundColor = Color.Olive };

				//set bindings
				nameLabel.SetBinding(Label.TextProperty, new Binding("Name"));
				typeLabel.SetBinding(Label.TextProperty, new Binding("Type"));
				image.SetBinding(Image.SourceProperty, new Binding("Image"));

				//Set properties for desired design
				horizontalLayout.Orientation = StackOrientation.Horizontal;
				horizontalLayout.HorizontalOptions = LayoutOptions.Fill;
				image.HorizontalOptions = LayoutOptions.End;
				nameLabel.FontSize = 24;

				//add views to the view hierarchy
				verticaLayout.Children.Add(nameLabel);
				verticaLayout.Children.Add(typeLabel);
				horizontalLayout.Children.Add(verticaLayout);
				horizontalLayout.Children.Add(image);
				
				// add to parent view
				View = horizontalLayout;
			}
		public ListItemTemplate ()
		{
			var photo = new Image { HeightRequest = 44, WidthRequest = 44 };
			photo.SetBinding (Image.SourceProperty, "Photo");

			var nameLabel = new Label { 
				VerticalTextAlignment = TextAlignment.Center,
				FontAttributes = FontAttributes.None,
				FontSize = Device.GetNamedSize (NamedSize.Medium, typeof(Label)),
			};

			nameLabel.SetBinding (Label.TextProperty, "Name");

			var titleLabel = new Label { 
				VerticalTextAlignment = TextAlignment.Center,
				FontAttributes = FontAttributes.None,
				FontSize = Device.GetNamedSize (NamedSize.Micro, typeof(Label)),
			};

			titleLabel.SetBinding (Label.TextProperty, "Title");

			var information = new StackLayout {
				Padding = new Thickness (5, 0, 0, 0),
				VerticalOptions = LayoutOptions.StartAndExpand,
				Orientation = StackOrientation.Vertical,
				Children = { nameLabel, titleLabel }
			};

			View = new StackLayout {
				Orientation = StackOrientation.Horizontal,
				Children = { photo, information }
			};
		}
        public CustomMenuItemCell()
        {

            CustomLayout masterLayout = new CustomLayout();
            masterLayout.BackgroundColor = Constants.MENU_BG_COLOR;
            //IDeviceSpec deviceSpec = DependencyService.Get<IDeviceSpec>();
            double screenWidth = App.screenWidth;
            double screenHeight = App.screenHeight;
            Label name = new Label();
            name.SetBinding(Label.TextProperty, "Name");
            name.TextColor = Constants.MAIN_MENU_TEXT_COLOR;//Color.Black;
            name.FontFamily = Constants.HELVERTICA_NEUE_LT_STD;
            name.FontSize = Device.OnPlatform(12, 17, 18);

            StackLayout divider = new StackLayout();
            divider.WidthRequest = screenWidth;
            divider.HeightRequest = .75;
            divider.BackgroundColor = Color.FromRgb(255, 255, 255);

            Image sideImage = new Image();
            sideImage.WidthRequest = 25;
            sideImage.HeightRequest = 25;
            sideImage.SetBinding(Image.SourceProperty, "ImageName");
            sideImage.Aspect = Aspect.Fill;

            masterLayout.WidthRequest = screenWidth;
            masterLayout.HeightRequest = screenHeight * Device.OnPlatform(30, 50, 10) / 100;

            masterLayout.AddChildToLayout(sideImage, (float)5, (float)Device.OnPlatform(5, 0, 50), (int)masterLayout.WidthRequest, (int)masterLayout.HeightRequest);
			masterLayout.AddChildToLayout(name, (float)Device.OnPlatform( 15, 15 , 15 ), (float)Device.OnPlatform(5, 0, 50), (int)masterLayout.WidthRequest, (int)masterLayout.HeightRequest);
           // masterLayout.AddChildToLayout(divider, (float)1, (float)20, (int)masterLayout.WidthRequest, (int)masterLayout.HeightRequest);
            this.View = masterLayout;
        }
Пример #8
0
        public MovieItemTemplate()
        {
            StackLayout outStack = new StackLayout (){
                Orientation=StackOrientation.Horizontal,
                HorizontalOptions=LayoutOptions.Fill
            };
            StackLayout inStack = new StackLayout (){
                Orientation=StackOrientation.Vertical,
                HorizontalOptions=LayoutOptions.CenterAndExpand
            };
            Label title = new Label {
                FontSize=20,
                HorizontalOptions=LayoutOptions.Center
            };

            title.SetBinding(Label.TextProperty, "Name");

            Label description = new Label {
                FontSize=12,
                HorizontalOptions=LayoutOptions.Center
            };

            description.SetBinding (Label.TextProperty, "Year");

            Image image = new Image ();
            image.SetBinding (Image.SourceProperty, "Image");

            inStack.Children.Add (title);
            inStack.Children.Add (description);
            outStack.Children.Add (image);
            outStack.Children.Add (inStack);
            View = outStack;
        }
Пример #9
0
        public SpeakerDetailPage(){
            NavigationPage.SetHasNavigationBar(this, true);
            BackgroundColor = Color.White;

            var nameLabel = new Label { TextColor = Color.Gray };
            nameLabel.SetBinding(Label.TextProperty, new Binding("Nombre"));

            var empresaLabel = new Label { TextColor = Color.Gray };
            empresaLabel.SetBinding(Label.TextProperty, new Binding("Empresa"));

            var twitterLabel = new Label { TextColor = Color.Gray };
            twitterLabel.SetBinding(Label.TextProperty, new Binding("Twitter"));

            var fotoImage = new Image ();
            fotoImage.SetBinding(Image.SourceProperty, new Binding("Foto"));

            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.StartAndExpand,
                Padding = 10,
                Children = { 
                    nameLabel,
                    empresaLabel,
                    twitterLabel,
                    fotoImage
                }
            };

        }
Пример #10
0
		public TodoItemCell ()
		{
			// BackgroundColor = Color.Aqua;

			var label = new Label {
				YAlign = TextAlignment.Center
			};

			label.SetBinding (Label.TextProperty, "Name");

			var tick = new Image {
				Source = FileImageSource.FromFile ("check2.png")
			};
				tick.SetBinding (Image.IsVisibleProperty, "Done");
			//tick.SetBinding (Image.IsVisibleProperty, "Remarks");

			var layout = new StackLayout {
				Padding = new Thickness (20, 0, 0, 0),
				Orientation = StackOrientation.Horizontal,
				HorizontalOptions = LayoutOptions.StartAndExpand,
				Children = { label, tick }
			};

			View = layout;
		}
Пример #11
0
        public SearchPageCell()
        {
            var itemName = new Label {
                YAlign = TextAlignment.Center,
                FontSize = 20,
                TextColor = Color.Black
            };
            itemName.SetBinding (Label.TextProperty, "ItemName");

            var itemPrice = new Label {
               // HorizontalOptions = LayoutOptions.CenterAndExpand,
               HorizontalOptions = LayoutOptions.EndAndExpand,
               YAlign = TextAlignment.Center,
                TextColor = Color.Black,
               FontSize = 16
            };

            itemPrice.SetBinding(Label.TextProperty, "ItemPriceString");

            var itemImage = new Image {

            };
            itemImage.SetBinding(Image.SourceProperty, "ItemPicture");

            var layout = new StackLayout {
                Padding = new Thickness(20, 0, 0, 0),
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                Children = {itemImage, itemName, itemPrice}
            };
            View = layout;
        }
        public FancyListCell()
        {
            var image = new Image
              {
            HorizontalOptions = LayoutOptions.Start
              };
              image.SetBinding(Image.SourceProperty, new Binding("Icon"));
              image.WidthRequest = image.HeightRequest = 50;

              var nameLabel = new Label
              {
            HorizontalOptions = LayoutOptions.FillAndExpand,
            VerticalOptions = LayoutOptions.Center,
            FontSize = 26,
            TextColor = Color.FromHex("111111")
              };
              nameLabel.SetBinding(Label.TextProperty, "Title");

              var viewLayout = new StackLayout()
              {
            Orientation = StackOrientation.Horizontal,
            Spacing = 10,
            Padding = 15,
            Children = { image, nameLabel }
              };
              View = viewLayout;
        }
Пример #13
0
		public TodoItemCell ()
		{
			StyleId = "Cell";

			var label = new Label {
				StyleId = "CellLabel",
				YAlign = TextAlignment.Center,
				HorizontalOptions = LayoutOptions.StartAndExpand
			};
			label.SetBinding (Label.TextProperty, "Name");

			var tick = new Image {
				StyleId = "CellTick",
				Source = FileImageSource.FromFile ("check"),
				HorizontalOptions = LayoutOptions.End
			};
			tick.SetBinding (Image.IsVisibleProperty, "Done");

			var layout = new StackLayout {
				Padding = new Thickness(20, 0, 20, 0),
				Orientation = StackOrientation.Horizontal,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				Children = {label, tick}
			};
			View = layout;
		}
Пример #14
0
        public customCellTags()
        {
            Label l = new Label{
                FontSize = 18,
                FontAttributes = FontAttributes.Bold,
                XAlign = TextAlignment.Center,
                YAlign = TextAlignment.Center,
                WidthRequest = 200
            };

            l.SetBinding (Label.TextProperty, "Name");
            l.SetBinding (Label.TextColorProperty, "TextColour");

            Image i = new Image {
            };

            i.SetBinding (Image.SourceProperty, "checkImage");

            StackLayout cellLayout = new StackLayout {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Spacing = 20,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Orientation = StackOrientation.Horizontal,
                Padding = 5
            };

            cellLayout.Children.Add (i);
            cellLayout.Children.Add (l);

            this.View = cellLayout;
        }
		public ListOfBeerCell2 ()
		{
			var preBlank = new Label {
				Text = "",
				FontSize = 11
			};

			var image = new Image
			{
				Aspect = Aspect.AspectFill,
				//WidthRequest = 150,

				HorizontalOptions = LayoutOptions.Start,
				VerticalOptions = LayoutOptions.Center
			};
			image.SetBinding(Image.SourceProperty, new Binding("ProName"));

			var rslayout = CreateRightSideLayout ();

			var ctrlayout = CreateMiddleLayout ();

			var ctrrghtlayout = CreateMiddleRightLayout ();

			var leftImageLayout = new StackLayout()
			{
				Spacing = 2,
				Padding = new Thickness (5, 5, 0, 5),
				VerticalOptions = LayoutOptions.Center,
				Orientation = StackOrientation.Horizontal,
				Children = {image, ctrlayout, ctrrghtlayout, rslayout}
			};
			View = leftImageLayout;
		}
Пример #16
0
		public EnqueteViewCell()
		{
			var imgQuote = new Image
			{
				HorizontalOptions = LayoutOptions.StartAndExpand
			};
			imgQuote.SetBinding(Image.SourceProperty, "ImageSource");

			var lblTitulo = new Label
			{
				HorizontalOptions = LayoutOptions.Center,
				YAlign = TextAlignment.Center,
				Style = Estilos._estiloFonteEnquete
			};
			lblTitulo.SetBinding(Label.TextProperty, "Titulo");

			var imgSetaDireita = new Image
			{
				HorizontalOptions = LayoutOptions.EndAndExpand,
				Source = ImageSource.FromResource(RetornaCaminhoImagem.GetImagemCaminho("setaDireita2.png")),
				Aspect = Aspect.AspectFit
			};

			var mainLayout = new StackLayout
			{
				VerticalOptions = LayoutOptions.FillAndExpand,
				Orientation = StackOrientation.Horizontal,
				BackgroundColor = Color.FromHex("#002347"),
				Children = { imgQuote, lblTitulo, imgSetaDireita },
				Padding = new Thickness(8, 0, 0, 0)
			};
			
			this.View = mainLayout;
		}
Пример #17
0
        public sideCustomViewCell()
        {
            StackLayout s = new StackLayout {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                Orientation = StackOrientation.Horizontal,
                Padding = 10,
                Spacing = 10
            };
            s.SetBinding (StackLayout.BackgroundColorProperty, "Background");

            Label l = new Label {
                FontSize = 17,
                FontAttributes = FontAttributes.Bold,
                XAlign = TextAlignment.Center,
                YAlign = TextAlignment.Center
            };
            l.SetBinding (Label.TextProperty, "Title");
            l.SetBinding (Label.TextColorProperty, "TextColour");

            Image i = new Image {
            };
            i.SetBinding (Image.SourceProperty, "IconSource");

            s.Children.Add (i);
            s.Children.Add (l);

            this.View = s;
        }
        public static StackLayout GetCountryRenderChartTooltip(FlexChart flexChart)
        {
            Image image = new Image();
            Label title = new Label();
            Label content = new Label();

            StackLayout container = new StackLayout();
            container.Padding = 5;


            container.BackgroundColor = Color.FromHex("#FFFFCA");

            title.SetBinding(Label.TextProperty, "SeriesName");
            title.TextColor = Color.Black;
            title.FontAttributes = FontAttributes.Bold;
            title.FontSize = 14;
            image.SetBinding(Image.SourceProperty, "XValue", BindingMode.OneWay, new FlagConverter());

            StackLayout horizontalContainer = new StackLayout();
            horizontalContainer.Orientation = StackOrientation.Horizontal;

            content.SetBinding(Label.TextProperty, "YValue");
            content.TextColor = Color.Black;
            content.FontSize = 14;

            horizontalContainer.Children.Add(image);
            horizontalContainer.Children.Add(title);

            container.Children.Add(horizontalContainer);
            container.Children.Add(content);

            return container;

            //((RelativeLayout)flexChart.Parent).Children.Add(this, Constraint.Constant(50), Constraint.Constant(50));
        }
Пример #19
0
        public MenuViewCell()
        {
            var img = new Image
            {
                VerticalOptions = LayoutOptions.Start
            };
            img.SetBinding(Image.SourceProperty, "Icone");

            var lblMenu = new Label
            {
                Style = Estilos._estiloFonteMenu
            };
            lblMenu.SetBinding(Label.TextProperty, "Titulo");

            var mainLayout = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = { img, lblMenu },
                Padding = 10
            };

            mainLayout.SetBinding(StackLayout.BackgroundColorProperty, "Color");

            this.View = mainLayout;
        }
Пример #20
0
        public RangeSliderBubble()
        {
            // Init
            this.BackgroundColor = Color.Transparent;

            // Image
            _image = new Image();

            AbsoluteLayout.SetLayoutFlags(_image, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(_image, new Rectangle(0f, 0f, 1f, 1f));

            _image.SetBinding(Image.SourceProperty, new Binding(path: "Source", source: this));

            this.Children.Add(_image);

            // Label
            _label = new Label() { VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center };

            AbsoluteLayout.SetLayoutFlags(_label, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(_label, new Rectangle(0.5f, 0.7f, 0.8f, 0.6f));

            _label.SetBinding(Label.TextProperty, new Binding(path: "Text", source: this));

            this.Children.Add(_label);
        }
Пример #21
0
        public UserCell()
        {
            layout = new StackLayout {
                Orientation = StackOrientation.Horizontal,
                Padding = 5
            };

            profileImage = new Image {
                HorizontalOptions = LayoutOptions.Start ,
            };
            profileImage.SetBinding (Image.SourceProperty, new Binding ("ProfileImage"));

            usernameLabel = new Label {
                FontFamily = "AvenirNext-Regular",
                FontSize = 14,
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            usernameLabel.SetBinding (Label.TextProperty, "Username");

            layout.Children.Add (profileImage);
            layout.Children.Add (usernameLabel);

            View = layout;
        }
Пример #22
0
        public ClubMemberViewCell()
        {

            nameTGR = new TapGestureRecognizer();
            nameTGR.Tapped += NameTGR_Tapped;

            ch = new ColorHandler();
            iEmoji = new Image
            {
                Aspect = Aspect.AspectFit,
                WidthRequest = 75,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                VerticalOptions = LayoutOptions.Center
            };
            iEmoji.SetBinding(Image.SourceProperty, "Emoji");
            lUsername = new Label
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                VerticalOptions = LayoutOptions.Center
            };
            lUsername.SetBinding(Label.TextProperty, "Username");
            lUsername.SetBinding(Label.TextColorProperty, "UserColor", converter: new ColorConverter());
            lUsername.GestureRecognizers.Add(nameTGR);
            updateView();
        }
		public ToolBarFilters (FilterTypes filter)
		{
			BindingContext = new FilterViewModel(filter);
			Title = ViewModel.Title;
		

			listView = new ListView () {
				ItemsSource = ViewModel.Items,
				BackgroundColor = Color.Transparent,
				ItemTemplate = new DataTemplate (() => {
					Label titleLabel = new Label ();
					titleLabel.VerticalOptions = LayoutOptions.Center;
					titleLabel.SetBinding (Label.TextProperty, "Name");

					Image blueCheck = new Image ();
					blueCheck.Source = "corningimages/selected.png";
					blueCheck.WidthRequest = 18;
					blueCheck.HeightRequest = 18;
					blueCheck.HorizontalOptions = LayoutOptions.EndAndExpand;
					blueCheck.SetBinding (Image.IsVisibleProperty, "IsSelected");

					return new ViewCell {
						View = new StackLayout {
							Orientation = StackOrientation.Horizontal,
							HorizontalOptions = LayoutOptions.StartAndExpand,
							Padding = new Thickness(20,0,10,0),
							Children = { titleLabel, blueCheck }
						}
					};
				})
			};
					

			listView.ItemSelected += (sender, e) =>
			{
				if (e.SelectedItem == null)
					return;

				var item =(MultiSelectSource)e.SelectedItem;
				if(filter == FilterTypes.Categories){
					GlobalVariables.SelectedCategory = item.Name;
					GlobalVariables.SelectedCategoryCode = item.Code;
				} else {
					GlobalVariables.SelectedLanguage = item.Code;
				}
				Navigation.PopModalAsync (true);
			};


			Content = new StackLayout { 
				Children = {
					listView
				}
			};

			this.ToolbarItems.Add (new ToolbarItem (Translation.Localize("DoneLabel"), null, () => {
				Navigation.PopModalAsync (true);
			}));
		}
Пример #24
0
		public VTSListViewTemplate ()
		{
			var profileImage = new Image {
				HeightRequest = 50,
				WidthRequest = 50,
				Aspect = Aspect.AspectFill,
				HorizontalOptions = LayoutOptions.Center,
				VerticalOptions = LayoutOptions.Center,
			};
			profileImage.SetBinding (Image.SourceProperty, "ImageSRC");
		
			var nameLabel = new Label () {
				FontFamily = "HelveticaNeue-Medium",
				FontSize = 18,
				TextColor = Color.Black
			};
			nameLabel.SetBinding (Label.TextProperty, "VacationType");

			var detailLabel = new Label () {
				FontAttributes = FontAttributes.Bold,
				FontSize = 12,
				TextColor = Color.FromHex ("#666")
			};
			detailLabel.SetBinding (Label.TextProperty, new Binding ("Date"));

			var statusLayout = new StackLayout {
				Orientation = StackOrientation.Horizontal,
				Children = { detailLabel }
			};
		
			var detailsLayout = new StackLayout {
				Padding = new Thickness (10, 0, 0, 0),
				Spacing = 0,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				Children = { nameLabel, statusLayout }
			};
		
			var status = new Image () {
				Source = "greenCircle.png",
				HorizontalOptions = LayoutOptions.End,
				HeightRequest = 12,
			};
			status.SetBinding (Image.SourceProperty, "Status");
		
			var cellLayout = new StackLayout {
				Spacing = 0,
				Padding = new Thickness (10, 5, 10, 5),
				Orientation = StackOrientation.Horizontal,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				Children = { 
					profileImage,
					detailsLayout, 
					status
				}
			};

			this.View = cellLayout;
		}
        public viewcellitems()
        {
            #region creation de la view
            Nom_produit = new Label () {
                FontAttributes = FontAttributes.Bold,
                FontSize = 20,
                TextColor = Color.Black
            };
            Nom_produit.SetBinding (Label.TextProperty, "Nom_produit");

            var IconAnzeige = new Image ();
            IconAnzeige.SetBinding (Image.SourceProperty, new Binding ("IconName", BindingMode.OneWay, new StringToImageConverter ()));
            IconAnzeige.HeightRequest = 50;
            IconAnzeige.HorizontalOptions = LayoutOptions.EndAndExpand;
            IconAnzeige.VerticalOptions = LayoutOptions.End;

            Detail = new Label () {
                FontAttributes = FontAttributes.Bold,
                FontSize = 16,
                TextColor = Color.FromHex ("ff3498dc")
            };
            Detail.SetBinding (Label.TextProperty, "Detail");

            #region grid
            var rowdefdef = new RowDefinition {
                Height = GridLength.Auto,

            };
            var columndef = new ColumnDefinition {
                Width = GridLength.Auto
            };

            var grid = new Grid {
                HorizontalOptions = LayoutOptions.Fill,
                Padding = 5
            };
            grid.RowDefinitions.Add (rowdefdef);
            grid.ColumnDefinitions.Add (columndef);

            Nom_produit.SetValue (Grid.ColumnProperty, 0);
            Nom_produit.SetValue (Grid.RowProperty, 0);
            grid.Children.Add (Nom_produit);

            Detail.SetValue (Grid.ColumnProperty, 0);
            Detail.SetValue (Grid.RowProperty, 1);
            grid.Children.Add (Detail);

            IconAnzeige.SetValue (Grid.ColumnProperty, 1);
            IconAnzeige.SetValue (Grid.RowProperty, 0);
            grid.Children.Add (IconAnzeige);

            #endregion

            View = grid;

            #endregion
        }
        public HorariosDisponiveisCell()
        {
            var Name = new Label
            {
                Style = Styles.DefaultCellText,
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
            };
            Name.SetBinding(Label.TextProperty, "Name");

            Image icon = new Image
            {
                Aspect = Aspect.AspectFill,
                WidthRequest = 30,
                HeightRequest = 30,
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                //BackgroundColor = Color.Black
            };
            icon.SetBinding(VisualElement.IsVisibleProperty, "IsSelected");
            icon.SetBinding(Image.SourceProperty, "Icon");

            StackLayout stack = new StackLayout
            {
                Padding = new Thickness(15, 0, 0, 0),
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                Orientation = StackOrientation.Horizontal,
                Children = {
                    icon, Name
                }
            };

            var absoluteLayout = new AbsoluteLayout();
            var background = new Image
            {
                Style = Styles.CellBackground
            };

            absoluteLayout.Children.Add(background, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
            absoluteLayout.Children.Add(stack, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);

            View = absoluteLayout;
        }
Пример #27
0
        private void updateView()
        {
            iEmoji = new Image
            {
                Aspect = Aspect.AspectFit,
                WidthRequest = 75,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                VerticalOptions = LayoutOptions.Center
            };
            iEmoji.SetBinding(Image.SourceProperty, "Emoji");

            lUsername = new Label
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                VerticalOptions = LayoutOptions.Center
            };
            lUsername.SetBinding(Label.TextProperty, "Username");
            lUsername.SetBinding(Label.TextColorProperty, "UserColor", converter: new ColorConverter());

            bAddFriend = new Button
            {
                Text = "+",
                FontAttributes = FontAttributes.Bold,
                TextColor = ch.fromStringToColor("gray"),
                BackgroundColor = ch.fromStringToColor("white"),
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions = LayoutOptions.Center
            };
            bAddFriend.Clicked += BAddFriend_Clicked;

            bFriendsIndicator = new Button
            {
                BackgroundColor = ch.fromStringToColor("yellow"),
                BorderRadius = 100,
                HeightRequest = 20,
                WidthRequest = 20,
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions = LayoutOptions.Center,
                IsVisible = false
            };

            View = new StackLayout
            {
                Children ={
                    iEmoji,
                    lUsername,
                    bAddFriend,
                    bFriendsIndicator
                },
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding = new Thickness(10, 0, 10, 0),
                BackgroundColor = ch.fromStringToColor("white")
            };
        }
Пример #28
0
 public TaskViewCell()
 {
     var lblTitle = new Label { YAlign = TextAlignment.Center};
     lblTitle.SetBinding (Label.TextProperty, "Title");
     var tick = new Image {
         Source = FileImageSource.FromFile ("check.png"),
     };
     tick.SetBinding (Image.IsVisibleProperty, "Completed", BindingMode.Default);
     this.View = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { lblTitle, tick }, Padding = new Thickness(10, 0) };
 }
Пример #29
0
        public IndividualListCell()
        {
            var itemName = new Label {
                YAlign = TextAlignment.Center,
                FontSize = 20,
                TextColor = Color.Black
            };
            itemName.SetBinding(Label.TextProperty, "ListDataItemName");

            itemQuantity = new Label {
               HorizontalOptions = LayoutOptions.CenterAndExpand,
                YAlign = TextAlignment.Center,
                TextColor = Color.Black,
                FontSize = 16
            };

            itemQuantity.SetBinding(Label.TextProperty, "itemQuantity");

            Stepper stepper = new Stepper {
                Minimum = 1.0,
                Maximum = 10.0,
                Increment = 1.0,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            stepper.SetBinding(Stepper.ValueProperty, "itemQuantity");
            stepper.ValueChanged += OnStepperValueChanged;

            var addToBasketButton = new Button {
                Text = "Add to Basket",
                HorizontalOptions = LayoutOptions.CenterAndExpand
               // VerticalOptions = LayoutOptions.FillAndExpand,

            };
            addToBasketButton.Clicked += (sender, e) => {

                var item = (TapandGo.Data.ItemsListData)BindingContext;
                TapandGo.Database.Database.GetDatabase().TransferFromListToBasket(item.ItemId, item.ListDataItemName, item.itemQuantity, item.ListDataItemPrice, item.ListDataItemPicture, item.ListDataItemPriceString);

            };

            var itemImage = new Image {

            };
            itemImage.SetBinding(Image.SourceProperty, "ListDataItemPicture");

            var layout = new StackLayout {
                Padding = new Thickness(20, 0, 0, 0),
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                Children = {itemImage, itemName, itemQuantity, stepper}
            };

            View = layout;
        }
        public ListaRespostasViewCell()
        {
            var imgResposta = new Image
            {
                HorizontalOptions = LayoutOptions.Start,
            };
            imgResposta.SetBinding<Resposta>(Image.SourceProperty, x => x.ImgSource);

            imgResposta2 = new Image();
            imgResposta2.HeightRequest = 100;
            imgResposta2.WidthRequest = 120;
            imgResposta2.SetBinding(Image.SourceProperty, new Binding("ImgRespostaSource"));
            imgResposta2.SetBinding(Image.ClassIdProperty, new Binding("Imagem"));

            var imgResposta_Click = new TapGestureRecognizer();
            imgResposta_Click.Tapped += async (sender, e) =>
            {
                var fileName = ((Image)sender).ClassId;
                var img = DependencyService.Get<ISaveAndLoadFile>().GetImage(fileName);
                MessagingCenter.Send<ListaRespostasViewCell,string>(this, "MostraImagem", img);
            };
            imgResposta2.GestureRecognizers.Add(imgResposta_Click);

            var lblTituloResposta = new Label
            {
                HorizontalOptions = LayoutOptions.Center,
                Style = Estilos._estiloFonteCategorias,
                YAlign = TextAlignment.Center,
                XAlign = TextAlignment.Start
            };
            lblTituloResposta.SetBinding<Resposta>(Label.TextProperty, x => x.TextoResposta);

            var layout = new StackLayout
            {
                Padding = new Thickness(5, 15, 5, 0),
                VerticalOptions = LayoutOptions.FillAndExpand,
                Orientation = StackOrientation.Horizontal,
                Children = { imgResposta, imgResposta2, lblTituloResposta }
            };
			
            this.View = layout;
        }