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" >
11 <ImageBrush ImageSource=
"../mono.png" Stretch=
"None" AlignmentX=
"Left" />
14 <Rectangle Canvas.
Left=
"120" Canvas.
Top=
"20" Stroke=
"Black" Width=
"100" Height=
"100" >
16 <ImageBrush ImageSource=
"../mono.png" Stretch=
"None" AlignmentX=
"Center" />
19 <Rectangle Canvas.
Left=
"220" Canvas.
Top=
"20" Stroke=
"Black" Width=
"100" Height=
"100" >
21 <ImageBrush ImageSource=
"../mono.png" Stretch=
"None" AlignmentX=
"Right" />
25 <Rectangle Canvas.
Left=
"20" Canvas.
Top=
"120" Stroke=
"Black" Width=
"100" Height=
"100" >
27 <ImageBrush x:
Name=
"testcase1" ImageSource=
"../mono.png" Stretch=
"None" />
30 <Rectangle Canvas.
Left=
"120" Canvas.
Top=
"120" Stroke=
"Black" Width=
"100" Height=
"100" >
32 <ImageBrush x:
Name=
"testcase2" ImageSource=
"../mono.png" Stretch=
"None" />
35 <Rectangle Canvas.
Left=
"220" Canvas.
Top=
"120" Stroke=
"Black" Width=
"100" Height=
"100" >
37 <ImageBrush x:
Name=
"testcase3" ImageSource=
"../mono.png" Stretch=
"None" />
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;
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", {
72 inplaceInstallPrompt
:false,
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