3
<title>Visibility (TextBlock) 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.Top="0" Canvas.Left="000" Width="90" Height="50" Stroke="Red" />
10
<TextBlock Canvas.Top="0" Canvas.Left="0" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24" >
14
<Rectangle Canvas.Top="0" Canvas.Left="200" Width="90" Height="50" Stroke="Red" />
15
<TextBlock Canvas.Top="0" Canvas.Left="200" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24" Visibility="Visible">
19
<Rectangle Canvas.Top="0" Canvas.Left="400" Width="90" Height="50" Stroke="Red" />
20
<TextBlock Canvas.Top="0" Canvas.Left="400" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24" Visibility="Collapsed">
25
<Rectangle Canvas.Top="100" Canvas.Left="0" Width="90" Height="50" Stroke="Red" />
26
<TextBlock x:Name="testcase1" Canvas.Top="100" Canvas.Left="0" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
30
<Rectangle Canvas.Top="100" Canvas.Left="200" Width="90" Height="50" Stroke="Red" />
31
<TextBlock x:Name="testcase2" Canvas.Top="100" Canvas.Left="200" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
35
<Rectangle Canvas.Top="100" Canvas.Left="400" Width="90" Height="50" Stroke="Red" />
36
<TextBlock x:Name="testcase3" Canvas.Top="100" Canvas.Left="400" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
41
<Rectangle Canvas.Top="200" Canvas.Left="0" Width="90" Height="50" Stroke="Red" />
42
<TextBlock x:Name="testcase4" Canvas.Top="200" Canvas.Left="0" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
46
<Rectangle Canvas.Top="200" Canvas.Left="200" Width="90" Height="50" Stroke="Red" />
47
<TextBlock x:Name="testcase5" Canvas.Top="200" Canvas.Left="200" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
51
<Rectangle Canvas.Top="200" Canvas.Left="400" Width="90" Height="50" Stroke="Red" />
52
<TextBlock x:Name="testcase6" Canvas.Top="200" Canvas.Left="400" Width="90" Height="50" Foreground="Black" FontFamily="Arial" FontSize="24">
58
<script language="javascript">
59
function onLoaded (sender, args)
61
sender.findName ("testcase1").Visibility = 0;
62
sender.findName ("testcase2").Visibility = 1;
63
sender.findName ("testcase3").Visibility = -1;
64
sender.findName ("testcase4").Visibility = 1000;
65
sender.findName ("testcase5").Visibility = "vIsIbLe";
66
sender.findName ("testcase6").Visibility = "cOlLaPsEd";
68
// Silverlight shows an Alert
69
// Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: Visibility
71
sender.findName ("testcase5").Visibility = "nOnE";
72
sender.findName ("testcase3").Visibility = sender.findName ("testcase2");
73
sender.findName ("testcase3").Visibility = null;
74
sender.findName ("testcase3").Visibility = true;
81
<div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
83
<script type="text/javascript">
84
var pe = document.getElementById("SilverlightPluginHost");
85
Silverlight.createObject("#xaml", pe, "AgControl1", {
88
inplaceInstallPrompt:false,
99
<div style="position:absolute; top:400px; left:50px">
100
<p>0,0: "ABRA C" inside rectangle, "ADA" outside
101
<br>1,0: "ABRA C" inside rectangle, "ADA" outside
102
<br>2,0: Empty rectangle
103
<p>0,1: "ABRA C" inside rectangle, "ADA" outside
104
<br>1,1: Empty rectangle
105
<br>2,1: Empty rectangle
106
<p>0,2: Empty rectangle
107
<br>1,2: "ABRA C" inside rectangle, "ADA" outside
108
<br>2,2: Empty rectangle