本文整理汇总了C#中UIElement.Count方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.Count方法的具体用法?C# UIElement.Count怎么用?C# UIElement.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIElement
的用法示例。
在下文中一共展示了UIElement.Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveRangeOfChildren
public static void RemoveRangeOfChildren(UIElement[] children, Grid grid)
{
//80% radi kako treba
int start_time = 100;
Thread t = new Thread(new ThreadStart(() =>
{
Thread.Sleep(start_time);
grid.Dispatcher.Invoke(new Action(() =>
{
foreach (var c in children)
{
Animate.RemoveChildAnimate(c, grid);
}
}));
}));
List<UIElement> tmp = null;
List<UIElement> tmp1 = null;
if (grid.Children.IndexOf(children[0]) == 0)
{
tmp = new List<UIElement>();
tmp.AddRange(grid.Children.Cast<UIElement>().Skip(children.Count()).ToArray());
grid.Children.Clear();
}
else
{
tmp = new List<UIElement>();
tmp1 = new List<UIElement>();
tmp1.AddRange(grid.Children.Cast<UIElement>().Take(grid.Children.IndexOf(children[0])).ToArray());
tmp.AddRange(grid.Children.Cast<UIElement>().Skip(children.Count()).ToArray());
}
grid.Children.Clear();
if (tmp1 != null)
{
for (int k = 0; k < children.Count(); k++)
{
grid.Children.Add(tmp1[k]);
}
}
foreach (var c in tmp)
{
c.Opacity = 0.5;
Animate.AddChild(c, grid);
if (Grid.GetRow(c) > 0)
Animate.MoveUp(c, grid, start_time += 50);
if (Grid.GetRow(c) == 0 && Grid.GetColumn(c) > 0)
Animate.MoveDiagonally(c, grid, start_time);
c.Opacity = 1.0;
}
}