コード例 #1
0
        private DataGridItemPropertyRoute(DataGridItemPropertyBase itemProperty, DataGridItemPropertyRoute parent)
        {
            Debug.Assert(itemProperty != null);

            m_itemProperty = itemProperty;
            m_parent       = parent;
        }
コード例 #2
0
        internal static DataGridItemPropertyRoute Combine(DataGridItemPropertyBase itemProperty, DataGridItemPropertyRoute ancestors)
        {
            if (itemProperty == null)
            {
                return(ancestors);
            }

            if (ancestors == null)
            {
                return(DataGridItemPropertyRoute.Create(itemProperty));
            }

            var collection = itemProperty.ContainingCollection;

            if (collection == null)
            {
                throw new InvalidOperationException();
            }

            if (collection.Owner != ancestors.Current)
            {
                throw new InvalidOperationException();
            }

            return(new DataGridItemPropertyRoute(itemProperty, ancestors));
        }
コード例 #3
0
        internal static PropertyRoute ToPropertyRoute(DataGridItemPropertyRoute itemProperty)
        {
            if (itemProperty == null)
            {
                return(null);
            }

            return(PropertyRoute.Combine(PropertyRouteBuilder.ToSegment(itemProperty.Current), PropertyRouteBuilder.ToPropertyRoute(itemProperty.Parent)));
        }
コード例 #4
0
        internal PropertyRouteBuilder(DataGridItemPropertyRoute route)
        {
            if (route == null)
            {
                return;
            }

            for (var c = route; c != null; c = c.Parent)
            {
                this.PushAncestor(c.Current);
            }
        }
コード例 #5
0
        internal static DataGridItemPropertyRoute Create(DataGridItemPropertyBase itemProperty)
        {
            if (itemProperty == null)
            {
                return(null);
            }

            var collection = itemProperty.ContainingCollection;

            if (collection == null)
            {
                return(new DataGridItemPropertyRoute(itemProperty));
            }

            return(new DataGridItemPropertyRoute(
                       itemProperty,
                       DataGridItemPropertyRoute.Create(collection.Owner)));
        }
コード例 #6
0
        protected virtual bool OnReceiveWeakEvent(Type managerType, object sender, EventArgs e)
        {
            if ((managerType == null) || (sender == null) || (e == null))
            {
                return(false);
            }

            if (managerType == typeof(CollectionChangedEventManager))
            {
                var eventArgs = ( NotifyCollectionChangedEventArgs )e;

                if (m_itemProperties == sender)
                {
                    this.OnItemPropertiesCollectionChanged(sender, eventArgs);
                }
                else if (m_detailDescriptions == sender)
                {
                }
            }
            else if (managerType == typeof(InitializeItemPropertyEventManager))
            {
                var eventArgs = ( InitializeItemPropertyEventArgs )e;

                if (m_itemProperties == sender)
                {
                    var itemProperty      = eventArgs.ItemProperty;
                    var itemPropertyRoute = DataGridItemPropertyRoute.Create(itemProperty);

                    ItemsSourceHelper.SetPropertyDescriptionsFromItemProperty(m_defaultPropertyDescriptions, null, null, m_itemType, itemPropertyRoute);
                    ItemsSourceHelper.InitializePropertyDescriptions(m_defaultPropertyDescriptions, itemPropertyRoute, m_itemType, this.DefaultPropertyDescriptionsCreated);
                }
            }
            else
            {
                return(false);
            }

            return(true);
        }
コード例 #7
0
 internal static string Parse(DataGridItemPropertyBase itemProperty)
 {
     return(PropertyRouteParser.Parse(PropertyRouteBuilder.ToPropertyRoute(DataGridItemPropertyRoute.Create(itemProperty))));
 }