Наследование: FrameworkTemplate, IItemsPanelTemplate
Пример #1
0
 private void OnItemsPanelChanged(ItemsPanelTemplate oldItemsPanel, ItemsPanelTemplate newItemsPanel)
 {
     if (_isReady)             // Panel is created on ApplyTemplate, so do not create it twice (first on set PanelTemplate, second on ApplyTemplate)
     {
         UpdateItemsPanelRoot();
     }
 }
Пример #2
0
        public CommandBarOverflowPresenter()
        {
            m_useFullWidth = false;
            m_shouldOpenUp = false;
#if XAMARIN
            ItemsPanel = new ItemsPanelTemplate(() => new StackPanel());
#endif
        }
 private void SetBaseItemsPanel(ItemsPanelTemplate value)
 {
     base.ItemsPanel = value;
 }
        // Methods and handlers
        private void RotatingGridview_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            // We save the landscape styles as these properties will be changed later
            if (this.landscapeItemTemplate == null)
            {
                this.landscapeItemTemplate = this.ItemTemplate;
            }

            if (this.landscapeItemsPanel == null)
            {
                this.landscapeItemsPanel = this.ItemsPanel;
            }

            if (this.landscapeGroupStyle == null)
            {
                this.landscapeGroupStyle = new List<GroupStyle>();
                foreach (GroupStyle style in this.GroupStyle)
                {
                    this.landscapeGroupStyle.Add(style);
                }
            }

            // We search for the corresponding layout and update it if it changed
            if (this.MinimalLayoutWidth > Window.Current.Bounds.Width)
            {
                if (this.previousState != AutoRotateGridViewLayouts.Minimal)
                {
                    this.previousState = AutoRotateGridViewLayouts.Minimal;
                    UpdateLayout(AutoRotateGridViewLayouts.Minimal);
                }
            }
            else if (Window.Current.Bounds.Height > Window.Current.Bounds.Width)
            {
                if (this.previousState != AutoRotateGridViewLayouts.Portrait)
                {
                    this.previousState = AutoRotateGridViewLayouts.Portrait;
                    UpdateLayout(AutoRotateGridViewLayouts.Portrait);
                }
            }
            else
            {
                if (this.previousState != AutoRotateGridViewLayouts.Landscape)
                {
                    this.previousState = AutoRotateGridViewLayouts.Landscape;
                    UpdateLayout(AutoRotateGridViewLayouts.Landscape);
                }
            }
        }