私の質問は、パノラマアイテムのLayoutUpdatedイベントを示しています。 LayoutUpdatedイベントをどのアイテムに割り当てるかは関係ありません。アイテムをスクロールすると起動しません。ここに私のコードは次のとおりです。私のC#クラスでレイアウトが更新されたときにLayoutUpdatedイベントが発生しないのはなぜですか? WP7
<controls:Panorama Grid.Row="2" x:Name="WebScrollView" >
<!--Panorama item one-->
<controls:PanoramaItem Width="480" x:Name="LeftPanoramaControl"/>
<!--Panorama item two-->
<controls:PanoramaItem Width="480" x:Name="MiddlePanoramaControl"/>
<controls:PanoramaItem Width="480" x:Name="RightPanoramaControl"/>
</controls:Panorama>
、私は言う:
private void BrowsersLoaded()
{
//first, we stop the progressbar
AnimatedProgressBar.StopProgressBar();
//next, we want to make sure that the left and right browser are going to load new content, as now, for instance, the left browser is placed upon the middlecontent
//so, we cannot just say _leftBrowser.Navigate, this will screw up the view
LeftPanoramaControl.Visibility = _leftControlVisibility;
RightPanoramaControl.Visibility = _rightControlVisibility;
WebScrollView.UpdateLayout();
WebScrollView.DefaultItem = MiddlePanoramaControl;
//this seems like beating around the bush, doesm't it?
//well, A problem I encountered was that the LayoutUpdated event was called even before I could do anything, check whatever boolean, cause they were all
//set to true even before the event was fired, which called upon the CheckID method, and gave a huge infinite loop.
MiddlePanoramaControl.LayoutUpdated += new EventHandler(WebScrollView_LayoutUpdated);
}
しかし、私はパノラマ項目をスクロールするときには発生しません。 誰にも理由がありますか? MSDNから
greetz、Geekpeek