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); }
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); }
protected virtual FrameworkElementProxy CreateItemContainerProxy(FrameworkElement itemContainer) { var itemContainerProxy = new FrameworkElementProxy(); return(itemContainerProxy); }