how to use panorama item selectionchanged

前端 未结 6 1779
情书的邮戳
情书的邮戳 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:43

    The way I'd do it is to name the panorama, then you can refer to its selectedIndex property to determine which panorama item is selected. I believe that would be more efficient than dealing with strings that are in the headers.

        ...
    
        private void PanoramaItemSelectionChanged(object sender, SelectionChangedEventArgs e)    
     { switch (x.SelectedIndex) ... }
    

    I would also add though, that it is not a best practice to use the application bar in a panorama, in fact it is recommended that you not do so, but whether you do or not is really up to you.

提交回复
热议问题