예제 #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);
        }
예제 #3
0
        protected virtual FrameworkElementProxy CreateItemContainerProxy(FrameworkElement itemContainer)
        {
            var itemContainerProxy = new FrameworkElementProxy();

            return(itemContainerProxy);
        }