#region in XAML

前端 未结 8 1991
借酒劲吻你
借酒劲吻你 2020-12-24 11:16

I actually don\'t like #region in my code. BUT for some reason call me crazy, I would like to have them in my XAML. I would like whole sections to have a #region-li

8条回答
  •  难免孤独
    2020-12-24 12:08

    OP NOTE: this was the original right answer and in some ways still is a good and for some best answer including me. BUT this answers the original question best I think.

    Visual Studio 2015 finally adds support for regions in XAML. You enclose your regional code like this:

    
    
    All Your XAML In Here
    
    
    

    This will add a collapse icon to the left of starting line, using which you can expand/collapse the region.

    Don't know how handy this would practically be since we can already collapse/expand any node in XAML editor. It's there anyway if you want to use.

提交回复
热议问题