SettingsCommand可以回调​​Windows应用程序吗?

编程入门 行业动态 更新时间:2024-10-23 03:28:25
本文介绍了SettingsCommand可以回调​​Windows应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的C#/ XAML Windows 8应用程序中有一个SettingsCommand。它完美地运作。但是,我提供的选项之一是允许用户重置应用程序中的所有数据。这也很有效。 但是,当用户打开设置魅力时正在查看的实际XAML页面需要刷新自己。有没有办法打电话给当前打开的页面?或者参考一下?或者将页面的引用传递给SettingsCommand? 甚至让页面识别出魅力栏已被打开?像聚焦/未聚焦一样。那种活动? 或者,是否可以从SettingsCommand UserControl导航到我的应用程序的特定页面?

I have a SettingsCommand in my C#/XAML Windows 8 app. It works perfectly. However, one of the options I provide is to allow the user to reset all of their data in the app. This also works perfectly. However, the actual XAML page that was being viewed when the user opened the settings charm needs to refresh itself. Is there a way to make a call to the page that is currently open? Or get a reference to it? Or pass a reference of the page to the SettingsCommand? Or even have the page recognize that the charms bar has been opened? Like a "focused"/"unfocused" kind of event? Or, would it be possible to just navigate to a specific page of my app FROM the SettingsCommand UserControl?

推荐答案

结果我只需要获得对Window.Current.Content的引用。 Turns out I just needed to get a reference to Window.Current.Content. Frame rootFrame = Window.Current.Content as Frame; rootFrame.Navigate(typeof(MainPage));

更多推荐

SettingsCommand可以回调​​Windows应用程序吗?

本文发布于:2023-11-02 17:37:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1552996.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:回调   应用程序   SettingsCommand   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!