This is a migrated thread and some comments may be shown as answers.

RadWindow Opens with Transparent Background

1 Answer 291 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 18 May 2011, 08:52 PM
I have several RadWindows in my WP7 app. The first one is part of MainPage.xaml and it opens with a black background (expected).
When I navigate to a different page that contains another RadWindow, the window initially opens when the page loaded event is fired. The first time this RadWindow opens, its background is transparent and not black (default) which I want. When I close the RadWindow and reopen it via the ApplicationBar it displays with the black background. Truly Bizzaro.

XAML:
    <Grid x:Name="LayoutRoot" >
        <Grid.Background>
            <ImageBrush ImageSource="/MyAppName;component/images/SinglePageBackground.png" 
                        Stretch="Fill"  />
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,10">
            <TextBlock x:Name="ApplicationTitle" Text="My App Title" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="My Page Title" 
                       Margin="9,5,0,0" Foreground="White" FontWeight="Bold" 
                       FontSize="35" TextAlignment="Left" />
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" Height="Auto">
            <ListBox x:Name="lbItemsList"  >
                <ListBox.Background>
                    <ImageBrush ImageSource="/PersonalMedsTraker;component/images/MedItemsBackground.png" 
                                        Stretch="Fill" Opacity=".65" />
                </ListBox.Background>
  ***** Lots of stack panels in here *******
                   </ListBox>
            <TextBlock x:Name="tbID" Visibility="Collapsed" />
        </Grid>

        <telerikPrimitives:RadWindow x:Name="rwHelpInfo" IsFullScreen="True" IsOpen="False" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition  Height="670"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>


                <ScrollViewer Grid.Row="0">
                    <Grid >
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>


                        <TextBlock Text="Help Page"  Margin="0,10,0,5" FontSize="27" Grid.Row="0"/>
                        <TextBlock  TextWrapping="Wrap" Margin="0,5,0,0" Grid.Row="1" FontSize="25">
                        ......
                        </TextBlock>
                    </Grid>
                </ScrollViewer>

                <Button x:Name="btClose"  Content="Close" Grid.Row="1"  HorizontalAlignment="Center"  
                                Click="btClose_Click"  Width="175" Margin="0,15,0,0"   />
            </Grid>

      </Grid>

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 25 May 2011, 03:15 PM
Hello John,

 Thank you for writing.

This behavior is indeed strange however, this XAML alone is not enough to diagnose the real cause.

I think you'd be interested to know that RadWindow uses a hack to improve its performance when it is in full screen mode. When IsFullScreen is true, RadWindow waits for its OpenAnimation to finish and then sets the Opacity property of all its siblings to 0. This usually decreases the fill rate by a huge amount and therefore provides a performance improvement. You can also simulate the IsFullScreen property by setting the PlacementTarget property of RadWindow to the layout root panel (or even the page) and then set the WindowSizeMode property to FitToPlacementTarget. This will avoid the opacity hack.

I hope the information below might give you a hint how to find the cause of the issue. If you still need assistance, please provide a small sample application that demonstrates the strange behavior so that I may assist you further.

Kind regards,
Victor
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Window
Asked by
John
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or