WP7 Mango:重新模板 PhoneApplicationFrame 创建了“未指定错误”例外
以下内容曾经在 WP 7.0 中工作:
我尝试使用以下 Xaml 在我的 Mango beta 2 刷新 (7712) 项目中重新模板化根 PhoneApplicationFrame:
<Style TargetType="phone:PhoneApplicationFrame" x:Key="FrameStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border x:Name="ClientArea" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" >
<Grid>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
<toolkit:PerformanceProgressBar IsIndeterminate="True" VerticalAlignment="Top" Margin="0,8,0,0" Visibility="{Binding Path=GlobalProgressVisibility, Source={StaticResource RootFrameViewModel}}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
当应用程序启动时,我收到一个 App.UnhandledException ,其中包含文本“未指定”错误”并且没有堆栈跟踪。有人见过这个吗?
The following used to work in WP 7.0:
I'm attempting to re-template the root PhoneApplicationFrame in my Mango beta 2 refresh (7712) project with the following Xaml:
<Style TargetType="phone:PhoneApplicationFrame" x:Key="FrameStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border x:Name="ClientArea" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" >
<Grid>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
<toolkit:PerformanceProgressBar IsIndeterminate="True" VerticalAlignment="Top" Margin="0,8,0,0" Visibility="{Binding Path=GlobalProgressVisibility, Source={StaticResource RootFrameViewModel}}" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
When the application launches I get an App.UnhandledException with the text "Unspecified error" and no stack trace. Has anyone seen this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Blend 有助于指出一些不应在 Mango 中设置的属性。删除 Content 和 ContentTemplate 属性解决了该问题。
Blend was helpful in pointing out some properties that shouldn't be set in Mango. Removing the Content and ContentTemplate properties fixed the issue.
我无法准确重现您的问题,但我在重新模板列表框时遇到了同样的错误。
尝试在 ControlTemplate 上设置 TargetType 属性(对我有用):
I can't reproduce exactly your problem, but I had the same error retemplating a listbox.
Try setting the TargetType property on the ControlTemplate (worked for me) :