本文整理汇总了C#中Windows.UI.Xaml.Controls.Canvas.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Canvas.SetValue方法的具体用法?C# Canvas.SetValue怎么用?C# Canvas.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Controls.Canvas
的用法示例。
在下文中一共展示了Canvas.SetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show
public void Show()
{
_popup = new Popup
{
IsLightDismissEnabled = false
};
_popup.SetValue(Canvas.TopProperty, 0);
_popup.SetValue(Canvas.LeftProperty, 0);
_popup.Loaded += OnPopupLoaded;
_popup.Closed += OnPopupClosed;
Window.Current.Activated += OnWindowActivated;
_popup.ChildTransitions = new TransitionCollection
{
new PopupThemeTransition()
};
Height = PopupHeight;
Width = Window.Current.Bounds.Width;
Canvas layoutRoot = new Canvas();
layoutRoot.SetValue(WidthProperty, Window.Current.Bounds.Width);
layoutRoot.SetValue(HeightProperty, Window.Current.Bounds.Height);
layoutRoot.Background = _backgroundBrush;
layoutRoot.Children.Add(this);
SetValue(Canvas.TopProperty, (Window.Current.Bounds.Height - PopupHeight) / 2);
_popup.Child = layoutRoot;
_popup.IsOpen = true;
_viewModel = DataContext as ViewModelBase;
if (_viewModel != null)
{
_viewModel.OnNavigatedTo(new NavigationArgs(NavigationArgs.NavigationMode.New), ParametersKey);
}
}