calculator/src/Calculator/Views/Memory.xaml.h
Rudy Huyn 23550f751c Make History and Memory list items context menu accessible using keyboard (#432)
* Move History and Memory context menus to ListViewItemContainer so users can open them with keyboards

* replace static_cast by dynamic_cast
2019-07-16 14:24:27 -07:00

51 lines
1.7 KiB
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Memory.xaml.h
// Declaration of the Memory class
//
#pragma once
#include "Views/Memory.g.h"
#include "Converters/BooleanNegationConverter.h"
#include "Converters/VisibilityNegationConverter.h"
#include "CalcViewModel/StandardCalculatorViewModel.h"
namespace CalculatorApp
{
[Windows::Foundation::Metadata::WebHostHidden] public ref class Memory sealed
{
public:
Memory();
property CalculatorApp::ViewModel::StandardCalculatorViewModel^ Model
{
CalculatorApp::ViewModel::StandardCalculatorViewModel^ get() {
return static_cast<CalculatorApp::ViewModel::StandardCalculatorViewModel^>(this->DataContext);
}
}
DEPENDENCY_PROPERTY_OWNER(Memory);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::GridLength, RowHeight);
property bool IsErrorVisualState
{
bool get();
void set(bool value);
}
private:
Windows::Foundation::Rect m_visibleBounds;
Windows::Foundation::Rect m_coreBounds;
bool m_isErrorVisualState;
void MemoryListItemClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Controls::ItemClickEventArgs ^ e);
void OnClearMenuItemClicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void OnMemoryAddMenuItemClicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void OnMemorySubtractMenuItemClicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
CalculatorApp::ViewModel::MemoryItemViewModel ^ GetMemoryItemForCurrentFlyout();
};
}