ApplicationBarIconButton is null

前端 未结 5 770
一个人的身影
一个人的身影 2021-02-07 02:32

Why is my ApplicationBarIconButton null?


    

        
5条回答
  •  庸人自扰
    2021-02-07 03:15

    I made this mistake today, the x:Name is ignored.

    The ApplicationBar is part of the page already, whether you create it in XAML or not. There is no need to create a new one. Just use the ApplicationBar property in the code behind file.

    Initialize Component();
    ApplicationBar.IsEnabled = true;
    

提交回复
热议问题