Context Flyout fix for Calculation results

This commit is contained in:
achmurali 2021-05-15 00:17:27 +05:30
commit 622772d76f
2 changed files with 7 additions and 0 deletions

View file

@ -127,6 +127,7 @@ void CalculationResult::OnApplyTemplate()
m_textBlock = dynamic_cast<TextBlock ^>(GetTemplateChild("NormalOutput")); m_textBlock = dynamic_cast<TextBlock ^>(GetTemplateChild("NormalOutput"));
if (m_textBlock) if (m_textBlock)
{ {
m_textBlock->ContextMenuOpening += ref new ContextMenuOpeningEventHandler(this, &CalculationResult::OnContextMenuOpening);
m_textBlock->Visibility = ::Visibility::Visible; m_textBlock->Visibility = ::Visibility::Visible;
m_textBlockSizeChangedToken = m_textBlock->SizeChanged += ref new SizeChangedEventHandler(this, &CalculationResult::OnTextBlockSizeChanged); m_textBlockSizeChangedToken = m_textBlock->SizeChanged += ref new SizeChangedEventHandler(this, &CalculationResult::OnTextBlockSizeChanged);
} }
@ -417,3 +418,8 @@ void CalculationResult::OnTextBlockSizeChanged(Object ^ /*sender*/, SizeChangedE
{ {
UpdateScrollButtons(); UpdateScrollButtons();
} }
void CalculationResult::OnContextMenuOpening(Platform::Object ^ sender, Windows::UI::Xaml::Controls::ContextMenuEventArgs ^ e)
{
e->Handled = true;
}

View file

@ -59,6 +59,7 @@ namespace CalculatorApp
void OnPointerEntered(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e); void OnPointerEntered(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
void OnPointerExited(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e); void OnPointerExited(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
void ModifyFontAndMargin(Windows::UI::Xaml::Controls::TextBlock ^ textBlock, double fontChange); void ModifyFontAndMargin(Windows::UI::Xaml::Controls::TextBlock ^ textBlock, double fontChange);
void OnContextMenuOpening(Platform::Object ^ sender, Windows::UI::Xaml::Controls::ContextMenuEventArgs ^ e);
void UpdateScrollButtons(); void UpdateScrollButtons();
void ScrollLeft(); void ScrollLeft();
void ScrollRight(); void ScrollRight();