Top "Datatemplate" questions

Data templating is a feature of WPF and Xamarin.

Selecting a data template based on type

I've declared the following types: public interface ITest { } public class ClassOne : ITest { } public class ClassTwo : ITest { } In my viewmodel I'm …

c# wpf xaml mvvm datatemplate
StaticResource reference inside DataTemplate

I've been experiencing some strange behaviour when referencing StaticResources from inside a DataTemplate defined in a ResourceDictionary. In this example, …

wpf xaml datatemplate staticresource
How to preserve the full state of the View when navigating between Views in an MVVM application?

I have an MVVM application that requires basic backward/forward navigation between screens. Currently, I have implemented this using a …

wpf mvvm navigation datatemplate
Problems with XamlReader generating DataTemplate

I'm trying to implement the code below in my WPF project in order to generate DataTemplates on the fly for …

wpf silverlight xaml datatemplate xamlreader
DataGrid: dynamic DataTemplate for dynamic DataGridTemplateColumn

I want to show data in a datagrid where the data is a collection of public class Thing { public string …

wpf silverlight datagrid datatemplate datagridtemplatecolumn
Dynamically added DataTemplate - StaticResource for Converter can't be found

I'm using the following code to dynamically add columns to my GridView: public void AddGridViewColumns() { GridView view = (GridView)_myListView.View; …

wpf xaml dynamic datatemplate
WPF Toggle visibility of UIElements in DataTemplate

I have a DataTemplate defined as follows <DataTemplate x:Key="PasswordViewerTemplate"> <StackPanel> <TextBlock Text="{Binding …

c# wpf xaml datatemplate uielement
WPF Listbox with usercontrol as ItemTemplate DataTemplate Binding Issue

I have created a simple MVVM wpf project. The basic Idea is to display data about the annual Income of …

wpf binding listbox datatemplate itemtemplate
Scroll a new item in a ItemsControl into view

I have an ItemsControl that is databound to a ObservableCollection. I have this method in the code behind which adds …

wpf data-binding datatemplate itemscontrol