我正在開發一個具有全景頁面的Windows Phone 7.1應用程序。我第一次導航到全景圖頁面時太長,無法加載
此全景圖頁面有兩個全景項目,一個帶有兩個文本塊,另一個帶有bing地圖控件。我還設置了一個1.5MB的圖像作爲全景控制背景。
這是全景的XAML:
<phone:PhoneApplicationPage
x:Class="XxXClass.DemoDetail"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="False" Foreground="{x:Null}" xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps">
<toolkit:TransitionService.NavigationInTransition>
<toolkit:NavigationInTransition>
<toolkit:NavigationInTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardIn"/>
</toolkit:NavigationInTransition.Backward>
<toolkit:NavigationInTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardIn"/>
</toolkit:NavigationInTransition.Forward>
</toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
<toolkit:TransitionService.NavigationOutTransition>
<toolkit:NavigationOutTransition>
<toolkit:NavigationOutTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardOut"/>
</toolkit:NavigationOutTransition.Backward>
<toolkit:NavigationOutTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardOut"/>
</toolkit:NavigationOutTransition.Forward>
</toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>
<!--LayoutRoot contains the root grid where all other page content is placed-->
<Grid x:Name="LayoutRoot">
<controls:Panorama Title="Demonstation Tracker">
<controls:Panorama.Background>
<ImageBrush Stretch="Fill" ImageSource="/Images/demonstrationPanorama.png"/>
</controls:Panorama.Background>
<!--Panorama item one-->
<controls:PanoramaItem Header="Details">
<Grid Background="#73000000" Margin="0,0,0,26">
<TextBlock Height="42" Margin="8,8,174,0" TextWrapping="Wrap" Text="XXXX" VerticalAlignment="Top" FontSize="{StaticResource PhoneFontSizeLarge}"/>
<TextBlock Margin="8,54,8,8" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center" Height="413" Width="381" FontSize="{StaticResource PhoneFontSizeMedium}"><Run Text="xxx."/><Run Text=".."/></TextBlock>
</Grid>
</controls:PanoramaItem>
<!--Panorama item two-->
<controls:PanoramaItem Header="Map">
<Grid>
<my:Map Name="map1" Margin="0,0,0,26" Height="420" Width="420" />
</Grid>
</controls:PanoramaItem>
</controls:Panorama>
</Grid>
<!--Panorama-based applications should not show an ApplicationBar-->
</phone:PhoneApplicationPage>
我第一次瀏覽到全景頁我得太久顯示,如果我輕觸後退按鈕,我回來了,它更快速加載。
我怎樣才能使全景圖的頁面加載速度更快?
感謝您的回答。是363Kb,全景頁面需要兩到三秒才能加載,如果我評論地圖控制,它的加載速度會更快 – VansFannel
使地圖默認爲visibility.collapsed,然後在後臺線程中獲取數據put visibility = visible。使用BeginInvoke。Ore U可以爲Pageloaded事件初始化地圖 – Vovich
Pageloaded事件不會在Windows Phone上退出 – VansFannel