How can i add AppBar in Windows Phone 8.1

后端 未结 3 1579
不思量自难忘°
不思量自难忘° 2021-02-19 05:21

In windows phone 8, its very easy to add an App Bar and manage it, but now i test new windows phone 8.1 SDK to build a project with new Geofencing feature but i don\'t know how

3条回答
  •  逝去的感伤
    2021-02-19 05:51

    Create Class with Method

    public static void AddNewAppBarinPage(Page myPage)
    {
       CommandBar cbar = new CommandBar { ClosedDisplayMode = AppBarClosedDisplayMode.Minimal };
       AppBarButton appBarButton = new AppBarButton { Label = "Audio" };
       cbar.PrimaryCommands.Add(appBarButton);
       myPage.BottomAppBar = cbar;
    }
    

    use in Page:

    AppBarCustom.AddNewAppBarinPage(this);
    

提交回复
热议问题