简体   繁体   English

帮助Nokola的NavSeven Silverlight导航栏!

[英]Help with Nokola's NavSeven Silverlight navigation bar!

I really like Nokola's NavSeven Silverlight Bar. 我真的很喜欢Nokola的NavSeven Silverlight Bar。

You can take a look at it here: http://www.nokola.com/sources/ 您可以在这里查看: http : //www.nokola.com/sources/

You can notice right away that the Navigation Bar stretches all the way to 100% and icons are nicely aligned in the middle. 您会立即注意到导航栏一直延伸到100%,并且图标在中间很好地对齐。

The navigation bar itself is 900px wide in Page.xaml. 导航栏本身在Page.xaml中为900px宽。

I've got it to work on my website but for some reason I cannot stretch it to 100% like on Nokola's site. 我可以在我的网站上使用它,但是由于某些原因,我无法像Nokola的网站那样将其扩展到100%。

Here's what happens: I set width to 100% but instead of stretching, it stays at 900px wide and fills everything else with Whitespace. 这是发生的情况:我将宽度设置为100%,但没有进行拉伸,而是保持900px的宽度,并用空白填充了其他所有内容。 That's another problem - no matter what I change the background color to, it is always white which looks bad on my grey background of the website. 那是另一个问题-无论我将背景颜色更改为什么,它总是白色,在网站的灰色背景上看起来很糟糕。 But that's not really the point, it still doesn't stretch like it is supposed to, like it is on Nokola's website. 但这并不是重点,它仍然没有像Nokola网站上那样延展。

Here's the code I use to include my Silverlight file: 这是我用来包含Silverlight文件的代码:

<div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="43px">
    <param name="source" value="ClientBin/NavSeven.xap"/>
    <param name="onError" value="onSilverlightError" />
    <param name="background" value="white" />
    <param name="minRuntimeVersion" value="3.0.40624.0" />
    <param name="autoUpgrade" value="true" />
          <param name="enableGPUAcceleration" value="true" />
    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none">
      <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
    </a>
     </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>

替代文字

Get rid of any fixed widths in your page.xaml. 摆脱page.xaml中的任何固定宽度。 The 900 is likely still present on another grid and overriding the default behaviour. 900可能仍存在于另一个网格上,并覆盖默认行为。

If you remove that it will stretch to fit the parent Silverlight container (which defaults to fullscreen unless told otherwise in the html page - 43 pixels high in your case). 如果删除,它将拉伸以适合父级Silverlight容器(除非在html页面中另有说明,否则默认为全屏显示-在您的情况下为43像素高)。

If that does not fix it please post your XAML for the page itself and correcting it will take only a few minutes. 如果仍不能解决问题,请发布页面本身的XAML,更正只需几分钟。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM