Optimize BitFlipPanel to suppress flicker when users switch between bit lengths (#640)
* Optimize BitFlipPanel * remove namespace in cpp file * improve localization + add tests * add helper to compare ivector * Modify how the control manages AutomationProperties::Name
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "Common/CalculatorButtonUser.h"
|
||||
#include "HistoryViewModel.h"
|
||||
#include "MemoryItemViewModel.h"
|
||||
#include "Common/BitLength.h"
|
||||
|
||||
namespace CalculatorFunctionalTests
|
||||
{
|
||||
@@ -40,7 +41,6 @@ namespace CalculatorApp
|
||||
StandardCalculatorViewModel();
|
||||
void UpdateOperand(int pos, Platform::String ^ text);
|
||||
void UpdatecommandsInRecordingMode();
|
||||
int GetBitLengthType();
|
||||
int GetNumberBase();
|
||||
|
||||
OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged);
|
||||
@@ -54,6 +54,7 @@ namespace CalculatorApp
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, HexDisplayValue);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, OctalDisplayValue);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(Platform::String ^, BinaryDisplayValue);
|
||||
OBSERVABLE_NAMED_PROPERTY_R(Windows::Foundation::Collections::IVector<bool> ^, BinaryDigits);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, HexDisplayValue_AutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, DecDisplayValue_AutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, OctDisplayValue_AutomationName);
|
||||
@@ -72,10 +73,6 @@ namespace CalculatorApp
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, CalculationResultAutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, CalculationExpressionAutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsShiftProgrammerChecked);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsQwordEnabled);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsDwordEnabled);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsWordEnabled);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsByteEnabled);
|
||||
OBSERVABLE_PROPERTY_RW(int, CurrentRadixType);
|
||||
OBSERVABLE_PROPERTY_RW(bool, AreTokensUpdated);
|
||||
OBSERVABLE_PROPERTY_RW(bool, AreAlwaysOnTopResultsUpdated);
|
||||
@@ -128,6 +125,13 @@ namespace CalculatorApp
|
||||
}
|
||||
}
|
||||
}
|
||||
static property Platform::String ^ IsBitFlipCheckedPropertyName
|
||||
{
|
||||
Platform::String ^ get()
|
||||
{
|
||||
return Platform::StringReference(L"IsBitFlipChecked");
|
||||
}
|
||||
}
|
||||
|
||||
property bool IsBinaryBitFlippingEnabled
|
||||
{
|
||||
@@ -145,6 +149,15 @@ namespace CalculatorApp
|
||||
}
|
||||
}
|
||||
|
||||
property CalculatorApp::Common::BitLength ValueBitLength
|
||||
{
|
||||
CalculatorApp::Common::BitLength get()
|
||||
{
|
||||
return m_valueBitLength;
|
||||
}
|
||||
void set(CalculatorApp::Common::BitLength value);
|
||||
}
|
||||
|
||||
property bool IsStandard
|
||||
{
|
||||
bool get()
|
||||
@@ -213,6 +226,13 @@ namespace CalculatorApp
|
||||
}
|
||||
}
|
||||
}
|
||||
static property Platform::String ^ IsProgrammerPropertyName
|
||||
{
|
||||
Platform::String ^ get()
|
||||
{
|
||||
return Platform::StringReference(L"IsProgrammer");
|
||||
}
|
||||
}
|
||||
|
||||
property bool IsAlwaysOnTop
|
||||
{
|
||||
@@ -433,6 +453,7 @@ namespace CalculatorApp
|
||||
bool m_operandUpdated;
|
||||
bool m_completeTextSelection;
|
||||
bool m_isLastOperationHistoryLoad;
|
||||
CalculatorApp::Common::BitLength m_valueBitLength;
|
||||
Platform::String ^ m_selectedExpressionLastData;
|
||||
Common::DisplayExpressionToken ^ m_selectedExpressionToken;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user