Top "Datatemplate" questions

Data templating is a feature of WPF and Xamarin.

Stop TabControl from recreating its children

I have an IList of viewmodels which are bound to a TabControl. This IList will not change over the lifetime …

c# wpf mvvm datatemplate tabcontrol
Binding(Converter) in Code Behind

<local:LabelTemp x:Key="labelTemplate"/> <DataTemplate x:Key="labelTemp"> <TextBlock Text="{Binding Converter={StaticResource labelTemplate},…

c# wpf xaml datatemplate staticresource
Bind to ItemsControl's DataContext from inside an ItemTemplate

I have an ItemsControl whose for the ItemTemplate DataTemplate contains a Button. I want the Command on the button to …

wpf data-binding xaml datatemplate itemscontrol
Specify Command for MenuItem in a DataTemplate

I have a context menu. It's bound to some collection and it has a defined ItemTemplate like this: <ContextMenu …

wpf datatemplate command
How can I bind an ObservableCollection to TextBoxes in a DataTemplate?

I am trying to successfully TwoWay bind an ObservableCollection to TextBoxes in a DataTemplate. I can get the data to …

wpf binding datatemplate two-way-binding
Use a user control as a DataTemplate within a WPF application

I am trying to create a user control within a WPF application that will serve as a DataTemplate for a …

wpf user-controls wpf-controls datatemplate
DataTemplate for each DataType in a GridViewColumn CellTemplate

I have an ObservableCollection which contains view models of multiple types, and I would like to make a DataTemplate for …

wpf datatemplate gridviewcolumn celltemplate
How to disable a databound ListBox item based on a property value?

Does anyone know if and how one can disable items in a databound ListBox based on the value of a …

wpf xaml listbox datatemplate
How to define a DataTemplate in code?

How can I create a DataTemplate in code (using C#) and then add a control to that DataTemplate? <data:…

c# silverlight datagrid silverlight-3.0 datatemplate
binding to the ToString() method in a DataTemplate

Is there any easy way to bind to the ToString() method in a DataTemplate? I would expect the Text property …

c# wpf xaml datatemplate