How do you replace an entire xaml element?
- by luke
<ListView>
<ListView.Resources>
<DataTempalte x:Key="label">
<TextBlock Text="{Binding Label}"/>
</DataTEmplate>
<DataTemplate x:Key="editor">
<UserControl Content="{Binding Control.content}"/> <!-- This is the line -->
</DataTemplate>
</ListView.Resources>
<ListView.View>
<GridView>
<GridViewColumn Header="Name" CellTemplate="{StaticResource label}"/>
<GridViewColumn Header="Value" CellTemplate="{StaticResource editor}"/>
</GridView>
</ListView.View>
On the marketed line, I'm replacing the contents of a UserControl with the contents of another UserControl that is dynamically created in code. I'd like to replace the entire control, and not just the content. Is there a way to do this?