From 123de14d4398f27977e62a7f3ede2fa3574f30fa Mon Sep 17 00:00:00 2001 From: Han Zhang Date: Mon, 15 Aug 2022 10:57:13 +0800 Subject: [PATCH] Check whether graphing API is supported --- src/CalcViewModel/Common/NavCategory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CalcViewModel/Common/NavCategory.cpp b/src/CalcViewModel/Common/NavCategory.cpp index 829f7488..90307f7d 100644 --- a/src/CalcViewModel/Common/NavCategory.cpp +++ b/src/CalcViewModel/Common/NavCategory.cpp @@ -54,6 +54,12 @@ namespace // put the utils within this TU bool IsGraphingModeEnabled() { + static bool isGraphSupported = Windows::Foundation::Metadata::ApiInformation::IsMethodPresent("Windows.UI.Text.RichEditTextDocument", "GetMath"); + if (!isGraphSupported) + { + return false; + } + static bool isChecked = false; static bool isEnabled = false;