how to use panorama item selectionchanged

前端 未结 6 1781
情书的邮戳
情书的邮戳 2021-01-28 03:16

I am attempting to detect the current panorama item that a user is currently on and then toggle an application bar icon button isenabled property accordingly. I have not had any

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-28 03:33

    You can also simply use index numbers for triggering different actions. As panorama pages are not designed for using with big numbers of PanoramaItems. It may not be a problem.

    Xaml

    
    
        
        
    
        
        
    
        
        
    
    
    

    I assume you are working with a ApplicationBar visibility

    Code

    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;
        }
    }
    

提交回复
热议问题