Silverlight/XAML – Learning by Coding
1: <?xml version="1.0" encoding="UTF-8"?>
2: <!-- coded by Thomas Meinike 01/09 -->
3: <UserControl x:Class="sl2_textresources.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: <TextBlock Canvas.Left="30" Canvas.Top="30" Foreground="#00F" FontSize="14">
10: <Run Text="Autor:"/>
11: <Run Text="{StaticResource Vorname}"/>
12: <Run Text="{StaticResource Nachname}"/>
13: <Run Text="("/><Run Text="{StaticResource Datum}"/><Run Text=")"/>
14: </TextBlock>
15: </Canvas>
16:
17:
18: <!-- // zusätzlich verwendeter XAML-Code in App.xaml:
19:
20: <Application x:Class="sl2_textresources.App"
21: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
23: xmlns:corelib="clr-namespace:System;assembly=mscorlib">
24:
25: <Application.Resources>
26: <corelib:String x:Key="Vorname">Thomas</corelib:String>
27: <corelib:String x:Key="Nachname">Meinike</corelib:String>
28: <corelib:String x:Key="Datum">2009-01-31</corelib:String>
29: </Application.Resources>
30:
31: </Application>
32:
33: -->
34:
35: </UserControl>
[zum Anfang]