Content Index Search
 

Customize the SimpleTabItem using a bitmap effect

Using the SimpleTabItem template makes it easy to customize the appearance of a tab control.

To add a bitmap effect to the SimpleTabItem

  1. Draw a SimpleTabControl on the artboard. The SimpleTabControl includes two SimpleTabItems by default.
    Tip The simple style controls are available from the Simple Styles category of the Controls tab in the Asset Library Asset Library button. After you select a simple style control from the list, you can draw it on the artboard.
  2. Right-click one of the tab items under Objects and Timeline, point to Edit Control Parts (Template), and then click Edit Template. If you do not want to change the SimpleStyles.xaml resource dictionary, you can click Edit a Copy instead of Edit Template, to create a new template and save it in the document. For more information about creating a copy, see Create a resource.
    Tip To exit the template-editing mode and return to the scope of your document: click the Scope up button Scope up button, which is above the element tree in the Interaction panel.

    To return to template editing mode for an existing template: under Objects and Timeline, right-click the element whose template you want to edit, point to Edit Control Parts (Template), and then click Edit Template.
  3. In the editing scope of the control template, select the Border element under Objects and Timeline, and then in the advanced section Scope up button of the Appearance category of the Properties panel, click the dropdown arrow beside the BitmapEffect property, and click Bevel. By default, the BevelWidth property is 5.
  4. In the Triggers panel, select the IsPressed state to turn on recording for the trigger. In the Properties panel, click the dropdown arrow next to the BitmapEffect property again, click Bevel, and then change the BevelWidth property to 25.
    A new line appears under Properties when active under Triggers, reflecting the property change that will occur when the mouse moves clicks the tab item.
  5. Click the Scope Up button Scope up button to return to the editing scope of your document.
  6. To apply the custom template to the other tab item in your tab control, right-click the other tab item under Objects and Timeline, point to Edit Control Parts (Template), point to Apply Resource, and then click the name of your custom template.
  7. Test your application (F5) to see the effects.