【问题标题】:Is there an event listener for the Devices charms button click?设备魅力按钮单击是否有事件侦听器?
【发布时间】:2013-01-14 18:20:40
【问题描述】:

我正在开发一个 Windows 8 Metro 应用程序,并想知道是否有任何方法可以监听被选中的设备魅力栏按钮?我正在尝试想出一种创建打印页面数据的好方法,而不必在每次更改页面上的内容时都这样做。

我现在正在设置共享合同事件侦听器,并注意到当您单击共享超级按钮时会触发一个 DataRequested 事件。

DataTransferManager.GetForCurrentView().DataRequested += MainPage_DataRequested;

我可以为设备魅力栏按钮单击实现类似的功能吗?

【问题讨论】:

    标签: c# windows-8 microsoft-metro windows-store-apps


    【解决方案1】:

    查看http://www.jeffblankenburg.com/2012/11/20/31-days-of-windows-8-day-20-printing/ 以获取 C# 中的打印代码示例。您将需要这样的代码:

    PrintManager manager = PrintManager.GetForCurrentView();
    manager.PrintTaskRequested += manager_PrintTaskRequested;
    

    当然还有“manager_PrintTaskRequested”事件处理程序的实现。有关完整的详细信息,请参阅文章。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-30
      • 2015-07-31
      • 1970-01-01
      • 2018-08-05
      • 1970-01-01
      • 2018-05-12
      • 2011-08-06
      相关资源
      最近更新 更多