3
<title>AlignmentY (VideoBrush) 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">
10
<MediaElement x:Name="ExampleVideo" Source="../../media/video/timecode-short-wmv8.wmv" Opacity="0.0" IsHitTestVisible="False" />
12
<Rectangle Canvas.Left="20" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
14
<VideoBrush SourceName="ExampleVideo" Stretch="None" AlignmentY="Top" />
17
<Rectangle Canvas.Left="120" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
19
<VideoBrush SourceName="ExampleVideo" Stretch="None" AlignmentY="Center" />
22
<Rectangle Canvas.Left="220" Canvas.Top="20" Stroke="Black" Width="100" Height="100" >
24
<VideoBrush SourceName="ExampleVideo" Stretch="None" AlignmentY="Bottom" />
28
<Rectangle Canvas.Left="20" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
30
<VideoBrush x:Name="testcase1" SourceName="ExampleVideo" Stretch="None" />
33
<Rectangle Canvas.Left="120" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
35
<VideoBrush x:Name="testcase2" SourceName="ExampleVideo" Stretch="None" />
38
<Rectangle Canvas.Left="220" Canvas.Top="120" Stroke="Black" Width="100" Height="100" >
40
<VideoBrush x:Name="testcase3" SourceName="ExampleVideo" Stretch="None" />
46
<script language="javascript">
47
function onLoaded (sender, args)
49
// invalid values defaults to BOTTOM (no value is CENTER)
50
sender.findName ("testcase1").AlignmentY = -1;
51
sender.findName ("testcase2").AlignmentY = 911;
53
sender.findName ("testcase3").AlignmentY = "tOp";
55
// Silverlight shows an Alert
56
// Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: AlignmentY
58
sender.findName ("testcase3").AlignmentY = "-1";
59
sender.findName ("testcase3").AlignmentY = sender.findName ("testcase2");
60
sender.findName ("testcase3").AlignmentY = null;
61
sender.findName ("testcase3").AlignmentY = true;
68
<div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
70
<script type="text/javascript">
71
var pe = document.getElementById("SilverlightPluginHost");
72
Silverlight.createObject("#xaml", pe, "AgControl1", {
75
inplaceInstallPrompt:false,
86
<div style="position:absolute; top:400px; left:50px">
87
<p>0,0 should be completely <b>black</b>
88
<br>1,0 should be the center of <b>0:0</b>
89
<br>2,0 should be completely <b>black</b>
90
<p>0,1 should be completely <b>black</b>
91
<br>1,1 should be completely <b>black</b>
92
<br>2,1 should be completely <b>black</b>