本文整理汇总了C#中UIElement.Select方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.Select方法的具体用法?C# UIElement.Select怎么用?C# UIElement.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIElement
的用法示例。
在下文中一共展示了UIElement.Select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateClick
private void GenerateClick(object sender, RoutedEventArgs e)
{
UIElement[] array = new UIElement[VideoViewPort.Children.Count];
VideoViewPort.Children.CopyTo(array, 0);
IEnumerable<IWidget> widgets = array.Select(x => (IWidget)x);
foreach (var widget in widgets)
{
Draggables.Base.DraggableBase variable = widget as Draggables.Base.DraggableBase;
if (variable != null)
{
variable.FreezeAttributes();
}
}
//VideoCreator creator = new VideoCreator(GetData(), widgets, 25); // Danny's
VideoCreator creator = new VideoCreator(GetData(), widgets, 30); // JD's
creator.ProgressUpdate += OnProgressUpdate;
creator.FinishedProcessing += OnFinishedProcessing;
GenerateButton.IsEnabled = false;
FileInfo inputFile = new FileInfo(inputFileName);
Task.Factory.StartNew(() => creator.Create(inputFileName, Path.Combine(inputFile.Directory.FullName, outputFileName)));
}
示例2: TestIfClonedWpfControlWillBeEqualToItsPrototype
public void TestIfClonedWpfControlWillBeEqualToItsPrototype()
{
var prototypes = new UIElement[] { new Button().AddAsChildTo(new Grid()), new TextBlock() { Text = "pesho" }, new Button(), new Image() { Height = 30 } };
var clones = prototypes.Select(proto => proto.Clone()).ToArray();
for (int i = 0, length = prototypes.Length; i < length; i++)
{
var protoAsString = XamlWriter.Save(prototypes[i]);
var cloneAsString = XamlWriter.Save(clones[i]);
Assert.AreEqual(protoAsString, cloneAsString);
}
}