WEB开发网
开发学院图形图像Flash 学Silverlight 2系列(35):升级Silverlight 2 B... 阅读

学Silverlight 2系列(35):升级Silverlight 2 Beta 1应用程序到Beta 2

 2008-10-09 11:39:45 来源:WEB开发网   
核心提示: <ControlTemplatexmlns='http://schemas.microsoft.com/client/2007'xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'><

<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。

上一页  1 2 3 4 5 6 7 8 9  下一页

Tags:Silverlight 系列 升级

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接