silverlight   发布时间:2022-05-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了使用Silverlight应用程序填充浏览器窗口大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我想要我的Silverlight应用程序来填充整个浏览器窗口.我将插件对象的宽度和高度设置为100%,并将我的LayoutRoot容器的高度和宽度设置为Auto,但仍然没有运气.有什么建议么? <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:
我想要我的Silverlight应用程序来填充整个浏览器窗口.我将插件对象的宽度和高度设置为100%,并将我的LayoutRoot容器的高度和宽度设置为Auto,但仍然没有运气.有什么建议么?

<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:Silverlight ID="Silverlight1" runat="server" 
        source="~/ClientBin/Client.xap"
        MinimumVersion="2.0.30818.0"
        AutoUpgrade="true"
        Height="100%" 
        Width="100%">
    </asp:Silverlight>
</form>

<UserControl 
    x:Class="Client.Page"
    xmlns="http://scheR_131_11845@as.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://scheR_131_11845@as.microsoft.com/winfx/2006/xaml" 
    Height="Auto"
    Width="Auto">
    <Grid 
        x:Name="LayoutRoot" 
        BACkground="#084E85"
        ShowGridLines="True">
        <Grid.columnDeFinitions>
            <columnDeFinition Width="280" />
            <columnDeFinition Width="Auto" />
        </Grid.columnDeFinitions>
        <Grid.RowDeFinitions>
            <RowDeFinition Height="80" />
            <RowDeFinition Height="Auto" />
            <RowDeFinition Height="600" />
        </Grid.RowDeFinitions>

        ...Remaining content here...
    </Grid>
</UserControl>

免责声明:我首先搜索一个答案,找到了this thread.但是,正如你可以看到我的代码不适合我的.

解决方法

首先,我不设用户控件的高度/宽度.相反,我设置了DesignHeight和DesignWidth(在“ http://schemas.microsoft.com/expression/blend/2008”命名空间中),并将对齐方式设置为拉伸

<UserControl ... 
    xmlns:d="http://scheR_131_11845@as.microsoft.com/expression/blend/2008" 
    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    d:DesignHeight="1050" d:DesignWidth="1680">

在我的Html中,我将Height和Width设置为100%

<div style="height: 100%; width: 100%; position: fixed;">
        <asp:Silverlight runat="server" source="~/ClientBin/My.xap" ID="MyId" 
            Width="100%" Height="100%" />
</div>

在这一点上,一切都适用于我,让它占据整个窗口.

大佬总结

以上是大佬教程为你收集整理的使用Silverlight应用程序填充浏览器窗口全部内容,希望文章能够帮你解决使用Silverlight应用程序填充浏览器窗口所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。