本文整理汇总了C#中System.Windows.Controls.Canvas.SetZIndex方法的典型用法代码示例。如果您正苦于以下问题:C# Canvas.SetZIndex方法的具体用法?C# Canvas.SetZIndex怎么用?C# Canvas.SetZIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Canvas
的用法示例。
在下文中一共展示了Canvas.SetZIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DialogPanelInit
public void DialogPanelInit(FrameworkElement thisElement, bool bModal, EventHandler closeHandler)
{
m_CloseHandler = closeHandler;
m_this = thisElement;
m_this.SizeChanged += SizeChanged;
m_this.Visibility = Visibility.Collapsed;
m_this.SetZIndex(99);
m_this.MouseLeftButtonDown += MouseLeftButtonDown;
m_this.MouseLeftButtonUp += MouseLeftButtonUp;
m_this.MouseMove += MouseMove;
if (bModal)
{
m_BackgroundElement = new Canvas();
m_BackgroundElement.Visibility = Visibility.Collapsed;
m_BackgroundElement.SetZIndex(99);
m_BackgroundElement.Background = new SolidColorBrush("#AAFFFFFF".ToColor());
m_BackgroundElement.Width = BrowserScreenInformation.ScreenWidth;
m_BackgroundElement.Height = BrowserScreenInformation.ScreenHeight;
m_BackgroundElement.Children.Add(m_this);
m_RootDialogElement = m_BackgroundElement;
}
else
{
m_BackgroundElement = null;
m_RootDialogElement = m_this;
}
ApplicationEx.RootPanel.Children.Add(m_RootDialogElement);
DialogPanelShow(true);
}
示例2: InitializeDialogPanel
internal void InitializeDialogPanel(bool modal, Control focusControl, Panel parent)
{
lock (m_Lock)
{
m_Parent = parent;
m_FocusControl = focusControl;
base.Loaded += OnLoaded;
base.SizeChanged += OnSizeChanged; // Sent when the dialog is first created
base.Visibility = Visibility.Collapsed;
this.SetZIndex((int)Interlocked.Increment(ref m_RunningZIndex));
if (modal)
{
if (m_ModalBackground == null)
{
m_ModalBackground = new Canvas();
m_ModalBackground.SetZIndex(m_BackgroundZIndex);
m_ModalBackground.Visibility = Visibility.Collapsed;
m_ModalBackground.Background = new SolidColorBrush(Color.FromArgb(0xAA, 0xFF, 0xFF, 0xFF/*#AAFFFFFF*/));
m_ModalBackground.Width = BrowserScreenInformation.ScreenWidth;
m_ModalBackground.Height = BrowserScreenInformation.ScreenHeight;
parent.Children.Add(m_ModalBackground);
}
m_ModalBackground.Children.Add(this);
Interlocked.Increment(ref m_ModalBackgroundCount);
}
else
{ // Modeless
if (parent is Canvas)
parent.Children.Add(this);
else
{
m_ModelessBackground = new Canvas();
m_ModelessBackground.SetZIndex(m_BackgroundZIndex);
parent.Children.Add(m_ModelessBackground);
m_ModelessBackground.Children.Add(this);
}
}
SetupAnimation();
}
}