示例#1
0
        internal override void PrepareUI()
        {
            if (this.Owner == null || !this.IsTemplateApplied)
            {
                return;
            }

            this.Container.Owner = this.Owner.Owner;

            for (int i = 0; i < this.Owner.Owner.GroupDescriptors.Count; i++)
            {
                GroupDescriptorBase descriptor = this.Owner.Owner.GroupDescriptors[i];

                DataGridFlyoutGroupHeader header = new DataGridFlyoutGroupHeader();

                this.SetupDragDropProperties(header, i);

                header.DataContext           = descriptor;
                header.CloseButtonClick     += this.Owner.HandleGroupFlyoutHeaderClosed;
                header.DragSurfaceRequested += this.HandleDragSurfaceRequested;
                header.DescriptorContentTap += this.Owner.HandleGroupFlyoutDescriptorContentTap;
                header.ParentGrid            = this.Owner.Owner;

                this.Container.Elements.Add(header);
            }

            int childCount = this.Container.Elements.Count;

            if (childCount > 0)
            {
                var lastHeader = this.Container.Elements[childCount - 1] as DataGridFlyoutGroupHeader;
                lastHeader.BottomGlyphOpacity = 0.0;
            }
        }
        /// <summary>
        /// Creates an instance of the <see cref="DataGridFlyoutGroupHeader"/>.
        /// </summary>
        protected virtual DataGridFlyoutHeader CreateHeader()
        {
            DataGridFlyoutGroupHeader header = new DataGridFlyoutGroupHeader();

            header.Width = this.ActualWidth;
            header.BottomGlyphOpacity    = 0.0;
            header.OuterBorderVisibility = Visibility.Visible;
            return(header);
        }