【发布时间】:2015-04-22 20:08:24
【问题描述】:
我正在尝试实现项目选择行为,以便当用户按下应用栏上的按钮时,列表视图选择模式从无变为多个。
ListView.SelectionMode = ListViewSelectionMode.Multiple;
底部栏将图标更改为接受或取消多个选定项目。
AppBar SelectionAppBar = new AppBar();
AppBarButton Acceptbutton = new AppBarButton { Label = "Accept", Icon = new SymbolIcon(Symbol.Accept) };
AppBarButton Cancelbutton = new AppBarButton { Label = "Cancel", Icon = new SymbolIcon(Symbol.Cancel) };
我希望底部栏图标在选择模式更改为多个时可见,但仅在用户实际选择列表中的任何项目时才更改颜色(或亮度)。目前,开启多选模式后,无论是否选中任何项目,图标的颜色都是相同的。
在这里感谢任何指针。
【问题讨论】:
-
你试过在各自的AppBarButtons中设置
IsEnabled=false吗?这应该可以解决问题。 -
@Abhishek:成功了! :-)
-
很高兴它有帮助。我也把它作为答案:)