WP7 Mango:重新模板 PhoneApplicationFrame 创建了“未指定错误”例外

发布于 2024-11-30 17:03:25 字数 1427 浏览 2 评论 0原文

以下内容曾经在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

春风十里 2024-12-07 17:03:25

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.

苦行僧 2024-12-07 17:03:25

我无法准确重现您的问题,但我在重新模板列表框时遇到了同样的错误。
尝试在 ControlTemplate 上设置 TargetType 属性(对我有用):

<ControlTemplate TargetType="phone:PhoneApplicationFrame">

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) :

<ControlTemplate TargetType="phone:PhoneApplicationFrame">
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文