title: Find DataTemplate key from a generic type
body: <p>I have the following code where I want to make it generic. So for example rather than doing NotificationView vw = new NotificationView(); in my code if the type passed in is of type NotificationView then I want to find a resource from that Type something like type.TryFindResource("")....
  Is there a way to do it. Please help.</p>
  
  <pre><code>public static DataTemplate getDataTemplate(Type type)
          {
  
              NotificationView vw = new NotificationView();
  
              var DataTemplate = vw.TryFindResource("CustomNotificationTemplate") as DataTemplate;
              return DataTemplate;
          }
  </code></pre>