Fixes #202 This PR fixes code style for the project files. The Problem Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project. Description of the changes: Have investigated and determined the most used code style across the given codebase Have configured IDE and applied code style to all project files. Have crafted clang-formatter config. see https://clang.llvm.org/docs/ClangFormat.html https://clang.llvm.org/docs/ClangFormatStyleOptions.html Some cases were fixed manually How changes were validated: manual/ad-hoc testing, automated testing All tests pass as before because these are only code style changes. Additional Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
47 lines
1.8 KiB
C++
47 lines
1.8 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include "DesignStandardCalculatorViewModel.h"
|
|
#include "DesignUnitConverterViewModel.h"
|
|
|
|
namespace Numbers
|
|
{
|
|
namespace DesignData
|
|
{
|
|
#ifdef _DEBUG
|
|
// These class are to be consumed exclusively by Blend and the VS designer
|
|
// with these classes Blend will be able to populate the controls
|
|
// with the hardcoded strings so whoever is working on the UI can actually see how the app would look like
|
|
// with semi-realistic data.
|
|
// This data is to only be compiled in the debug build and it will not affect app functionality at all
|
|
// so it does not need to be tested. It will have to be kept in sync with UnitConverterViewModel though
|
|
// to ensure that the design experience is correct.
|
|
// This class's code is run in the designer process so the less code it has the better.
|
|
|
|
public
|
|
ref class AppViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
|
{
|
|
public:
|
|
AppViewModel()
|
|
: m_IsStandardMode(true)
|
|
, m_IsScientificMode(false)
|
|
, m_IsConverterMode(false)
|
|
, m_CalculatorViewModel(ref new StandardCalculatorViewModel())
|
|
, m_ConverterViewModel(ref new UnitConverterViewModel())
|
|
{
|
|
}
|
|
|
|
OBSERVABLE_OBJECT();
|
|
|
|
OBSERVABLE_PROPERTY_RW(StandardCalculatorViewModel ^, CalculatorViewModel);
|
|
OBSERVABLE_PROPERTY_RW(UnitConverterViewModel ^, ConverterViewModel);
|
|
OBSERVABLE_PROPERTY_RW(bool, IsStandardMode);
|
|
OBSERVABLE_PROPERTY_RW(bool, IsScientificMode);
|
|
OBSERVABLE_PROPERTY_RW(bool, IsConverterMode);
|
|
};
|
|
#endif
|
|
}
|
|
}
|