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


C# Label.SetValue方法代码示例

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


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

示例1: viewcellitems

        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
        }
开发者ID:EricPucho,项目名称:Listview_with_checkbox_XF,代码行数:57,代码来源:viewcellitems.cs

示例2: CommitmentPage

        public CommitmentPage(Commitment commitment)
        {
            _commitment = commitment;
            BindingContext = commitment;

            var grid = new Grid() {
                RowDefinitions = new RowDefinitionCollection {
                    new RowDefinition(),
                    new RowDefinition(),
                },
                ColumnDefinitions = new ColumnDefinitionCollection {
                    new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) },
                    new ColumnDefinition { Width = new GridLength(2, GridUnitType.Star) },
                }
            };

            var plannedLabel = new Label {
                Text = "I am"
            };
            plannedLabel.SetValue(Grid.RowProperty, 0);

            var plannedTextCell = new TextCell {

            };
            plannedTextCell.SetBinding(TextCell.TextProperty, "Status");
            grid.Children.Add(plannedLabel);

            Content = grid;
        }
开发者ID:dayewah,项目名称:crisischeckin,代码行数:29,代码来源:CommitmentPage.cs


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