Intersoft.Client.UI.Navigation Namespace > UXFrame Class : ErrorStyle Property |
UXFrame includes streamlined error management by providing a built-in friendly error page. When the navigation frame caught an exception that thrown during the navigation process, for instance, the page not found error, UXFrame shows a friendly error page instead of throwing a Javascript error message to the user.
You can customize the error page with your own XAML template by setting the ErrorStyle property of the UXFrame control.
For more information on how to customize error style, see Advanced Features in ClientUI Navigation Framework.
<Intersoft:UXPage ... > <Intersoft:UXPage.Resources> <Style x:Key="CustomErrorPageStyle" TargetType="Intersoft:UXFrameErrorPage"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="VerticalContentAlignment" Value="Stretch"/> <Setter Property="ErrorTextFormat" Value="Unable to navigate to '{0}'"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Intersoft:UXFrameErrorPage"> <Grid x:Name="LayoutRoot" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="White"> <Grid.ColumnDefinitions> <ColumnDefinition Width="81"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="64"/> <RowDefinition Height="5"/> <RowDefinition Height="34"/> <RowDefinition/> </Grid.RowDefinitions> <Image HorizontalAlignment="Center" Margin="0,15,0,1" Source="/Intersoft.Client.UI.Navigation;component/Resources/win7_error48.png" Stretch="None"/> <TextBlock x:Name="TitleElement" Grid.Column="1" Foreground="#FF903222" FontSize="16" Margin="1,0,0,10" TextWrapping="Wrap" Text="{TemplateBinding ErrorTitle}" VerticalAlignment="Bottom"/> <Border BorderBrush="#FFD0D0D0" BorderThickness="0,1,0,0" Grid.Column="1" Height="1" Margin="0,0,50,0" Grid.Row="1" VerticalAlignment="Center"/> <TextBlock Grid.Column="1" Foreground="#FF494949" FontSize="14.667" HorizontalAlignment="Left" Grid.Row="2" TextWrapping="Wrap" Text="More Information" VerticalAlignment="Center"/> <TextBlock x:Name="DetailElement" Grid.Column="1" Foreground="#FF4F4F4F" FontSize="12" Grid.Row="3" TextWrapping="Wrap" Text="{TemplateBinding ErrorDetails}" ScrollViewer.VerticalScrollBarVisibility="Auto"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Intersoft:UXPage.Resources> ... <Intersoft:UXFrame x:Name="ContentFrame" EnablePageTransition="True" TransitionDuration="0.5" ErrorStyle="{StaticResource CustomErrorPageStyle}"> <Intersoft:UXFrame.UriMapper> ... </Intersoft:UXFrame.UriMapper> </Intersoft:UXFrame> ... </Intersoft:UXPage>
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2