Beispiel #1
0
        // Token: 0x06000CF7 RID: 3319 RVA: 0x00030004 File Offset: 0x0002E204
        internal static Collection <VisualStateGroup> GetVisualStateGroupsInternal(FrameworkElement obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            bool flag;
            BaseValueSourceInternal valueSource = obj.GetValueSource(VisualStateManager.VisualStateGroupsProperty, null, out flag);

            if (valueSource != BaseValueSourceInternal.Default)
            {
                return(obj.GetValue(VisualStateManager.VisualStateGroupsProperty) as Collection <VisualStateGroup>);
            }
            return(null);
        }
        internal static Collection <VisualStateGroup> GetVisualStateGroupsInternal(FrameworkElement obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }

            // We don't want to get the default value because it will create/return an empty colleciton.
            bool hasModifiers;
            BaseValueSourceInternal source = obj.GetValueSource(VisualStateGroupsProperty, null, out hasModifiers);

            if (source != BaseValueSourceInternal.Default)
            {
                return(obj.GetValue(VisualStateManager.VisualStateGroupsProperty) as Collection <VisualStateGroup>);
            }

            return(null);
        }
Beispiel #3
0
        // Returns true when the coerce callback should return the current system metric
        private static bool ShouldUseSystemFont(FrameworkElement fe, DependencyProperty dp)
        { 
            bool hasModifiers;
 
            // Return the current system font when (changing the system theme OR creating an element and the default is outdated) 
            // AND the element is a root AND the element has not had a value set on it by the user
            return  (SystemResources.SystemResourcesAreChanging || (fe.ReadInternalFlag(InternalFlags.CreatingRoot) && SystemResources.SystemResourcesHaveChanged)) && 
                     fe._parent == null && VisualTreeHelper.GetParent(fe) == null &&
                     fe.GetValueSource(dp, null, out hasModifiers) == BaseValueSourceInternal.Default;
        }
 private static bool ShouldUseSystemFont(FrameworkElement fe, DependencyProperty dp)
 {
     if ((SystemResources.SystemResourcesAreChanging || fe.ReadInternalFlag(InternalFlags.CreatingRoot) && SystemResources.SystemResourcesHaveChanged) && (fe._parent == null && VisualTreeHelper.GetParent((DependencyObject) fe) == null))
       {
     bool hasModifiers;
     return fe.GetValueSource(dp, (PropertyMetadata) null, out hasModifiers) == BaseValueSourceInternal.Default;
       }
       else
     return false;
 }