图标不会出现在ApplicationBar中

时间:2013-12-03 13:06:07

标签: c# windows-phone-8

图标不会出现在ApplicationBar中。

MainPage.xaml.cs中

// Конструктор
    public MainPage()
    {
        InitializeComponent();

        // Локализация ApplicationBar
        BuildLocalizedApplicationBar();
    }

    // ApplicationBar
    private void BuildLocalizedApplicationBar()
    {
        // Установка нового экземпляра ApplicationBar.
        ApplicationBar = new ApplicationBar();

        // Задаем опции
        ApplicationBar.Mode = ApplicationBarMode.Default;
        ApplicationBar.Opacity = 1.0;
        ApplicationBar.IsVisible = true;
        ApplicationBar.IsMenuEnabled = true;

        // Кнопка "Add"
        ApplicationBarIconButton Add = new ApplicationBarIconButton(new Uri("/Assets/AppBar/Add.png", UriKind.Relative));
        Add.Text = AppResources.AppBarAdd;
        ApplicationBar.Buttons.Add(Add);
        Add.Click += new EventHandler(Button_Add_Click);

        // Кнопка "Edit"
        ApplicationBarIconButton Edit = new ApplicationBarIconButton(new Uri("/Assets/AppBar/Edit.png", UriKind.Relative));
        Edit.Text = AppResources.AppBarEdit;
        ApplicationBar.Buttons.Add(Edit);
        Edit.Click += new EventHandler(Button_Edit_Click);

        // Кнопка "Delete"
        ApplicationBarIconButton Delete = new ApplicationBarIconButton(new Uri("/Assets/AppBar/Delete.png", UriKind.Relative));
        Delete.Text = AppResources.AppBarDelete;
        ApplicationBar.Buttons.Add(Delete);
        Delete.Click += new EventHandler(Button_Delete_Click);

        // Кнопка "Connect"
        ApplicationBarIconButton Connect = new ApplicationBarIconButton(new Uri("/Assets/AppBar/Connect.png", UriKind.Relative));
        Connect.Text = AppResources.AppBarConnect;
        ApplicationBar.Buttons.Add(Connect);
        Connect.Click += new EventHandler(Button_Connect_Click);

    }

文件夹/ Assets / AppBar /中的图标是标准图标,从大多数SDK中删除,尺寸为76x76,用于黑暗主题。

模拟器和手机上的问题。

0 个答案:

没有答案