2009-01-06 5 views
0

Essayez cet exemple de code. Voici la page aspx avec le contrôle silverlight, et en dessous, le code xaml pour la grille avec des lignes colorées. Notez que la grille a 8 rangées de 100 hauteurs chacune, mais seulement les 6 premières rangées apparaissent. Je ne peux pas obtenir le contrôle de montrer plus grand que 600.Silverlight Control ne va pas plus haut que 600, bug?


code 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 code


<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> 

Ide comme?

+0

Vous avez déjà demandé cela dans un autre poste. Ne pas. – jcollum

+0

J'en suis conscient. Quand je l'ai posté la première fois, il n'a montré qu'une partie du code car (je pensais) je ne l'ai pas formaté correctement pour montrer tout le code. Donc, je l'ai posté à nouveau avec le formatage correct. Comment puis-je supprimer ce post? –

Répondre

1

Je viens d'essayer votre XAML et ASPX, ça marche pour moi; Je peux voir toutes les trois lignes. Lors de la création d'un nouveau projet Silverlight, VS ajoute cet 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> 

Pouvez-vous essayer l'ASPX ci-dessus?

HTH, indy

+0

Indy, merci pour votre réponse, mais vous êtes censé voir 8 lignes, pas 3. C'est mon point de contrôle coupe à une hauteur de 600. –

+0

C'est l'aspx que j'ai commencé avec et ça ne fonctionne pas non plus. Est-ce que tu l'as essayé? Avez-vous vu 8 lignes? –

Questions connexes