private DataGridItemPropertyRoute(DataGridItemPropertyBase itemProperty, DataGridItemPropertyRoute parent)
        {
            Debug.Assert(itemProperty != null);

            m_itemProperty = itemProperty;
            m_parent       = parent;
        }
        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));
        }
        internal static PropertyRoute ToPropertyRoute(DataGridItemPropertyRoute itemProperty)
        {
            if (itemProperty == null)
            {
                return(null);
            }

            return(PropertyRoute.Combine(PropertyRouteBuilder.ToSegment(itemProperty.Current), PropertyRouteBuilder.ToPropertyRoute(itemProperty.Parent)));
        }
        internal PropertyRouteBuilder(DataGridItemPropertyRoute route)
        {
            if (route == null)
            {
                return;
            }

            for (var c = route; c != null; c = c.Parent)
            {
                this.PushAncestor(c.Current);
            }
        }
        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)));
        }
        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);
        }
 internal static string Parse(DataGridItemPropertyBase itemProperty)
 {
     return(PropertyRouteParser.Parse(PropertyRouteBuilder.ToPropertyRoute(DataGridItemPropertyRoute.Create(itemProperty))));
 }