当前位置: 首页>>代码示例>>C#>>正文


C# Popup.UpdateLayout方法代码示例

本文整理汇总了C#中System.Windows.Controls.Primitives.Popup.UpdateLayout方法的典型用法代码示例。如果您正苦于以下问题:C# Popup.UpdateLayout方法的具体用法?C# Popup.UpdateLayout怎么用?C# Popup.UpdateLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.Primitives.Popup的用法示例。


在下文中一共展示了Popup.UpdateLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeBusyIndicator

        partial void InitializeBusyIndicator()
        {
            if (_busyIndicator != null)
            {
                return;
            }

            _grid = new Grid();
            _grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
            _grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) });
            _grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) });
            _grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });

            var backgroundBorder = new Border();
            backgroundBorder.Background = new SolidColorBrush(Colors.Gray);
            backgroundBorder.Opacity = 0.5;
            backgroundBorder.SetValue(Grid.RowSpanProperty, 4);
            _grid.Children.Add(backgroundBorder);

            _statusTextBlock = new TextBlock();
            _statusTextBlock.Style = (Style)Application.Current.Resources["PhoneTextNormalStyle"];
            _statusTextBlock.HorizontalAlignment = HorizontalAlignment.Center;
            _statusTextBlock.SetValue(Grid.RowProperty, 1);
            _grid.Children.Add(_statusTextBlock);

            _busyIndicator = ConstructBusyIndicator();
            _busyIndicator.SetValue(Grid.RowProperty, 2);
            _grid.Children.Add(_busyIndicator);

            _containerPopup = new Popup();
            _containerPopup.VerticalAlignment = VerticalAlignment.Center;
            _containerPopup.HorizontalAlignment = HorizontalAlignment.Center;
            _containerPopup.Child = _grid;

            double rootWidth = Application.Current.Host.Content.ActualWidth;
            double rootHeight = Application.Current.Host.Content.ActualHeight;

            _busyIndicator.Width = rootWidth;

            _grid.Width = rootWidth;
            _grid.Height = rootHeight;

            _containerPopup.UpdateLayout();

            return;
        }
开发者ID:justdude,项目名称:DbExport,代码行数:46,代码来源:PleaseWaitService.wpsl.cs

示例2: GetImages

        private List<ExportFile> GetImages()
        {
            List<ExportFile> images = new List<ExportFile>();

              foreach(Symbol symbol in mUsedSymbols)
              {
            SymbolDisplay symDisplay = new SymbolDisplay();

            symDisplay.Symbol = symbol;
            symDisplay.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            symDisplay.VerticalAlignment = System.Windows.VerticalAlignment.Center;

            //Need to put panel in popup and open popup, so panel ends up in control visual tree.
            //Otherwise when bitmap is rendered, panel will not include any child controls.
            Popup popUp = new System.Windows.Controls.Primitives.Popup();
            popUp.Child = symDisplay;
            popUp.IsOpen = true;
            popUp.UpdateLayout();

            WriteableBitmap bmp = new WriteableBitmap(symDisplay, null);
            ImageTools.Image img = ImageTools.ImageExtensions.ToImage(bmp);

            MemoryStream stream = new MemoryStream();

            ImageTools.ImageExtensions.WriteToStream(img, stream);

            images.Add(new ExportFile()
            {
              Title = symbol.GetHashCode().ToString(),
              Path = string.Format("files/{0}.png", symbol.GetHashCode().ToString()),
              Data = stream.ToArray()
            });

            stream.Dispose();

            popUp.IsOpen = false;
              }

              return images;
        }
开发者ID:Zekiah,项目名称:GraphicLayerGoogleExport,代码行数:40,代码来源:GraphicsLayerExport.cs


注:本文中的System.Windows.Controls.Primitives.Popup.UpdateLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。