Пример #1
0
        public FrameworkElementProxy GetItemContainerProxy(FrameworkElement container)
        {
            if (container == null)
            {
                return(null);
            }
            var proxy = FrameworkElementProxy.GetProxy(container);

            if (proxy == null)
            {
                proxy = CreateItemContainerProxy(container);
                FrameworkElementProxy.SetProxy(container, proxy);
            }
            return(proxy);
        }
Пример #2
0
        protected override object GetAdapter(Type adapterType)
        {
            var service = base.GetAdapter(adapterType);

            if (service == null)
            {
                if (ProxiedElement is DataGridRow)
                {
                    var row   = ProxiedElement as DataGridRow;
                    var owner = UIUtils.GetAncestor <DataGrid>(row);
                    if (owner != null)
                    {
                        var ownerProxy = (ImprovedItemsControlProxy)FrameworkElementProxy.GetProxy(owner);
                        if (ownerProxy != null)
                        {
                            return(ownerProxy.GetAdapter_(adapterType));
                        }
                    }
                }
            }
            return(null);
        }