Download presentation
Presentation is loading. Please wait.
5
Scenario Fixed look with some logic Split large page into smaller chunks Reuse xaml/logic in multiple places Platform Support … … public partial class MyControl : UserControl {} XAML is optional
6
Update from 1.1 Alpha Replaces Control.InitializeFromXaml(“…”) A Silverlight “page” is a UserControl Visual elements DatabindingTabbing Mouse & keyboard events … and so on
8
Complete keyboard accessibility Full tab navigation support Full focus support Can implement own directional navigation Screen reader support coming in Beta2 Based on UIAutomation Mark Rideout’s video: Some additional work for full 508 compliance High Contrast
10
Scenario Tweek minor visual characteristics Platform Support Manually setting visual properties on control <Style>
12
Resources A shared XAML asset that can be referenced by multiple elements in your application. <Style> A set of properties that can be applied to controls, text, shapes, … Silverlight 2 “Write once” behavior Application theme styles not supported BasedOn styles not supported
13
Scenario Completely replace control’s visuals Platform Support <ControlTemplate>
15
<ControlTemplate> A set of elements that make up the visual structure of a control. {TemplateBinding} A link between the template visuals and the control’s visual properties
17
Scenario Piece of custom logic Designers can customize look Platform Support Derive from Control class Supply built-in style
19
Control subclass generic.xaml Assembly resource in controls dll Defines “built in” styles for control
20
I’ve got your RootElement, Pressed State, etc.. I wonder what I need to put in my template… I need a RootElement, Pressed State, etc..
21
Goals How to structure your control Defined separation between logic & visuals Explicit control contract Recommended pattern Not enforced by runtime Will be supported by Blend
22
Element Parts Named element in template Type: FrameworkElement, Panel, Button, etc.. Control logic will control element in some way DownButtonUpButtonThumb Track
23
States Parts Keyed resource inside template’s root element Type: Storyboard Control logic begins & stops storyboard Mouse Over Transition Initiator Pressed STATE part Code starts/stops animation.
24
RootElementFocusVisualElementNormalStateMouseOverStatePressedState
27
UserControls Custom Controls Styles & Templates Parts Model
28
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.