Silverlight/XAML – Learning by Coding

[ sl2_styling_2.xaml --> Grafik anzeigen ]

 1: <?xml version="1.0" encoding="UTF-8"?>
 2: <!-- coded by Thomas Meinike 08/08 -->
 3: <UserControl x:Class="sl2_styling_2.Page"
 4:   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
 5:   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 6:   Width="800" Height="600">
 7: 
 8:   <Canvas>
 9:     <Rectangle Canvas.Left="30" Canvas.Top="30" Width="200" Height="100"
10:       Style="{StaticResource rectstyle}" />
11:     <Rectangle Canvas.Left="250" Canvas.Top="42.5" Width="150" Height="75"
12:       Style="{StaticResource rectstyle}"/>
13:     <Rectangle Canvas.Left="420" Canvas.Top="55" Width="100" Height="50"
14:       Style="{StaticResource rectstyle}"/>
15:   </Canvas>
16: 
17: 
18:   <!-- // zusätzlich verwendeter XAML-Code in App.xaml:
19: 
20:   <Application x:Class="sl2_styling_2.App"
21:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
23: 
24:     <Application.Resources>
25:       <Style TargetType="Rectangle" x:Key="rectstyle">
26:         <Setter Property="Stroke" Value="#FF0"/>
27:         <Setter Property="StrokeThickness" Value="2"/>
28:         <Setter Property="Fill" Value="#6FC"/>
29:         <Setter Property="Opacity" Value="0.9"/>
30:       </Style>
31:     </Application.Resources>
32: 
33:   </Application>
34: 
35:   -->
36: 
37: </UserControl>

[zum Anfang]