How to Extract Default Control Template In Visual Studio?

前端 未结 6 474
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 09:07

I\'m wondering how I can extract (get a copy) of the Default Template of a given control using Visual Studio. I know this can be done with Expression Blend (right click a co

6条回答
  •  逝去的感伤
    2020-11-22 10:11

    2015 update with clear instructions

    In Visual Studio 2013, you can get the default ControlTemplate of a control in a few simple steps.

    1. In the WPF designer, select the relevant control, or place the mouse cursor on the relevant control in the XAML.

    2. Press F4 to open the Properties Window.

    3. Open the Miscellaneous category to find the Template property, or type Template in the search field at the top of the Window.

    4. Click on the little square to the right of the Template field and select the Convert to New Resource... option:

    enter image description here

    1. In the popup dialog, name the new ControlTemplate to be added and decide where you want it to be defined:

    enter image description here

    1. Click on the OK button.

提交回复
热议问题