title: c# wpf - cannot set both DisplayMemberPath and ItemTemplate
body: <p>I want to add tooltip in listboxItem but it starts problem when there is <code>DisplayMemberPath</code>. Error message said:</p>
  <blockquote>
  <p>cannot set both DisplayMemberPath and ItemTemplate.</p>
  </blockquote>
  <p>When I removed <code>DisplayMemberPath</code>, tooltip in each list item is working. But i dont want to remove <code>DisplayMememberPath</code> because I need it. How to solve this problem?</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;ListBox x:Name=&quot;lstToys&quot; Style=&quot;{DynamicResource ListBoxStyle1}&quot;
              ItemsSource=&quot;{Binding Strings}&quot; DisplayMemberPath=&quot;Toys&quot;
              MouseDoubleClick=&quot;lstToys_MouseDoubleClick&quot;&gt;
      &lt;ListBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;TextBlock Text=&quot;{Binding}&quot; ToolTip=&quot;Here is a tooltip&quot;/&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>