예제 #1
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/TrumpBubbles;component/MainPage.xaml", System.UriKind.Relative));
     this.x_LayoutRoot = ((ClassLibrary.StretchPanel)(this.FindName("x_LayoutRoot")));
     this.x_NavigationFrame = ((System.Windows.Controls.Frame)(this.FindName("x_NavigationFrame")));
     this.x_LinksPanel = ((System.Windows.Controls.StackPanel)(this.FindName("x_LinksPanel")));
 }
예제 #2
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/TrumpBubbles;component/Views/BubbleMaximized.xaml", System.UriKind.Relative));
     this.x_Header = ((ClassLibrary.StretchPanel)(this.FindName("x_Header")));
     this.x_Icon = ((System.Windows.Controls.Image)(this.FindName("x_Icon")));
     this.x_Title = ((System.Windows.Controls.TextBlock)(this.FindName("x_Title")));
     this.x_Debug = ((System.Windows.Controls.TextBlock)(this.FindName("x_Debug")));
     this.x_CloseText = ((System.Windows.Controls.TextBlock)(this.FindName("x_CloseText")));
     this.x_CloseImage = ((System.Windows.Controls.Image)(this.FindName("x_CloseImage")));
     this.x_HtmlPlaceholder = ((Telerik.Windows.Controls.RadHtmlPlaceholder)(this.FindName("x_HtmlPlaceholder")));
 }
예제 #3
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            base.Loaded -= OnLoaded;

            int index = 0;

            foreach (UIElement child in base.Children)
            {
                FrameworkElement element = child as FrameworkElement;
                GridLength       length  = StretchPanel.GetLength(element);

                if (Orientation == Orientation.Horizontal)
                {
                    ColumnDefinition definition = new ColumnDefinition()
                    {
                        Width = length
                    };
                    if (index == 0)
                    {
                        base.ColumnDefinitions.Clear();
                    }
                    base.ColumnDefinitions.Add(definition);
                    Grid.SetColumn(element, index++);
                    Grid.SetColumnSpan(element, 1);
                }
                else
                {
                    RowDefinition definition = new RowDefinition()
                    {
                        Height = length
                    };
                    if (index == 0)
                    {
                        base.RowDefinitions.Clear();
                    }
                    base.RowDefinitions.Add(definition);
                    Grid.SetRow(element, index++);
                    Grid.SetRowSpan(element, 1);
                }
            }

            base.Visibility = Visibility.Visible;
        }