[英]panorama SelectionChanged not always fired
I have a panorma control with three items. 我有一个包含三个项目的全景控件。 I want to show an application bar on one of the items and hide the application bar on others.
我想在其中一个项目上显示一个应用程序栏,而在其他项目上隐藏该应用程序栏。 Now the problem is : the one item on which I want to show the application bar SelectionChanged is not called.
现在的问题是:我要显示应用程序栏SelectionChanged的一项没有被调用。
Here is my function: 这是我的功能:
private void panormaItemChanged(object sender, SelectionChangedEventArgs e)
{
if (((Panorama)sender).SelectedIndex == 0)
{
ApplicationBar.IsVisible = true;
}
else {
ApplicationBar.IsVisible = false;
}
}
i think you have taken event of panormaItemChanged
instead of that take PanormaSelectionChanged
. 我认为您已经采取了
panormaItemChanged
事件,而不是采取PanormaSelectionChanged
。 It would work. 会的。
XAML: XAML:
<phone:Panorama Title="my application" SelectionChanged="Panorama_SelectionChanged">
cs: CS:
private void Panorama_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
switch (((Panorama)sender).SelectedIndex)
{
case 0: // defines the first PanoramaItem
ApplicationBar.IsVisible = true;
break;
case 1: // second one
ApplicationBar.IsVisible = false;
break;
case 2: // third one
ApplicationBar.IsVisible = true;
break;
}
}
I got the answer: 我得到了答案:
I had put my PanoramaItem in scrollview thats why it wasn't calling SelectionChanged listener!! 我把我的PanoramaItem放在了滚动视图中,这就是为什么它没有调用SelectionChanged监听器的原因!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.