本文整理汇总了C#中System.Windows.Controls.Grid.InvalidateVisual方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.InvalidateVisual方法的具体用法?C# Grid.InvalidateVisual怎么用?C# Grid.InvalidateVisual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Grid
的用法示例。
在下文中一共展示了Grid.InvalidateVisual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: newVarRow
private TextBox newVarRow(String varname, String varvalue)
{
Grid g = new Grid();
g.ColumnDefinitions.Add(new ColumnDefinition());
g.ColumnDefinitions.Add(new ColumnDefinition());
g.ColumnDefinitions[0].Width = new GridLength(100);
TextBox b = new TextBox();
g.Children.Add(b);
Grid.SetColumn(b, 1);
TextBlock t = new TextBlock();
g.Children.Add(t);
Grid.SetColumn(t, 0);
t.Foreground = Brushes.White;
t.Text = varname;
b.Tag = varname;
b.TextAlignment = TextAlignment.Right;
b.Text = varvalue;
b.TextChanged += new TextChangedEventHandler(b_TextChanged);
b.KeyDown += new KeyEventHandler(b_KeyDown);
g.InvalidateVisual();
this.stack.Children.Add(g);
return b;
}
示例2: RebuildGridChildren
private static void RebuildGridChildren(Grid grid)
{
int column = 0;
int row = 0;
var columnCount = GetColumns(grid);
for (int i = 0; i < grid.Children.Count; i++)
{
var child = grid.Children[i];
if (child == null) continue;
Grid.SetColumn(child, column);
Grid.SetRow(child, row);
column++;
if (column >= columnCount)
{
column = 0;
row++;
}
}
grid.InvalidateArrange();
grid.InvalidateVisual();
}