WPF-Blend How can I edit Item Template or Control Template in designer in Blend VS 2022

Ahmed Kelany 1 Reputation point
2022-02-08T08:10:34.773+00:00

Hello everyone,

I have a treeview:

<TreeView ItemTemplate="{DynamicResource AccountsTreeViewItemTemplate}" />  

and here is the template:

   <HierarchicalDataTemplate x:Key="AccountsTreeViewItemTemplate" ItemsSource="{Binding Children}" DataType="{x:Type local:AccountHierarchy}"  >  
        <Grid >  
            <Grid.ColumnDefinitions>  
                <ColumnDefinition Width="1*" />  
                <ColumnDefinition Width="1*" />  
                  
            </Grid.ColumnDefinitions>  
            <TextBlock Text="{Binding Name}" Grid.Column="1" />  
            <TextBlock Text="{Binding Id}"  />  
  
        </Grid>  
    </HierarchicalDataTemplate>  

The template works, but I need to edit it in the designer to edit the visual states, the problem is:

  1. Edit current template is disabled despite it is assigned to as displayed in code above

172060-image.png

  1. Can't find a way to edit the template visually in designer,

(I tried editing template of other controls e.g. button, but also couldn't find a way also)

I am using Blend for vs 2022, version 17.05

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,781 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
812 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.