Silverlight Border FAIL !
Border FAIL !! I have a border in XAML code that is defined right after that main canvas:
<Canvas xmlns="http://schemas.micro开发者_开发知识库soft.com/client/2007"
... VerticalAlignment="Top" HorizontalAlignment="Center">
<Border x:Name="JohnnyBorder" BorderThickness="1" Margin="0,0,0,0" BorderBrush="#FF677B8B" VerticalAlignment="Stretch"
HorizontalAlignment="Center">
And in the code I position the border ike this:
JohnnyBorder = (Border)appCanvas.FindName("JohnnyBorder");
JohnnyBorder.Height = App.Current.Host.Content.ActualHeight;
JohnnyBorder.Width = App.Current.Host.Content.ActualWidth;
But it does not work. JohnnyBoarder's bottom line is a few percentages above the bottom of the browser. Why?
I think it would be a lot more natural to have your Border
around you Canvas
:
<Border>
<Canvas>
...
</Canvas>
</Border>
By default the Border
will fill the page and the Canvas
will fill the Border
.
The page hosting your silverlight app may not be giving the Silverlight app 100% height. Check either the html or aspx file hosting your silverlight app and ensure it's set to 100% height.
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
精彩评论