学Silverlight 2系列(35):升级Silverlight 2 Beta 1应用程序到Beta 2
2008-10-09 11:39:45 来源:WEB开发网<ControlTemplate
xmlns='http://schemas.microsoft.com/client/2007'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<Border x:Name='ELEMENT_Content'"
BorderThickness='{TemplateBinding BorderThickness}'
BorderBrush='{TemplateBinding BorderBrush}'
Background='{TemplateBinding Background}'
Padding='{TemplateBinding Padding}'/>
</ControlTemplate>
Beta 2中TextBox控件模板
<ControlTemplate
xmlns='http://schemas.microsoft.com/client/2007'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<Grid x:Name='RootElement'>
<Grid.Resources>
<SolidColorBrush x:Key='Background' Color='#FF003255'/>
<SolidColorBrush x:Key='BorderBrush' Color='#FF000000'/>
<SolidColorBrush x:Key='AccentBrush' Color='#FFFFFFFF'/>
<LinearGradientBrush x:Key='FocusedStrokeBrush'
StartPoint='0.5,0' EndPoint='0.5,1'>
<GradientStop Color='#B2FFFFFF' Offset='0'/>
<GradientStop Color='#51FFFFFF' Offset='1'/>
<GradientStop Color='#66FFFFFF' Offset='0.325'/>
<GradientStop Color='#1EFFFFFF' Offset='0.325'/>
</LinearGradientBrush>
<Storyboard x:Key='Normal State'>
<DoubleAnimation Storyboard.TargetName='FocusVisualElement'
Storyboard.TargetProperty='Opacity' To='0' Duration='0:0:0.0'/>
</Storyboard>
<Storyboard x:Key='Focused State'>
<DoubleAnimation Storyboard.TargetName='FocusVisualElement'
Storyboard.TargetProperty='Opacity' To='1' Duration='0:0:0.0'/>
</Storyboard>
</Grid.Resources>
<Rectangle StrokeThickness='.5' RadiusX='2'
RadiusY='2' Fill='{TemplateBinding Background}'/>
<Rectangle StrokeThickness='.5' RadiusX='2' RadiusY='2'
Stroke='#FF003255'/>
<Border x:Name='ContentElement' Padding='{TemplateBinding Padding}'/>
<Grid x:Name='FocusVisualElement' Opacity='0' IsHitTestVisible='False'>
<Rectangle RadiusX='1' RadiusY='1' Margin='2'
Stroke='{StaticResource AccentBrush}' StrokeThickness='1'/>
<Rectangle RadiusX='1' RadiusY='1'
Stroke='{StaticResource Background}' StrokeThickness='2'/>
<Rectangle RadiusX='1' RadiusY='1'
Stroke='{StaticResource FocusedStrokeBrush}' StrokeThickness='2'/>
</Grid>
</Grid>
</ControlTemplate>
如果你在Beta 1中定义了TextBox的Style,需要进行一些修改,如ELEMENT_Content现在变为了ContentElement。
Tags:Silverlight 系列 升级
编辑录入:爽爽 [复制链接] [打 印]- ››silverlight全屏显示图片
- ››Silverlight MVVM 模式(一) 切近实战
- ››升级nginx到1.2.0
- ››升级openssh和openssl
- ››升级你的ISO到Ubuntu 11.10 正式版
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››升级 Ubuntu 10.04 内核到最新的 2.6.35 版
- ››Silverlight for Symbian
- ››升级到SQL Server 2005的12个必备提示
更多精彩
赞助商链接