예제 #1
0
        /// <summary>
        /// This method adjusts the form's element tree according to the composition state
        /// of MS Windows. If Composition is enabled, the element tree is hidden and the glass
        /// effects of the form are visible.
        /// </summary>
        private void AdjustBehaviorForCompositionSate()
        {
            RibbonFormElement ribbonFormElement = this.FormElement as RibbonFormElement;

            if (this.CompositionEffectsEnabled && !this.Form.IsDesignMode && this.Form.TopLevel)
            {
                if (ribbonFormElement.Visibility != ElementVisibility.Collapsed)
                {
                    ribbonFormElement.Visibility = ElementVisibility.Collapsed;
                    this.PrepareRibbonBarForCompositionState();
                    this.Form.RootElement.Shape = null;
                    this.Form.Region            = null;
                }
            }
            else
            {
                if (ribbonFormElement.Visibility != ElementVisibility.Visible)
                {
                    ribbonFormElement.Visibility = ElementVisibility.Visible;
                    this.Form.Padding            = Padding.Empty;
                    this.PrepareRibbonBarForCompositionState();
                    this.Form.RootElement.ResetValue(RadItem.ShapeProperty, ValueResetFlags.Local);
                }
            }
        }
예제 #2
0
        public override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);
            this.formElement = new RibbonFormElement();

            parent.Children.Add(this.formElement);
        }