Контроль Silverlight не пойдет выше 600, ошибка? - PullRequest
0 голосов
/ 07 января 2009

Попробуйте этот пример кода. Ниже приведена страница aspx с элементом управления silverlight, а ниже - код xaml для сетки с цветными строками. Обратите внимание, что сетка имеет 8 строк по 100 высот в каждом, но отображаются только первые 6 строк. Я не могу получить контроль, чтобы показать больше 600.


код aspx


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
        <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/x.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
        </div>
</form>
</body>
</html>

Код XAML


<UserControl xmlns:my1="clr- namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  x:Class="x.Test"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
Width="400" Height="Auto">
<Grid x:Name="LayoutRoot" Background="White">
    <Grid.RowDefinitions >
        <RowDefinition Height="100"/>
        <RowDefinition  Height="100"/>
        <RowDefinition  Height="100"/>
        <RowDefinition  Height="100"/>
        <RowDefinition  Height="100"/>
        <RowDefinition Height="100" />
        <RowDefinition Height="100" />
        <RowDefinition Height="100" />
    </Grid.RowDefinitions>

    <Rectangle Grid.Row="0" Fill="Green"/>
    <Rectangle Grid.Row="1" Fill="Red" />
    <Rectangle Grid.Row="2" Fill="Blue" />
    <Rectangle Grid.Row="3" Fill="Orange"/>
    <Rectangle Grid.Row="4" Fill="Yellow" />
    <Rectangle Grid.Row="5" Fill="Black" />
    <Rectangle Grid.Row="6" Fill="Aqua"/>
    <Rectangle Grid.Row="7" Fill="Olive"/>

</Grid>
</UserControl>

Идеи

1 Ответ

1 голос
/ 07 января 2009

Я только что попробовал ваш XAML и ASPX, он работает для меня; Я вижу все три ряда. При создании нового проекта Silverlight VS добавляет этот ASPX -

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
        TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" style="height:100%;">
    <head runat="server">
        <title>SilverlightApplication1</title>
    </head>
    <body style="height:100%;margin:0;">
        <form id="form1" runat="server" style="height:100%;">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <div  style="height:100%;">
                <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SilverlightApplication1.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
            </div>
        </form>
    </body>
    </html>

Можете ли вы попробовать вышеупомянутый ASPX?

НТН, Инди

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...