My Snippets

Silverlight XAML Samples

XML:
  1. <UserControl x:Class="System.Windows.Controls.UserControl"
  2.     xmlns="http://schemas.microsoft.com/client/2007"
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  4.  
  5.   <Grid x:Name="layout_root" Background="White">
  6.     <Canvas
  7.        xmlns="http://schemas.microsoft.com/client/2007"
  8.        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  9.        Background="LightYellow">
  10.        
  11.   <Ellipse
  12.       Canvas.ZIndex="5"
  13.       Canvas.Left="0" Canvas.Top="50"
  14.       Height="200" Width="200"
  15.       Stroke="Black" StrokeThickness="10" Fill="DeepSkyBlue" />
  16.      
  17.   <Ellipse
  18.       Canvas.ZIndex="8"
  19.       Canvas.Left="200" Canvas.Top="50"
  20.       Height="200" Width="200"
  21.       Stroke="Black" StrokeThickness="10" Fill="Red" />     
  22.      
  23.   <Ellipse
  24.       Canvas.ZIndex="9"
  25.       Canvas.Left="100" Canvas.Top="50"
  26.       Height="200" Width="200"
  27.       Stroke="Black" StrokeThickness="10" Fill="Lime" />   
  28.  
  29.   <Path Data="M 10,100 C 10,300 300,-200 250,100z"
  30.       Stroke="Red" Fill="Green"
  31.       Canvas.Left="10" Canvas.Top="300" />
  32.      
  33.   <Path Data="M 0,200 L100,200 50,50z"
  34.       Stroke="Black" Fill="Gray"
  35.       Canvas.Left="250" Canvas.Top="400" />
  36.      
  37.   <Rectangle Width="400" Height="200" Canvas.Left="350" Canvas.Top="400">
  38.     <Rectangle.Fill>
  39.       <RadialGradientBrush GradientOrigin="0,0">
  40.         <GradientStop Color="Yellow"    Offset="0.0" />
  41.         <GradientStop Color="Orange"    Offset="0.1" />
  42.         <GradientStop Color="Pink"   Offset="0.2" />
  43.         <GradientStop Color="Red"     Offset="0.3" />
  44.         <GradientStop Color="Purple"    Offset="0.35" />
  45.         <GradientStop Color="Blue"   Offset="0.45" />
  46.         <GradientStop Color="LimeGreen" Offset="0.5" />
  47.         <GradientStop Color="Blue"   Offset="0.6" />
  48.         <GradientStop Color="Purple"    Offset="0.65" />
  49.         <GradientStop Color="Red"     Offset="0.70" />
  50.         <GradientStop Color="Pink"   Offset="0.80" />
  51.         <GradientStop Color="Orange"    Offset="0.90" />
  52.         <GradientStop Color="Yellow"    Offset="1.00" />
  53.       </RadialGradientBrush>
  54.     </Rectangle.Fill>
  55.   </Rectangle>
  56.        
  57.     <TextBlock x:Name="message" FontSize="30">
  58.       <TextBlock.Foreground>
  59.         <LinearGradientBrush>
  60.           <GradientStop Color="SlateBlue" Offset="0.0" />
  61.           <GradientStop Color="Red" Offset="1.0" />
  62.         </LinearGradientBrush>
  63.       </TextBlock.Foreground>
  64.     </TextBlock>
  65.  
  66.  
  67.     <TextBlock Canvas.Top="600"
  68.                 Canvas.Left="100" x:Name="michel"
  69.                 Text="Salut Sammy et Michel!!! J'aime le chocolat et le caramel!"
  70.                 FontSize="40">
  71.       <TextBlock.Foreground>
  72.         <LinearGradientBrush>
  73.           <GradientStop Color="Yellow" Offset="0.0" />
  74.           <GradientStop Color="Orange" Offset="0.2" />
  75.           <GradientStop Color="Red" Offset="0.4" />
  76.           <GradientStop Color="Purple" Offset="0.6" />
  77.           <GradientStop Color="Blue" Offset="0.8" />
  78.           <GradientStop Color="Green" Offset="1.0" />
  79.         </LinearGradientBrush>
  80.       </TextBlock.Foreground>
  81.     </TextBlock>
  82.    
  83.    
  84.     </Canvas>
  85.  
  86.   </Grid>
  87.  
  88. </UserControl>

June 12th, 2008 Posted by | silverlight, xaml | no comments

No Comments

No comments yet.

Sorry, the comment form is closed at this time.