mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-07 05:31:09 -07:00
Add variable editing (#581)
This commit is contained in:
parent
a418777f02
commit
46f11c7c72
12 changed files with 519 additions and 6 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
// Utility macros to make Models easier to write
|
||||
// generates a member variable called m_<n>
|
||||
|
||||
#define PROPERTY_R(t, n) \
|
||||
property t n \
|
||||
{ \
|
||||
|
@ -72,6 +73,25 @@ private:
|
|||
\
|
||||
public:
|
||||
|
||||
#define OBSERVABLE_PROPERTY_RW_ALWAYS_NOTIFY(t, n) \
|
||||
property t n \
|
||||
{ \
|
||||
t get() \
|
||||
{ \
|
||||
return m_##n; \
|
||||
} \
|
||||
void set(t value) \
|
||||
{ \
|
||||
m_##n = value; \
|
||||
RaisePropertyChanged(L#n); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
private: \
|
||||
t m_##n; \
|
||||
\
|
||||
public:
|
||||
|
||||
#define OBSERVABLE_PROPERTY_RW(t, n) \
|
||||
property t n \
|
||||
{ \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue