本文整理汇总了C#中System.Windows.Controls.ContentControl.TransformToAncestor方法的典型用法代码示例。如果您正苦于以下问题:C# ContentControl.TransformToAncestor方法的具体用法?C# ContentControl.TransformToAncestor怎么用?C# ContentControl.TransformToAncestor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.ContentControl
的用法示例。
在下文中一共展示了ContentControl.TransformToAncestor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateVideoWindow
private Window CreateVideoWindow(ContentControl videoBorder, VideoWindowViewModel vm)
{
Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
double x = p.X;
double y = p.Y;
VideoWindow videoWnd = new VideoWindow(vm, true);
videoWnd.OffsetX = x;
videoWnd.OffsetY = y;
videoWnd.ReplicatedControl = videoBorder;
videoWnd.Top = Top + videoWnd.OffsetY;
videoWnd.Left = Left + videoWnd.OffsetX;
videoWnd.Owner = this;
videoWnd.Show();
return videoWnd;
//Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
//double x = p.X;
//double y = p.Y;
//return CreateWindowInSeparateThread<VideoWindowAction>(() =>
//{
// return new VideoWindow(vm, true);
//},
// x, y, false, true, videoBorder);
}
示例2: CreateVideoWindow
private Window CreateVideoWindow(ContentControl videoBorder,VideoWindowViewModel vm)
{
Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
double x = p.X;
double y = p.Y;
YoYoStudio.Controls.CustomWindow.ChildWindow<VideoWindowAction> videoWnd = new VideoWindow(vm, true);
//VideoWindow videoWnd = new VideoWindow(vm, true);
videoWnd.SetParent<RoomWindowAction>(this, true);
videoWnd.OffsetX = x;
videoWnd.OffsetY = y;
videoWnd.ReplicatedControl = videoBorder;
videoWnd.Top = Top + videoWnd.OffsetY;
videoWnd.Left = Left + videoWnd.OffsetX;
videoWnd.Owner = this;
videoWnd.Show();
return videoWnd;
//Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
//double x = p.X;
//double y = p.Y;
//VideoWindow wnd = CreateWindowInSeparateThread<VideoWindowAction>(() =>
//{
// return new VideoWindow(vm, true);
//},
// x, y, false, true, videoBorder) as VideoWindow;
//wnd.MouseLeftButtonUp += wnd_MouseLeftButtonUp;
//return wnd;
}
示例3: CreateVideoWindow
private Window CreateVideoWindow(ContentControl videoBorder,VideoWindowViewModel vm)
{
Point p = videoBorder.TransformToAncestor(this).Transform(new Point(0, 0));
double x = p.X;
double y = p.Y;
return CreateWindowInSeparateThread<VideoWindowAction>(() =>
{
return new VideoWindow(vm,true);
},
x, y, false, true, videoBorder);
}