Silverlight Webside在部署时是否可以扩展?

时间:2012-05-09 22:51:22

标签: wpf silverlight

我已经在我的服务器上通过ftp部署了Silverlight网站。它在我的chrome或ie浏览器中看起来很好看localhost测试。当我在服务器上部署网站时,一切都要大20%。字体更大,也是图像。

它是Telerik方面。

HTML:

<title>GSH_Kundenmanager_v.2.0</title>

<style type="text/css">

html, body {

    height: 100%;

    overflow: auto;

}

body {

    padding: 0;

    margin: 0;

}

#silverlightControlHost {

    height: 100%;

    text-align:center;

}

</style>

<script type="text/javascript" src="Silverlight.js"></script>

<script type="text/javascript">

    function onSilverlightError(sender, args) {

        var appSource = "";

        if (sender != null && sender != 0) {

          appSource = sender.getHost().Source;

        }



        var errorType = args.ErrorType;

        var iErrorCode = args.ErrorCode;



        if (errorType == "ImageError" || errorType == "MediaError") {

          return;

        }



        var errMsg = "Unbehandelter Fehler in Silverlight-Anwendung" +  appSource + "\n" ;



        errMsg += "Code: "+ iErrorCode + "    \n";

        errMsg += "Kategorie: " + errorType + "       \n";

        errMsg += "Meldung: " + args.ErrorMessage + "     \n";



        if (errorType == "ParserError") {

            errMsg += "Datei: " + args.xamlFile + "     \n";

            errMsg += "Zeile: " + args.lineNumber + "     \n";

            errMsg += "Position: " + args.charPosition + "     \n";

        }

        else if (errorType == "RuntimeError") {           

            if (args.lineNumber != 0) {

                errMsg += "Zeile: " + args.lineNumber + "     \n";

                errMsg += "Position: " +  args.charPosition + "     \n";

            }

            errMsg += "Methodenname: " + args.methodName + "     \n";

        }



        throw new Error(errMsg);

    }

</script>

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

      <param name="source" value="ClientBin/GSH_Kundenmanager_v.2.0.xap"/>

      <param name="onError" value="onSilverlightError" />

      <param name="background" value="white" />

      <param name="minRuntimeVersion" value="4.0.60310.0" />

      <param name="autoUpgrade" value="true" />

      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.60310.0" style="text-decoration:none">

          <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Holen Sie sich Microsoft Silverlight" style="border-style:none"/>

      </a>

    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>

</form>

XAML:

<Grid x:Name="LayoutRoot" Background="DimGray">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="0"></ColumnDefinition>
        <ColumnDefinition Width="60*" MinWidth="800"></ColumnDefinition>
        <ColumnDefinition Width="0"></ColumnDefinition>
        </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>


    <Grid Grid.Column="1" MinWidth="800" Background="White">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"></RowDefinition>
        <RowDefinition Height="Auto"></RowDefinition>
        <RowDefinition Height="40"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="40"></RowDefinition>
        </Grid.RowDefinitions>

    <Image Source="images/logo.png" Height="100" HorizontalAlignment="Right" Margin="10"></Image>

    <StackPanel  Grid.Row="1" HorizontalAlignment="Right" Margin="0,5,10,5" Orientation="Horizontal">
        <TextBlock Text="" FontSize="16" Margin="0,5,10,5"></TextBlock>
        <HyperlinkButton Content="Abmelden"  FontSize="15" Grid.Row="1" HorizontalAlignment="Right" Margin="10,5,10,5" Click="HyperlinkButton_Click"></HyperlinkButton>
    </StackPanel>

    <StackPanel  Grid.Row="2" HorizontalAlignment="Left" Margin="0,10,0,0" Orientation="Horizontal">
        <HyperlinkButton Content="Übersicht" x:Name="btn_controlPanel"  Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Gray" Height="30" Margin="1"  Padding="10,2,10,0" Foreground="White" FontSize="18">
        </HyperlinkButton>
        <HyperlinkButton Content="Kunden Übersicht" x:Name="btn_kundeLaden"  Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Gray" Height="30" Margin="1" Padding="10,2,10,0" Foreground="White" FontSize="18" Click="btn_kundeLaden_Click">
        </HyperlinkButton>
            <HyperlinkButton Content="Neuen Kunde anlegen" x:Name="btn_neuerKunde" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Gray" Height="30" Margin="1" Padding="10,2,10,0" Foreground="White" FontSize="18" Click="btn_addKunde_Click">
        </HyperlinkButton>
            <HyperlinkButton Content="{Binding Name}" Grid.Row="1"  x:Name="btn_kunde" Width="150"  HorizontalAlignment="Center" VerticalAlignment="Center" Background="LightGray" Height="30" Margin="20,1,1,1" Padding="10,2,10,0" Foreground="White" FontSize="18" Click="btn_kunde_Click">
        </HyperlinkButton>
    </StackPanel>

    <ContentControl x:Name="cc_clients" Grid.Row="3" Margin="10"></ContentControl>
</Grid>
</Grid>

有人给我一个提示吗?

谢谢!

0 个答案:

没有答案