Пример #1
0
        public PivotPanel()
        {
            NotifiableChildren = new NotifiableUIElementCollection(this, this);

            // Create the root grid that will hold the header panel and the contents
            _rootGrid = new Grid();

            RowDefinition rd = new RowDefinition
            {
                Height = HeaderHeight
            };

            _rootGrid.RowDefinitions.Add(rd);

            rd = new RowDefinition
            {
                Height = new GridLength(1, GridUnitType.Star)
            };
            _rootGrid.RowDefinitions.Add(rd);

            Binding backgroundBinding = new Binding
            {
                Source = Background
            };

            _rootGrid.SetBinding(BackgroundProperty, backgroundBinding);

            _rootGrid.Width  = ActualWidth;
            _rootGrid.Height = ActualHeight;

            _rootGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
            _rootGrid.VerticalAlignment   = VerticalAlignment.Stretch;

            // Create the header panel
            _headerPanel = new PivotHeaderPanel
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch
            };

            _headerPanel.HeaderSelected += OnHeaderSelected;
            _rootGrid.Children.Add(_headerPanel);

            Children.Add(_rootGrid);

            _pivotItems = new List <PivotItem>();

            SizeChanged += (s, e) =>
            {
                if (_rootGrid != null)
                {
                    _rootGrid.Width  = ActualWidth;
                    _rootGrid.Height = ActualHeight;
                }
            };
        }
Пример #2
0
        public PivotPanel()
        {
            notifiableChildren = new NotifiableUIElementCollection(this, this);

            // Create the root grid that will hold the header panel and the contents
            rootGrid = new Grid();

            RowDefinition rd = new RowDefinition();

            rd.Height = HeaderHeight;
            rootGrid.RowDefinitions.Add(rd);

            rd        = new RowDefinition();
            rd.Height = new GridLength(1, GridUnitType.Star);
            rootGrid.RowDefinitions.Add(rd);

            Binding backgroundBinding = new Binding();

            backgroundBinding.Source = this.Background;
            rootGrid.SetBinding(Grid.BackgroundProperty, backgroundBinding);

            rootGrid.Width  = this.ActualWidth;
            rootGrid.Height = this.ActualHeight;

            rootGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
            rootGrid.VerticalAlignment   = VerticalAlignment.Stretch;

            // Create the header panel
            headerPanel = new PivotHeaderPanel();
            headerPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
            headerPanel.VerticalAlignment   = VerticalAlignment.Stretch;
            headerPanel.HeaderSelected     += new EventHandler(OnHeaderSelected);
            rootGrid.Children.Add(headerPanel);

            this.Children.Add(rootGrid);

            pivotItems = new List <PivotItem>();

            this.SizeChanged += (s, e) =>
            {
                if (rootGrid != null)
                {
                    rootGrid.Width  = this.ActualWidth;
                    rootGrid.Height = this.ActualHeight;
                }
            };
        }
Пример #3
0
        public PivotPanel()
        {
            notifiableChildren = new NotifiableUIElementCollection(this, this);

            // Create the root grid that will hold the header panel and the contents
            rootGrid = new Grid();

            RowDefinition rd = new RowDefinition();
            rd.Height = HeaderHeight;
            rootGrid.RowDefinitions.Add(rd);

            rd = new RowDefinition();
            rd.Height = new GridLength(1, GridUnitType.Star);
            rootGrid.RowDefinitions.Add(rd);

            Binding backgroundBinding = new Binding();
            backgroundBinding.Source = this.Background;
            rootGrid.SetBinding(Grid.BackgroundProperty, backgroundBinding);

            rootGrid.Width = this.ActualWidth;
            rootGrid.Height = this.ActualHeight;

            rootGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
            rootGrid.VerticalAlignment = VerticalAlignment.Stretch;

            // Create the header panel
            headerPanel = new PivotHeaderPanel();
            headerPanel.HorizontalAlignment = HorizontalAlignment.Stretch;
            headerPanel.VerticalAlignment = VerticalAlignment.Stretch;
            headerPanel.HeaderSelected += new EventHandler(OnHeaderSelected);
            rootGrid.Children.Add(headerPanel);

            this.Children.Add(rootGrid);

            pivotItems = new List<PivotItem>();

            this.SizeChanged += (s, e) =>
                {
                    if (rootGrid != null)
                    {
                        rootGrid.Width = this.ActualWidth;
                        rootGrid.Height = this.ActualHeight;
                    }
                };
        }
Пример #4
0
        public PivotPanel()
        {
            NotifiableChildren = new NotifiableUIElementCollection(this, this);

            // Create the root grid that will hold the header panel and the contents
            _rootGrid = new Grid();

            RowDefinition rd = new RowDefinition
            {
                Height = HeaderHeight
            };
            _rootGrid.RowDefinitions.Add(rd);

            rd = new RowDefinition
            {
                Height = new GridLength(1, GridUnitType.Star)
            };
            _rootGrid.RowDefinitions.Add(rd);

            Binding backgroundBinding = new Binding
            {
                Source = Background
            };
            _rootGrid.SetBinding(BackgroundProperty, backgroundBinding);

            _rootGrid.Width = ActualWidth;
            _rootGrid.Height = ActualHeight;

            _rootGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
            _rootGrid.VerticalAlignment = VerticalAlignment.Stretch;

            // Create the header panel
            _headerPanel = new PivotHeaderPanel
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch
            };

            _headerPanel.HeaderSelected += OnHeaderSelected;
            _rootGrid.Children.Add(_headerPanel);

            Children.Add(_rootGrid);

            _pivotItems = new List<PivotItem>();

            SizeChanged += (s, e) =>
                {
                    if (_rootGrid != null)
                    {
                        _rootGrid.Width = ActualWidth;
                        _rootGrid.Height = ActualHeight;
                    }
                };
        }