Example #1
0
        /// <summary>Prepares an item for display in the <see cref="T:System.Windows.Controls.Primitives.StatusBar" />.</summary>
        /// <param name="element">The item to display in the <see cref="T:System.Windows.Controls.Primitives.StatusBar" />.</param>
        /// <param name="item">The content of the item to display.</param>
        // Token: 0x0600601A RID: 24602 RVA: 0x001AF44C File Offset: 0x001AD64C
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            base.PrepareContainerForItemOverride(element, item);
            Separator separator = element as Separator;

            if (separator != null)
            {
                bool flag;
                BaseValueSourceInternal valueSource = separator.GetValueSource(FrameworkElement.StyleProperty, null, out flag);
                if (valueSource <= BaseValueSourceInternal.ImplicitReference)
                {
                    separator.SetResourceReference(FrameworkElement.StyleProperty, StatusBar.SeparatorStyleKey);
                }
                separator.DefaultStyleKey = StatusBar.SeparatorStyleKey;
            }
        }
Example #2
0
        /// <summary>
        /// Prepare the element to display the item.  This may involve
        /// applying styles, setting bindings, etc.
        /// </summary>
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            base.PrepareContainerForItemOverride(element, item);

            Separator separator = element as Separator;

            if (separator != null)
            {
                bool hasModifiers;
                BaseValueSourceInternal vs = separator.GetValueSource(StyleProperty, null, out hasModifiers);
                if (vs <= BaseValueSourceInternal.ImplicitReference)
                {
                    separator.SetResourceReference(StyleProperty, SeparatorStyleKey);
                }
                separator.DefaultStyleKey = SeparatorStyleKey;
            }
        }