예제 #1
0
        internal static void SetVisualStateGroups(FrameworkElement obj, VisualStateGroupCollection value)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }

            obj.SetValue(VisualStateManager.VisualStateGroupsProperty, value);
        }
예제 #2
0
        internal static VisualStateGroupCollection GetVisualStateGroupsInternal(FrameworkElement obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }

            VisualStateGroupCollection groups = obj.GetValue(VisualStateManager.VisualStateGroupsProperty) as VisualStateGroupCollection;

            if (groups == null)
            {
                groups = new VisualStateGroupCollection();
                SetVisualStateGroups(obj, groups);
            }

            return(groups);
        }