Tag: 应用程序栏

以编程方式更改appbar图标

在我的C#Windows Phone 8应用程序中,我有一个AppBar。 我在这个AppBar上有两个图标,一个新图标和一个编辑图标。 我想在按下时将编辑图标更改为后退图标,然后再次按下时再返回编辑图标。 我试过这段代码,但是我得到一个nullReferenceException: public static Uri addIcon = new Uri(“/Assets/AppBar/new.png”, UriKind.Relative); public static Uri backIcon = new Uri(“/Assets/AppBar/back.png”, UriKind.Relative); //Edit the projects if (editMode.Equals(false)) { //EditMode is off, enable edit mode and modify the editprojectMenuButton editMode = true; editprojectMenuButton.IconUri = backIcon; editprojectMenuButton.Text = “finish”; } else { //EditMode is on, disable edit […]