本文整理汇总了C#中System.Windows.Controls.Label.Arrange方法的典型用法代码示例。如果您正苦于以下问题:C# Label.Arrange方法的具体用法?C# Label.Arrange怎么用?C# Label.Arrange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Label
的用法示例。
在下文中一共展示了Label.Arrange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createNewConcept
public void createNewConcept(double x, double y, String type, String name, String attributs, String methods)
{
if (classes == null)
classes = new List<Classe>();
Label nam, var, fun;
var = new Label
{
Content = attributs == "" ? "attributs" : attributs,
FontSize = 16,
Margin = new Thickness(x, y, 0, 0),
};
fun = new Label
{
Content = methods == "" ? "methodes" : methods,
FontSize = 16,
Margin = new Thickness(x, y, 0, 0)
};
nam = new Label
{
Content = name == "" ? "classe : " + classes.Count : name,
FontSize = 16,
Margin = new Thickness(x, y, 0, 0)
};
nam.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
nam.Arrange(new Rect(nam.DesiredSize));
double myWidth = nam.ActualWidth;
double myHeight = nam.ActualHeight + LABEL_SPACE;
Classe clas = new Classe();
double i = 0;
if (type.Contains("classe"))
i = 0.5;
else
i = 4;
clas.Cadres = new List<Rectangle>();
clas.Cadres.Add(generateMyRect(myWidth + LABEL_SPACE*2, myHeight, x - LABEL_SPACE, y, i));
clas.Cadres.Add(generateMyRect(myWidth + LABEL_SPACE * 2, myHeight, x - LABEL_SPACE, y + myHeight + 4, i));
clas.Cadres.Add(generateMyRect(myWidth + LABEL_SPACE * 2, myHeight, x - LABEL_SPACE, y + myHeight * 2 + 8, i));
clas.Cadres.Add(generateMyRect(LABEL_SPACE * 4, LABEL_SPACE * 4, x - LABEL_SPACE, y - LABEL_SPACE * 4, 0.5));
clas.Cadres.Add(generateMyRect(LABEL_SPACE * 4, LABEL_SPACE * 4, x + LABEL_SPACE*3, y - LABEL_SPACE * 4, 0.5));
//clas.Cadres.Add(generateMyRect(myWidth + LABEL_SPACE * 2, myHeight, x - LABEL_SPACE, y, i));
clas.Cadres[3].Fill = new SolidColorBrush(Colors.Red);
clas.Cadres[4].Fill = new SolidColorBrush(Colors.Blue);
clas.Nom = nam;
var.Margin = clas.Cadres[1].Margin;
clas.Variables = var;
fun.Margin = clas.Cadres[2].Margin;
clas.Fonctions = fun;
clas.Type = type;
clas.Nom_tb = generateTextBox(myWidth + LABEL_SPACE * 2
, myHeight
, clas.Cadres[0].Margin
, clas.Nom.Content.ToString());
clas.Variables_tb = generateRichTextBox(myWidth + LABEL_SPACE * 2
, myHeight
, clas.Cadres[1].Margin);
clas.Fonctions_tb = generateRichTextBox(myWidth + LABEL_SPACE * 2
, myHeight
, clas.Cadres[2].Margin);
classes.Add(clas);
back.Children.Add(clas.Cadres[0]);
back.Children.Add(clas.Cadres[1]);
back.Children.Add(clas.Cadres[2]);
back.Children.Add(clas.Cadres[3]);
back.Children.Add(clas.Cadres[4]);
back.Children.Add(clas.Nom);
back.Children.Add(clas.Nom_tb);
back.Children.Add(clas.Variables);
back.Children.Add(clas.Variables_tb);
back.Children.Add(clas.Fonctions);
back.Children.Add(clas.Fonctions_tb);
}