Add regions in XAML

.NET WPF XAML

WPFIt is possible to add regions in XAML with Visual Studio allowing to fold/unfold parts of the code using the following tag :

<!--#region foldable code bloc -->

<controls:DCPHierarchicalNetworkDiagramControl
    x:Name="DCPHierarchicalNetworkDiagramControl"
    Grid.Column="2"/>

<TextBlock Text="datachecks computation" 
    Grid.Column="2"
    Margin="4"
    FontSize="8"
    HorizontalAlignment="Left"
    VerticalAlignment="Top"
/>

<!--#endregion-->

The Visual Studio XAML code editor then shows the symbol allowing to fold the part of the code :

region xaml

 
 
 
 
  
  
  
  

Leave a Reply