3

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?

Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
James Cadd
  • 12,136
  • 30
  • 85
  • 134

2 Answers2

1

Blend was helpful in pointing out some properties that shouldn't be set in Mango. Removing the Content and ContentTemplate properties fixed the issue.

James Cadd
  • 12,136
  • 30
  • 85
  • 134
0

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">
glacasa
  • 1,770
  • 2
  • 16
  • 32