【问题标题】:Icon visibility in the bottom bar底部栏中的图标可见性
【发布时间】: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:成功了! :-)
  • 很高兴它有帮助。我也把它作为答案:)

标签: windows-phone-8.1


【解决方案1】:

您可以使用AppBarButton 的IsEnabled 属性来启用/禁用按钮。最初为两个按钮设置IsEnabled = false,然后在用户更改选择时修改IsEnabled。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-20
    • 2021-04-18
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 2012-03-07
    相关资源
    最近更新 更多