本文整理汇总了C#中System.Windows.Controls.Grid.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.Add方法的具体用法?C# Grid.Add怎么用?C# Grid.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Grid
的用法示例。
在下文中一共展示了Grid.Add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTwice
public void AddTwice ()
{
ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
ColumnDefinition d = new ColumnDefinition ();
c.Add (d);
c.Add (d);
}
示例2: GeneralRequestVisualizer
public GeneralRequestVisualizer()
{
title = NameValuePanel.Create("Title", new TextBox());
var url = NameValuePanel.Create("URL", new TextBox());
var method = new ComboBox
{
VerticalAlignment = VerticalAlignment.Bottom,
Margin = new Thickness(0, 0, 5, 0),
SelectedIndex = 0
};
var urlAndMethod = new Grid();
urlAndMethod.AddColumn(1, GridUnitType.Star);
urlAndMethod.AddColumn(100, GridUnitType.Pixel);
urlAndMethod.AddRow(GridLength.Auto);
urlAndMethod.Add(url, 0, 0);
urlAndMethod.Add(method, 0, 1);
var apiGeneralStackPanel = new StackPanel
{
Margin = new Thickness(0, 0, 0, 10)
};
apiGeneralStackPanel.Children.Add(title);
apiGeneralStackPanel.Children.Add(urlAndMethod);
Children.Add(apiGeneralStackPanel);
this.Bind(x => x.Model.Title).Mate(title.Value);
this.Bind(x => x.Model.Url).Mate(url.Value);
this.Bind(x => x.Model.Method).Mate(method, x => x.MainWindow.Methods);
}
示例3: AddToMultipleCollections
public void AddToMultipleCollections ()
{
ColumnDefinitionCollection c1 = new Grid ().ColumnDefinitions;
ColumnDefinitionCollection c2 = new Grid ().ColumnDefinitions;
ColumnDefinition d = new ColumnDefinition ();
c1.Add (d);
c2.Add (d);
}
示例4: AddToMultipleCollectionsOne2
public void AddToMultipleCollectionsOne2 ()
{
ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
ColumnDefinition d = new ColumnDefinition ();
c.Add (d);
c.Remove (d);
c = new Grid ().ColumnDefinitions;
c.Add (d);
}
示例5: CreateControls
public TestLineControls CreateControls(Grid grid)
{
var controls = new TestLineControls
{
Icon = icon,
Path = path,
Run = run,
Status = status
};
int rowIndex = grid.RowDefinitions.Count;
grid.RowDefinitions.Add(new RowDefinition
{
Height = new GridLength(30)
});
mainPanel.Children.Remove(namePanel);
grid.Add(namePanel, rowIndex, 0);
mainPanel.Children.Remove(status);
grid.Add(status, rowIndex, 1);
return controls;
}
示例6: IListCopyTo
public void IListCopyTo ()
{
ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
c.Add (new ColumnDefinition ());
((IList)c).CopyTo (new object [1], 0);
}
示例7: IListIndexerSetNull
public void IListIndexerSetNull ()
{
ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
ColumnDefinition d = new ColumnDefinition ();
c.Add (d);
((IList)c) [0] = null;
}
示例8: IndexerSetOutOfRangeFromAnotherCollection
public void IndexerSetOutOfRangeFromAnotherCollection ()
{
ColumnDefinitionCollection c1 = new Grid ().ColumnDefinitions;
ColumnDefinition d = new ColumnDefinition ();
c1.Add (d);
ColumnDefinitionCollection c2 = new Grid ().ColumnDefinitions;
c2 [0] = d;
}
示例9: IndexerSetSame
public void IndexerSetSame ()
{
ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
ColumnDefinition d = new ColumnDefinition ();
c.Add (d);
c [0] = d;
}
示例10: IndexerSetAtIndexInRange
public void IndexerSetAtIndexInRange ()
{
ColumnDefinitionCollection c = new Grid ().ColumnDefinitions;
ColumnDefinition d = new ColumnDefinition ();
c.Add (d);
c [0] = new ColumnDefinition ();
Assert.AreNotEqual (c [0], d);
}