本文整理汇总了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
}
示例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;
}