Exemple #1
0
 internal void UserElementFactory(object newValue)
 {
     m_itemTemplateWrapper = newValue as IElementFactoryShim;
     if (m_itemTemplateWrapper is null)
     {
         // ItemTemplate set does not implement IElementFactoryShim. We also want to support DataTemplate.
         if (newValue is DataTemplate dataTemplate)
         {
             m_itemTemplateWrapper = new ItemTemplateWrapper(dataTemplate);
         }
     }
 }
 public void UserElementFactory(object newValue)
 {
     m_itemTemplateWrapper = newValue as IElementFactoryShim;
     if (m_itemTemplateWrapper == null)
     {
         // ItemTemplate set does not implement IElementFactoryShim. We also
         // want to support DataTemplate and DataTemplateSelectors automagically.
         if (newValue is DataTemplate dataTemplate)
         {
             m_itemTemplateWrapper = new ItemTemplateWrapper(dataTemplate);
         }
         else if (newValue is DataTemplateSelector selector)
         {
             m_itemTemplateWrapper = new ItemTemplateWrapper(selector);
         }
     }
 }