none
windows 8.1 app full Screen api RRS feed

  • 问题

  • 请问有没有适用于通用8.1,应用程序窗口可以设置固定最大化显示或全屏显示的API,ApplicationViewWindowingMode::FullScreen这个通用8.1用不了
    2016年4月17日 5:37

答案

  • 您好,

    您说得这个API是在UWP中才可以用的,而在windows 8.1中是没有现成的API给你用的。

    你可以用反射技术去调用windows 10 的API.

    请参考我的代码:

    private void Button_Click(object sender, RoutedEventArgs e)
            {
                var view = ApplicationView.GetForCurrentView();
                var runtimemethods = view.GetType().GetRuntimeMethods();
                if (!view.IsFullScreen)
                {
                    var TryEnterFullscreenMode = runtimemethods.FirstOrDefault(x => x.Name == "TryEnterFullScreenMode");
                    TryEnterFullscreenMode?.Invoke(view, null);
                }
            }

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2016年4月18日 7:08
    版主