* MoonlightTypeConverter.cs: Convert CacheMode's from strings.
[moon.git] / test / xaml / enums / alignmentx-imagebrush.html
blobf7b19cc2f51bf8aac5ffcfd5c9ed7e7ce6990a15
1 <html>
2 <head>
3 <title>AlignmentX (ImageBrush) Test Page</title>
5 <script language="javascript" src="Silverlight.js"></script>
7 <script type="text/xaml" id="xaml">
8 <Canvas x:Name="canvas" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="100" Height="100" Loaded="onLoaded">
9 <Rectangle Canvas.Left="20" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
10 <Rectangle.Fill>
11 <ImageBrush ImageSource="../mono.png" Stretch="None" AlignmentX="Left" />
12 </Rectangle.Fill>
13 </Rectangle>
14 <Rectangle Canvas.Left="120" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
15 <Rectangle.Fill>
16 <ImageBrush ImageSource="../mono.png" Stretch="None" AlignmentX="Center" />
17 </Rectangle.Fill>
18 </Rectangle>
19 <Rectangle Canvas.Left="220" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
20 <Rectangle.Fill>
21 <ImageBrush ImageSource="../mono.png" Stretch="None" AlignmentX="Right" />
22 </Rectangle.Fill>
23 </Rectangle>
25 <Rectangle Canvas.Left="20" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
26 <Rectangle.Fill>
27 <ImageBrush x:Name="testcase1" ImageSource="../mono.png" Stretch="None" />
28 </Rectangle.Fill>
29 </Rectangle>
30 <Rectangle Canvas.Left="120" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
31 <Rectangle.Fill>
32 <ImageBrush x:Name="testcase2" ImageSource="../mono.png" Stretch="None" />
33 </Rectangle.Fill>
34 </Rectangle>
35 <Rectangle Canvas.Left="220" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
36 <Rectangle.Fill>
37 <ImageBrush x:Name="testcase3" ImageSource="../mono.png" Stretch="None" />
38 </Rectangle.Fill>
39 </Rectangle>
40 </Canvas>
41 </script>
43 <script language="javascript">
44 function onLoaded (sender, args)
46 // invalid values defaults to RIGHT (no value is CENTER)
47 sender.findName ("testcase1").AlignmentX = -1;
48 sender.findName ("testcase2").AlignmentX = 911;
50 sender.findName ("testcase3").AlignmentX = "lEfT";
52 // Silverlight shows an Alert
53 // Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: AlignmentX
55 sender.findName ("testcase3").AlignmentX = "-1";
56 sender.findName ("testcase3").AlignmentX = sender.findName ("testcase2");
57 sender.findName ("testcase3").AlignmentX = null;
58 sender.findName ("testcase3").AlignmentX = true;
61 </script>
62 </head>
64 <body>
65 <div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
67 <script type="text/javascript">
68 var pe = document.getElementById("SilverlightPluginHost");
69 Silverlight.createObject("#xaml", pe, "AgControl1", {
70 width:'600px',
71 height:'300px',
72 inplaceInstallPrompt:false,
73 background:'#FFFFFF',
74 isWindowless:'false',
75 framerate:'24',
76 version:'1.0'
77 }, {
78 onError:null,
79 onLoad:null
81 null);
82 </script>
83 <div style="position:absolute; top:400px; left:50px">
84 <p>0,0 should be <b>left</b> aligned
85 <br>1,0 should be <b>center</b> aligned
86 <br>2,0 should be <b>right</b> aligned
87 <p>0,1 should be <b>right</b> aligned
88 <br>1,1 should be <b>right</b> aligned
89 <br>2,1 should be <b>left</b> aligned
90 </div>
91 </body>
92 </html>