This commit is contained in:
Han Zhang 2022-06-11 00:17:12 +08:00
commit e4e431a13a
65 changed files with 74 additions and 422 deletions

View file

@ -6,8 +6,6 @@
// Declaration of the App class.
//
using CalculatorApp.ViewModel.Common;
using CalculatorApp.ViewModel.Common.Automation;
using System;
using System.Collections.Generic;
using System.Diagnostics;

View file

@ -2,8 +2,6 @@
// Licensed under the MIT License.
using System;
using CalculatorApp.ViewModel.Common;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Core;
using Windows.Foundation.Diagnostics;

View file

@ -1,14 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using Windows.Foundation.Collections;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@ -578,7 +574,7 @@ namespace CalculatorApp
private static bool CanNavigateModeByShortcut(MUXC.NavigationView navView, object nvi
, ApplicationViewModel vm, ViewMode toMode)
{
if(nvi != null && nvi is NavCategory navCategory)
if (nvi != null && nvi is NavCategory navCategory)
{
return navCategory.IsEnabled
&& navView.Visibility == Visibility.Visible

View file

@ -2,26 +2,11 @@
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Controls;
using CalculatorApp.ViewModel.Common;
using Windows.Devices.Input;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using System.Reflection;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
namespace CalculatorApp
{

View file

@ -1,10 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation.Peers;

View file

@ -1,19 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Controls;
using CalculatorApp.ViewModel.Common;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Data;
using Windows.Foundation.Collections;
using Windows.Storage.Pickers;
using Windows.UI.Xaml.Input;
namespace CalculatorApp
{

View file

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel.Common;
using System;
using Windows.UI.Text;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel.Common;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;

View file

@ -3,12 +3,12 @@
using System;
using System.Runtime.InteropServices;
using Windows.ApplicationModel;
using Windows.System;
using Windows.UI.Core;
using Windows.UI.Text;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
using Windows.ApplicationModel;
namespace CalculatorApp
{
@ -86,14 +86,14 @@ namespace CalculatorApp
{
string packageName = Package.Current.Id.Name;
if(packageName == "Microsoft.WindowsCalculator.Dev")
if (packageName == "Microsoft.WindowsCalculator.Dev")
{
LimitedAccessFeatures.TryUnlockFeature(
"com.microsoft.windows.richeditmath",
"BeDD/jxKhz/yfVNA11t4uA==", // Microsoft.WindowsCalculator.Dev
"8wekyb3d8bbwe has registered their use of com.microsoft.windows.richeditmath with Microsoft and agrees to the terms of use.");
}
else if(packageName == "Microsoft.WindowsCalculator")
else if (packageName == "Microsoft.WindowsCalculator")
{
LimitedAccessFeatures.TryUnlockFeature(
"com.microsoft.windows.richeditmath",

View file

@ -1,19 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using Windows.Foundation;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using CalculatorApp;
using CalculatorApp.Common;
using CalculatorApp.Controls;
namespace CalculatorApp
{

View file

@ -1,18 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Controls;
using Windows.Foundation;
using Windows.Devices.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
namespace CalculatorApp
{

View file

@ -1,27 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Common;
using CalculatorApp.Controls;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Devices.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.ApplicationModel.Store;
namespace CalculatorApp
{

View file

@ -1,12 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using Windows.UI.Xaml.Automation.Peers;
using Windows.Foundation.Collections;
namespace CalculatorApp
{

View file

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel.Common;
namespace CalculatorApp
{
namespace Controls

View file

@ -1,22 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Controls;
using CalculatorApp.ViewModel;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.Foundation.Collections;
using Windows.UI.Xaml.Controls;
namespace CalculatorApp
{

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel.Common;
using System;
using Windows.UI.Xaml;

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel.Common;
using System;
namespace CalculatorApp

View file

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View file

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel;
using Windows.UI.Xaml;
namespace CalculatorApp

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel.Common;
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

View file

@ -2,7 +2,6 @@
// Licensed under the MIT License.
using System;
using CalculatorApp.ViewModel.Common;
namespace CalculatorApp.Utils
{
@ -15,7 +14,7 @@ namespace CalculatorApp.Utils
return new DelegateCommand(param =>
{
TTarget thatTarget = weakTarget.Target as TTarget;
if(null != thatTarget)
if (null != thatTarget)
{
handler.Invoke(thatTarget, param);
}

View file

@ -4,8 +4,6 @@
using System;
using System.Reflection;
using Windows.Storage;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@ -72,12 +70,12 @@ namespace CalculatorApp.Utils
{
Frame rootFrame = Window.Current.Content as Frame;
long token = rootFrame.RegisterPropertyChangedCallback(Frame.RequestedThemeProperty, callback);
return new ThemeChangedCallbackToken{ RootFrame = new WeakReference(rootFrame), Token = token };
return new ThemeChangedCallbackToken { RootFrame = new WeakReference(rootFrame), Token = token };
}
public static void UnregisterAppThemeChangedCallback(ThemeChangedCallbackToken callbackToken)
{
if(callbackToken.RootFrame.IsAlive)
if (callbackToken.RootFrame.IsAlive)
{
Frame rootFrame = callbackToken.RootFrame.Target as Frame;
rootFrame.UnregisterPropertyChangedCallback(Frame.RequestedThemeProperty, callbackToken.Token);

View file

@ -1,33 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Converters;
using CalculatorApp.Controls;
using CalculatorApp.Utils;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using System;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Globalization.NumberFormatting;
using Windows.System;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.System.Threading;
using Windows.UI.ViewManagement;
namespace CalculatorApp
{
@ -247,7 +231,8 @@ namespace CalculatorApp
// Delay load things later when we get a chance.
WeakReference weakThis = new WeakReference(this);
_ = this.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal, new DispatchedHandler(() => {
CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
{
if (TraceLogger.GetInstance().IsWindowIdInLog(ApplicationView.GetApplicationViewIdForWindow(CoreWindow.GetForCurrentThread())))
{
var refThis = weakThis.Target as Calculator;

View file

@ -8,20 +8,10 @@
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Controls;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using System.Diagnostics;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
namespace CalculatorApp

View file

@ -1,9 +1,8 @@
using CalculatorApp.ViewModel.Common;
using CalculatorApp.Utils;
using System.Diagnostics;
using System.Windows.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using CalculatorApp.Utils;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236

View file

@ -1,29 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Controls;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using Windows.Devices.Input;
using Windows.Foundation;
using Windows.Foundation.Collections;
using System.Diagnostics;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.ViewManagement;
using Windows.UI.Core;
namespace CalculatorApp
{

View file

@ -1,21 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using CalculatorApp.Common;
using Windows.UI.Xaml.Media;
namespace CalculatorApp
{
@ -39,7 +26,7 @@ namespace CalculatorApp
get => m_isErrorVisualState;
set
{
if(m_isErrorVisualState != value)
if (m_isErrorVisualState != value)
{
m_isErrorVisualState = value;
string newState = m_isErrorVisualState ? "ErrorLayout" : "NoErrorLayout";

View file

@ -6,26 +6,8 @@
// Declaration of the CalculatorScientificAngleButtons class
//
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Utils;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.UI.ViewManagement;
using Windows.UI.Core;
namespace CalculatorApp
{
@ -50,7 +32,7 @@ namespace CalculatorApp
if (donotuse_ButtonPressed == null)
{
donotuse_ButtonPressed = DelegateCommandUtils.MakeDelegateCommand(this,
(that, param)=>
(that, param) =>
{
that.OnAngleButtonPressed(param);
});
@ -65,7 +47,7 @@ namespace CalculatorApp
get => m_isErrorVisualState;
set
{
if(m_isErrorVisualState != value)
if (m_isErrorVisualState != value)
{
m_isErrorVisualState = value;
string newState = m_isErrorVisualState ? "ErrorFlyout" : "NoErrorFlyout";

View file

@ -6,26 +6,8 @@
// Declaration of the CalculatorScientificOperators class
//
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Common;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace CalculatorApp
{

View file

@ -6,21 +6,7 @@
// Declaration of the CalculatorStandardOperators class
//
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace CalculatorApp
{

View file

@ -9,29 +9,12 @@
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Globalization;
using Windows.Globalization.DateTimeFormatting;
using Windows.System.UserProfile;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace CalculatorApp
{

View file

@ -1,29 +1,20 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Calculator.Utils;
using CalculatorApp.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Common;
using CalculatorApp.ViewModel.Common;
using CalculatorApp.ViewModel.Common.Automation;
using GraphControl;
using CalculatorApp.ViewModel;
using CalculatorApp.Controls;
using Windows.Foundation;
using Windows.System;
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Input;
using Calculator.Utils;
using Windows.UI.Xaml.Media;
namespace CalculatorApp
{
@ -355,13 +346,14 @@ namespace CalculatorApp
{
WeakReference weakThis = new WeakReference(this);
_ = this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() => {
var refThis = weakThis.Target as EquationInputArea;
if (refThis != null && refThis.m_isHighContrast == refThis.m_accessibilitySettings.HighContrast)
{
refThis.ReloadAvailableColors(false, false);
}
}));
_ = this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
{
var refThis = weakThis.Target as EquationInputArea;
if (refThis != null && refThis.m_isHighContrast == refThis.m_accessibilitySettings.HighContrast)
{
refThis.ReloadAvailableColors(false, false);
}
}));
}
private void EquationTextBox_RemoveButtonClicked(object sender, RoutedEventArgs e)
@ -594,7 +586,8 @@ namespace CalculatorApp
{
TimeSpan timeSpan = new TimeSpan(10000000); // 1 tick = 100 nanoseconds, and 10000000 ticks = 1 second.
DispatcherTimerDelayer delayer = new DispatcherTimerDelayer(timeSpan);
delayer.Action += new EventHandler<object>((object s, object arg) => {
delayer.Action += new EventHandler<object>((object s, object arg) =>
{
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogVariableChanged("Slider", name);
variableSliders.Remove(name);
});

View file

@ -1,8 +1,4 @@
using CalculatorApp.ViewModel.Common;
using GraphControl;
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

View file

@ -1,38 +1,23 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.Common;
using CalculatorApp.ViewModel.Common;
using CalculatorApp.ViewModel.Common.Automation;
using CalculatorApp.Controls;
using CalculatorApp.Utils;
using CalculatorApp.ViewModel;
using GraphControl;
using System;
using Windows.ApplicationModel.DataTransfer;
using Windows.ApplicationModel.Resources;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.System;
using Windows.UI.Core;
using Windows.UI.Input;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Popups;
namespace CalculatorApp
{
@ -755,7 +740,8 @@ namespace CalculatorApp
private void OnColorValuesChanged(UISettings sender, object args)
{
WeakReference weakThis = new WeakReference(this);
_ = this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() => {
_ = this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
{
GraphingCalculator refThis = weakThis.Target as GraphingCalculator;
if (refThis != null && IsMatchAppTheme)
{

View file

@ -3,20 +3,10 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.ViewModel.Common;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace CalculatorApp
{

View file

@ -3,28 +3,12 @@
// Declaration of the MyUserControl class
//
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
//using Graphing;
using GraphControl;
using CalculatorApp;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace CalculatorApp
{

View file

@ -1,17 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Diagnostics;
using CalculatorApp;
using CalculatorApp.ViewModel;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using System.ComponentModel;
using Windows.UI.Xaml;
namespace CalculatorApp
{

View file

@ -1,6 +1,3 @@
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using MUXC = Microsoft.UI.Xaml.Controls;

View file

@ -1,8 +1,5 @@
using CalculatorApp.Common;
using CalculatorApp.Converters;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using CalculatorApp.ViewModel.Common.Automation;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -49,9 +46,9 @@ namespace CalculatorApp
m_model.PropertyChanged += OnAppPropertyChanged;
m_accessibilitySettings = new AccessibilitySettings();
if(Utilities.GetIntegratedDisplaySize(out var sizeInInches))
if (Utilities.GetIntegratedDisplaySize(out var sizeInInches))
{
if(sizeInInches < 7.0) // If device's display size (diagonal length) is less than 7 inches then keep the calc always in Portrait mode only
if (sizeInInches < 7.0) // If device's display size (diagonal length) is less than 7 inches then keep the calc always in Portrait mode only
{
DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait | DisplayOrientations.PortraitFlipped;
}
@ -150,7 +147,7 @@ namespace CalculatorApp
{
var graphCategory = (NavCategory)NavViewCategoriesSource.Find(x =>
{
if(x is NavCategory category)
if (x is NavCategory category)
{
return category.ViewMode == ViewMode.Graphing;
}
@ -166,10 +163,10 @@ namespace CalculatorApp
private List<object> ExpandNavViewCategoryGroups(IEnumerable<NavCategoryGroup> groups)
{
var result = new List<object>();
foreach(var group in groups)
foreach (var group in groups)
{
result.Add(group);
foreach(var category in group.Categories)
foreach (var category in group.Categories)
{
result.Add(category);
}
@ -179,7 +176,7 @@ namespace CalculatorApp
private void UpdatePopupSize(Windows.UI.Core.WindowSizeChangedEventArgs e)
{
if(PopupContent != null)
if (PopupContent != null)
{
PopupContent.Width = e.Size.Width;
PopupContent.Height = e.Size.Height;
@ -359,7 +356,7 @@ namespace CalculatorApp
private void OnNavSelectionChanged(object sender, MUXC.NavigationViewSelectionChangedEventArgs e)
{
if(e.IsSettingsSelected)
if (e.IsSettingsSelected)
{
ShowSettingsPopup();
return;

View file

@ -1,6 +1,3 @@
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

View file

@ -1,5 +1,4 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236

View file

@ -1,4 +1,3 @@
using CalculatorApp.ViewModel.Common;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

View file

@ -1,21 +1,14 @@
using CalculatorApp.Utils;
using CalculatorApp.ViewModel.Common;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using CalculatorApp.ViewModel.Common.Automation;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Automation.Provider;
using Windows.UI.Xaml.Controls;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236

View file

@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using Windows.Foundation;
using Windows.UI.Xaml;

View file

@ -1,5 +1,4 @@
using CalculatorApp.ViewModel;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Windows.UI.Xaml;

View file

@ -1,4 +1,3 @@
using CalculatorApp.ViewModel.Common;
using Windows.ApplicationModel.Core;
using Windows.System.Profile;
using Windows.UI.Core;
@ -89,7 +88,7 @@ namespace CalculatorApp
private void RootFrame_RequestedThemeChanged(DependencyObject sender, DependencyProperty dp)
{
if(Frame.RequestedThemeProperty == dp)
if (Frame.RequestedThemeProperty == dp)
{
_ = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() => { SetTitleBarControlColors(); }));
}
@ -280,7 +279,8 @@ namespace CalculatorApp
public static readonly DependencyProperty BackButtonSpaceReservedProperty =
DependencyProperty.Register(
nameof(BackButtonSpaceReserved), typeof(bool), typeof(TitleBar),
new PropertyMetadata(false, new PropertyChangedCallback((sender, args)=> {
new PropertyMetadata(false, new PropertyChangedCallback((sender, args) =>
{
var self = sender as TitleBar;
VisualStateManager.GoToState(
self, (bool)args.NewValue ? self.BackButtonVisible.Name : self.BackButtonCollapsed.Name, true);

View file

@ -1,7 +1,5 @@
using CalculatorApp.Common;
using CalculatorApp.Controls;
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using System;
using System.ComponentModel;
using System.Diagnostics;

View file

@ -2,7 +2,6 @@
// Licensed under the MIT License.
using CalculatorApp.Common;
using CalculatorApp.ViewModel.Common;
using System;
using System.Collections.Generic;
using System.Data;

View file

@ -3,7 +3,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Appium.Windows;
using System;
using OpenQA.Selenium.Interactions;
namespace CalculatorUITestFramework
{

View file

@ -2,9 +2,6 @@
// Licensed under the MIT License.
using OpenQA.Selenium.Appium;
using System;
using System.Collections.Generic;
using System.Text;
namespace CalculatorUITestFramework
{

View file

@ -2,11 +2,9 @@
// Licensed under the MIT License.
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using OpenQA.Selenium.Interactions;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Linq;

View file

@ -2,9 +2,6 @@
// Licensed under the MIT License.
using OpenQA.Selenium.Appium;
using System;
using System.Collections.Generic;
using System.Text;
namespace CalculatorUITestFramework
{

View file

@ -3,11 +3,9 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using OpenQA.Selenium.Interactions;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Linq;

View file

@ -44,7 +44,7 @@ namespace CalculatorUITestFramework
switch (mode)
{
case CalculatorMode.StandardCalculator:
modeAccessibilityId = "Standard";
modeAccessibilityId = "Standard";
break;
case CalculatorMode.ScientificCalculator:
modeAccessibilityId = "Scientific";

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Appium.Windows;
namespace CalculatorUITestFramework

View file

@ -3,11 +3,6 @@
using OpenQA.Selenium;
using OpenQA.Selenium.Appium.Windows;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices.ComTypes;
using System;
using System.Diagnostics;
namespace CalculatorUITestFramework
{
@ -192,7 +187,7 @@ namespace CalculatorUITestFramework
else
{
throw new NotFoundException("Could not find word size buttons in page source");
}
}
}
public void ResetNumberSystem()
{

View file

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Appium.Windows;
namespace CalculatorUITestFramework

View file

@ -3,11 +3,7 @@
using OpenQA.Selenium;
using OpenQA.Selenium.Appium.Windows;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices.ComTypes;
using System;
using System.Diagnostics;
namespace CalculatorUITestFramework
{
@ -112,25 +108,25 @@ namespace CalculatorUITestFramework
public void SetAngleOperator(AngleOperatorState value)
{
//set the desired string value for the button
string desiredId;
switch (value)
{
case AngleOperatorState.Degrees:
desiredId = "degButton";
break;
case AngleOperatorState.Gradians:
desiredId = "gradButton";
break;
case AngleOperatorState.Radians:
desiredId = "radButton";
break;
default:
throw new NotImplementedException();
}
while (this.DegRadGradButton.GetAttribute("AutomationId") != desiredId)
{
this.DegRadGradButton.Click();
}
string desiredId;
switch (value)
{
case AngleOperatorState.Degrees:
desiredId = "degButton";
break;
case AngleOperatorState.Gradians:
desiredId = "gradButton";
break;
case AngleOperatorState.Radians:
desiredId = "radButton";
break;
default:
throw new NotImplementedException();
}
while (this.DegRadGradButton.GetAttribute("AutomationId") != desiredId)
{
this.DegRadGradButton.Click();
}
}
public void ResetFEButton(FEButtonState value)

View file

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using OpenQA.Selenium.Appium.Windows;
using System;
using System.Collections.Generic;
using System.Text;
namespace CalculatorUITestFramework
{

View file

@ -1,9 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using OpenQA.Selenium.Appium.Windows;
using System;
using System.Collections.Generic;
using System.Text;
namespace CalculatorUITestFramework
{

View file

@ -2,8 +2,6 @@
// Licensed under the MIT License.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Appium.Windows;
using System;
using OpenQA.Selenium.Interactions;
using System.Text.RegularExpressions;
namespace CalculatorUITestFramework

View file

@ -5,7 +5,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using System;
using System.Diagnostics;
namespace CalculatorUITestFramework
{

View file

@ -4,7 +4,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting.Logging;
using OpenQA.Selenium.Appium.Windows;
using System;
using System.Diagnostics;
using System.Threading;

View file

@ -2,8 +2,6 @@
// Licensed under the MIT License.
using CalculatorUITestFramework;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using System;
namespace CalculatorUITests
{

View file

@ -3,10 +3,6 @@
using CalculatorUITestFramework;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium.Windows;
using System;
using System.Collections.Generic;
namespace CalculatorUITests
{