WP 8.1 XAML:值不在预期范围内(Page.BottomAppBar) [英] WP 8.1 XAML: Value does not fall within the expected range (Page.BottomAppBar)

查看:70
本文介绍了WP 8.1 XAML:值不在预期范围内(Page.BottomAppBar)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我的XAML遇到了恼人的错误。  在我的主页上,我正在尝试定义一个命令栏。  到现在为止,它完全正常,我没有做任何改动。  错误的下划线来自< CommandBar ...>
到< / CommandBar>。

 

< Page ...>
< Page.BottomAppBar>
< CommandBar x:Name =" ButtonBar" Background =" {StaticResource StrikeDistanceThemeBrush}" Foreground =" {StaticResource StrikeDistanceForegroundBrush}" BorderBrush = QUOT;白色">
< CommandBar.SecondaryCommands>
< AppBarButton x:Name =" SettingsButton"标签= QUOT;设置"点击= QUOT; SettingsButton_Click" />
< AppBarButton x:Name =" AboutButton"标签= [关于"点击= QUOT; AboutButton_Click" />
< AppBarButton x:Name =" AppsButton" Label ="更多应用"/>
< AppBarButton x:Name =" RateButton"标签= QUOT;率+审查" />
< /CommandBar.SecondaryCommands>
< AppBarButton x:Name =" CalculateButton"标签= QUOT;计算"点击= QUOT; CalculateButton_Click"图标= QUOT;计算器" />
< AppBarButton x:Name =" ClearAllButton"图标= QUOT;清零" Label ="全部清除"点击= QUOT; ClearAllButton_Click" />
< AppBarButton x:Name =" HelpButton"图标= [说明"标签= [说明" />
< / CommandBar>
< /Page.BottomAppBar>

...

< / Page>

更令人奇怪的是,当应用程序运行时,栏仍然正常显示。  唯一的问题是元素没有根据需要向上移动(例如我的AdDuplex控件锚定在页面底部,导致不断的消息说
它被覆盖)。  我尝试过重建和构建应用,调试它,然后重新启动Visual Studio。  没有任何变化。


如果有人可以帮我压扁这个,我会非常感激!


谢谢!





~TechPerson32

解决方案

这是一个Silverlight应用程序还是Windows Phone运行时应用程序?


在运行时应用程序中,您的代码可以正常使用。 它对Silverlight无效app。


如果您使用的是Silverlight,请参阅
如何使用XAML for Windows Phone创建应用栏


- 罗布


Hello, I'm experiencing an annoying error with my XAML.  On my main page, I am trying to define a command bar.  Until now, it worked completely fine and I haven't made any changes.  The underlining for the error spans from <CommandBar ...> to </CommandBar>.

<Page ...> <Page.BottomAppBar> <CommandBar x:Name="ButtonBar" Background="{StaticResource StrikeDistanceThemeBrush}" Foreground="{StaticResource StrikeDistanceForegroundBrush}" BorderBrush="White"> <CommandBar.SecondaryCommands> <AppBarButton x:Name="SettingsButton" Label="settings" Click="SettingsButton_Click"/> <AppBarButton x:Name="AboutButton" Label="about" Click="AboutButton_Click"/> <AppBarButton x:Name="AppsButton" Label="more apps"/> <AppBarButton x:Name="RateButton" Label="rate+review"/> </CommandBar.SecondaryCommands> <AppBarButton x:Name="CalculateButton" Label="calculate" Click="CalculateButton_Click" Icon="Calculator"/> <AppBarButton x:Name="ClearAllButton" Icon="Clear" Label="clear all" Click="ClearAllButton_Click"/> <AppBarButton x:Name="HelpButton" Icon="Help" Label="help"/> </CommandBar> </Page.BottomAppBar>

...

</Page>

What makes this even more strange is that the bar still appears normally when the app is run.  The only problem being elements not being moved up as needed (such as my AdDuplex control anchored to the bottom of the page, causing constant messages saying it is being covered).  I have tried rebuilding and building the app, debugging it, and restarting Visual Studio.  Nothing changes.

If someone could help me squash this one, I would greatly appreciate it!

Thanks!


~ TechPerson32

解决方案

Is this a Silverlight app or a Windows Phone Runtime app?

Your code works fine for me in a Runtime app. It is not valid for a Silverlight app.

If you are using Silverlight then see How to create an app bar using XAML for Windows Phone

--Rob


这篇关于WP 8.1 XAML:值不在预期范围内(Page.BottomAppBar)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆