3

以下曾经在 WP 7.0 中工作:

我正在尝试使用以下 Xaml 在我的 Mango beta 2 refresh (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。有人见过这个吗?

4

2 回答 2

1

Blend 有助于指出一些不应在 Mango 中设置的属性。删除 Content 和 ContentTemplate 属性解决了这个问题。

于 2011-08-24T22:41:17.250 回答
0

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

<ControlTemplate TargetType="phone:PhoneApplicationFrame">
于 2011-08-23T14:05:37.233 回答