Represents the selection adapter contained in the drop-down portion of an T:System.Windows.Controls.AutoCompleteBox control.
Inheritance: ISelectionAdapter
コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }