TextBlock.xaml
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:7k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. <Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
  2.     <Grid>
  3.         <Grid.RowDefinitions>
  4.             <RowDefinition Height="Auto"/>
  5.             <RowDefinition Height="*"/>
  6.     <RowDefinition Height="Auto"/>
  7.         </Grid.RowDefinitions>
  8.         <TextBlock Margin = "0, 15, 0, 25" HorizontalAlignment="Center" FontSize="30">&lt;TextBlock&gt; Tag</TextBlock>
  9.         <Grid Grid.Row="1" TextElement.FontSize="14">
  10.             <WrapPanel HorizontalAlignment="Center">
  11.                 <Border BorderBrush="Aqua" BorderThickness="1" Margin="8">
  12.                     <StackPanel Background="#f9f9f9">
  13.                         <Border Background="Aqua">
  14.                             <TextBlock FontWeight="Bold" Text=" Text Formatting:"/>
  15.                         </Border>
  16.                         <StackPanel Width = "215" Margin="4">
  17.                             <TextBlock >Text with <Bold>Bold</Bold> tag</TextBlock>
  18.                             <TextBlock >Text with <Italic>Italic</Italic> tag</TextBlock>
  19.                             <TextBlock >Text with <Underline>Underline</Underline> tag</TextBlock>
  20.                             <TextBlock >Text with <Run Foreground="Red">Run</Run> tag</TextBlock>
  21.                             <TextBlock >Text with <Hyperlink>Hyperlink</Hyperlink> tag</TextBlock>
  22.                         </StackPanel>
  23.                     </StackPanel>
  24.                 </Border>
  25.                 
  26.                 <Border BorderBrush="Aqua" BorderThickness="1" Margin="8">
  27.                     <StackPanel Background="#f9f9f9">
  28.                         <Border Background="Aqua">
  29.                             <TextBlock FontWeight="Bold" Text=" Text Trimming:"/>
  30.                         </Border>
  31.                         <Grid Width = "215" Margin="4">
  32.                             <Grid.RowDefinitions>
  33.                                 <RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/>
  34.                             </Grid.RowDefinitions>
  35.                             <Grid.ColumnDefinitions>
  36.                                 <ColumnDefinition Width="Auto"/><ColumnDefinition/>
  37.                             </Grid.ColumnDefinitions>
  38.                             
  39.                             <TextBlock Grid.Row="0" Grid.Column="0" Margin="0, 0, 4, 0">No Trimming:</TextBlock> 
  40.                             <TextBlock Grid.Row="0" Grid.Column="1" >String String String </TextBlock>
  41.                             
  42.                             <TextBlock Grid.Row="1" Grid.Column="0" Margin="0, 0, 4, 0">CharacterEllipsis:</TextBlock>
  43.                             <TextBlock Grid.Row="1" Grid.Column="1" TextTrimming="CharacterEllipsis">String String String</TextBlock>
  44.                             
  45.                             <TextBlock Grid.Row="2" Grid.Column="0" Margin="0, 0, 4, 0">WordEllipsis:</TextBlock>
  46.                             <TextBlock Grid.Row="2" Grid.Column="1" TextTrimming="WordEllipsis">String String String</TextBlock>
  47.                             
  48.                             <TextBlock Grid.Row="3" Grid.Column="0" Margin="0, 0, 4, 0">Wrap:</TextBlock>
  49.                             <TextBlock Grid.Row="3" Grid.Column="1" TextWrapping="Wrap">String String String</TextBlock>
  50.                         </Grid>
  51.                     </StackPanel>
  52.                 </Border>
  53.                 <Border BorderBrush="Aqua" BorderThickness="1" Margin="8">
  54.                     <StackPanel Background="#f9f9f9">
  55.                         <Border Background="Aqua">
  56.                             <TextBlock FontWeight="Bold" Text=" Text Alignment:"/>
  57.                         </Border>
  58.                         <Grid Width = "215" Margin="4">
  59.                             <Grid.RowDefinitions>
  60.                                 <RowDefinition/>
  61.                                 <RowDefinition/>
  62.                                 <RowDefinition/>
  63.                                 <RowDefinition/>
  64.                             </Grid.RowDefinitions>
  65.                             <Grid.ColumnDefinitions>
  66.                                 <ColumnDefinition Width="Auto"/>
  67.                                 <ColumnDefinition/>
  68.                             </Grid.ColumnDefinitions>
  69.                             <TextBlock Grid.Row="0" Grid.Column="0" Margin="0, 0, 4, 0">Left:</TextBlock>
  70.                             <TextBlock Grid.Row="0" Grid.Column="1" TextAlignment="Left">String String String </TextBlock>
  71.                             <TextBlock Grid.Row="1" Grid.Column="0" Margin="0, 0, 4, 0">Center:</TextBlock>
  72.                             <TextBlock Grid.Row="1" Grid.Column="1" TextAlignment="Center">String String String</TextBlock>
  73.                             <TextBlock Grid.Row="2" Grid.Column="0" Margin="0, 0, 4, 0">Right:</TextBlock>
  74.                             <TextBlock Grid.Row="2" Grid.Column="1" TextAlignment="Right">String String String</TextBlock>
  75.                         </Grid>
  76.                     </StackPanel>
  77.                 </Border>
  78. <Border BorderBrush="Aqua" BorderThickness="1" Margin="8">
  79.                     <StackPanel Background="#f9f9f9">
  80.                         <Border Background="Aqua">
  81.                             <TextBlock FontWeight="Bold" Text=" Text Baseline:"/>
  82.                         </Border>
  83.                         <Grid Width = "215" Margin="4">
  84.                             <StackPanel>
  85.                                 <TextBlock Margin = "1" Background="White">Top <Run BaselineAlignment="Top" FontSize="10">Baseline</Run> Text</TextBlock>
  86. <TextBlock Margin = "1" Background="White">Center <Run BaselineAlignment="Center" FontSize="10">Baseline</Run> Text</TextBlock>
  87.                                 <TextBlock Margin = "1" Background="White">Bottom <Run BaselineAlignment="Bottom" FontSize="10">Baseline</Run>Text</TextBlock>
  88.                                 <TextBlock Margin = "1" Background="White">Superscript <Run BaselineAlignment="Superscript" FontSize="10">Baseline</Run> Text</TextBlock>
  89.                             </StackPanel>
  90.                         </Grid>
  91.                     </StackPanel>
  92.                 </Border>
  93. <Border BorderBrush="Aqua" BorderThickness="1" Margin="8">
  94.                     <StackPanel Background="#f9f9f9">
  95.                         <Border Background="Aqua">
  96.                             <TextBlock FontWeight="Bold" Text=" Text Scrolling:"/>
  97.                         </Border>
  98.                         <ScrollViewer Width= "215" Height="85" Margin="4">                            
  99.                             <TextBlock TextWrapping="Wrap">
  100. <Run Foreground="Blue">Q:</Run> Does Codejock follow the new Microsoft Office 2007 UI licensing requirements?
  101. <LineBreak/>
  102. <Run Foreground="Green">A:</Run> Yes, Codejock Software is a Microsoft Office 2007 UI Licensing partner, and all of our Office 2007 components have been developed to meet Microsoft Office 2007 UI Design Guideline specifications.
  103.     </TextBlock>
  104.                         </ScrollViewer>
  105.                     </StackPanel>
  106.                 </Border>
  107.             </WrapPanel>
  108.         </Grid>
  109.         <Border Grid.Row="2" Background="#FF0342C6">
  110.             <TextBlock TextAlignment="Right" Foreground="#FFFFFFFF" Margin="8,3,8,3"><Run>(c)1998-2008 Codejock Software.</Run> <Underline Cursor="Hand">All Rights Reserved</Underline></TextBlock>
  111. </Border>
  112.     </Grid>
  113. </Page>