zoukankan      html  css  js  c++  java
  • StaticResource

    内部定义

    <phone:PhoneApplicationPage.Resources>
      <Style x:Key="color" TargetType="TextBlock">
        <Setter Property="FontSize" Value="20"></Setter>
      </Style>
      <Style x:Key="font" TargetType="TextBox">
        <Setter Property="Background" Value="Blue"></Setter>
      </Style>
      <BitmapImage UriSource="/Icons/20130601210710.jpg" x:Key="logo"></BitmapImage>
    </phone:PhoneApplicationPage.Resources>

    外部定义[app.xaml]

    <Application.Resources>
    <BitmapImage UriSource="/Icons/20130601210710.jpg" x:Key="logo1"></BitmapImage>
    <BitmapImage UriSource="/Icons/20130605085539.jpg" x:Key="logo2"></BitmapImage>
    <BitmapImage UriSource="/Icons/appbar.back.rest.png" x:Key="logo3"></BitmapImage>
    <BitmapImage UriSource="/Icons/appbar.cancel.rest.png" x:Key="logo4"></BitmapImage>
    <Style x:Key="aaa" TargetType="TextBox">
    <Setter Property="Height" Value="550"></Setter>

    </Style>
    </Application.Resources>

    调用

    <Image Height="150" HorizontalAlignment="Left" Margin="182,87,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="200" DataContext="{Binding}" Source="{StaticResource logo1}" />

    <Image Height="150" HorizontalAlignment="Left" Margin="182,287,0,0" Name="image2" Stretch="Fill" VerticalAlignment="Top" Width="200" DataContext="{Binding}" Source="{StaticResource logo2}" Grid.RowSpan="2" />
    <TextBlock Style="{StaticResource color}" Height="147" HorizontalAlignment="Left" Margin="10,10,0,0" Name="textBlock1" Text="TextBlock" VerticalAlignment="Top" Width="166" />
    <TextBox Style="{StaticResource aaa}" HorizontalAlignment="Left" Margin="6,113,0,0" Name="textBox1" Text="TextBox" VerticalAlignment="Top" Width="460" />

  • 相关阅读:
    操盘策略:判断强庄股的四个诀窍
    三类股有望继续走强
    操盘策略:股市空头陷阱五大招数
    每日一招:面对亏损我们应该如何操作(鳄鱼法则)
    (转)一个大户的自白:我是这样被两融打爆的
    3.2、迭代
    3.1、切片
    2.4、递归函数
    2.3、函数的参数
    2.2、定义函数
  • 原文地址:https://www.cnblogs.com/yuluhuang/p/3316854.html
Copyright © 2011-2022 走看看