Top "Datatemplate" questions

Data templating is a feature of WPF and Xamarin.

How can I bind an ObservableCollection of ViewModels to a MenuItem?

When I bind Menu Items with an ObservableCollection, only the "inner" area of the MenuItem is clickable: alt text http://…

wpf xaml mvvm datatemplate menuitem
WPF TabControl and DataTemplates

I've got a set of ViewModels that I'm binding to the ItemsSource property of a TabControl. Let's call those ViewModels …

wpf tabcontrol datatemplate
how to add event handler to control in datatemplate in resource dictionary

I have a resource dictionary: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.…

wpf event-handling datatemplate resourcedictionary
Inline editing TextBlock in a ListBox with Data Template (WPF)

Using WPF, I have a ListBox control with a DataTemplate inside it. The relevant XAML code is shown below: <…

c# wpf xaml listbox datatemplate
WPF listbox empty datatemplate

I was wondering how people handle a ListBox control that has no items? e.g. I want to bind a …

.net wpf listbox datatemplate
WPF ListBoxItems with DataTemplates - How do I reference the CLR Object bound to ListBoxItem from within the DataTemplate?

I have a ListBox, that's bound to an ObservableCollection. Each ListBoxItem is displayed with a DataTemplate. I have a button …

wpf listbox datatemplate listboxitem
How do I dynamically bind and statically add MenuItems?

I'm binding the ItemsSource of my MenuItem to an ObservableCollection in my ViewModel. Here is my xaml: <MenuItem Header="_…

wpf xaml styles datatemplate menuitem
In WPF can you base one DataTemplate on another like you can with a Style?

Possible Duplicate: Datatemplate inheritance I have several data types that are not subclasses, nor do they share an interface, but …

wpf inheritance datatemplate basedon
ContentPresenter DataTemplate

I have a DataTemplate: <DataTemplate x:Key="myTemplate"> ... </DataTemplate> I want to use it as the …

wpf xaml datatemplate contentpresenter
How to Automatically Use a DataTemplate Based on ContentControl's Current Content's DataType

When I attempt to specify multiple DataTemplates for use by a ContentControl so that the correct one (based on Type) …

wpf xaml datatemplate