protected virtual ISelectionAdapter GetSelectionAdapterPart() { ISelectionAdapter adapter = null; Selector selector = GetTemplateChild(ElementSelector) as Selector; if (selector != null) { // Check if it is already an IItemsSelector adapter = selector as ISelectionAdapter; if (adapter == null) { // Built in support for wrapping a Selector control adapter = new SelectorSelectionAdapter(selector); } } if (adapter == null) { adapter = GetTemplateChild(ElementSelectionAdapter) as ISelectionAdapter; } return adapter; }
protected virtual ISelectionAdapter GetSelectionAdapterPart() { ISelectionAdapter adapter = null; Selector selector = GetTemplateChild(ElementSelector) as Selector; if(selector != null) { // Check if it is already an IItemsSelector // ReSharper disable once SuspiciousTypeConversion.Global adapter = selector as ISelectionAdapter; if(adapter == null) { // Built in support for wrapping a Selector control adapter = new SelectorSelectionAdapter(selector); } } if(adapter == null) { // ReSharper disable once SuspiciousTypeConversion.Global adapter = GetTemplateChild(ElementSelectionAdapter) as ISelectionAdapter; } return adapter; }