【发布时间】:2015-04-15 23:35:44
【问题描述】:
我刚刚开始学习 C# 和 WP 平台,我发现做一些简单的事情真的很难,比如更改按钮图标等。
我在 XAML 中创建了一个命令栏和一个 AppBarButton。
<Page.BottomAppBar>
<CommandBar MinHeight="60">
<AppBarButton x:Name="Command_BarButton" Icon="AllApps"
Label="Seletie"
Click="AppBar_Select"/>
</CommandBar>
</Page.BottomAppBar>
我想在 C# 中以编程方式将 AppBarButton 图标更改为另一个现有图标,例如垃圾箱图标。我该怎么做?
Command_BarButton.Label = "Delete";
Command_BarButton.Icon = ?
【问题讨论】:
-
看看this answer,也许会有帮助。
标签: c# windows-phone-8.1 appbar commandbar