mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 05:43:10 -07:00
Fix the focus when right-clicking CalculationResult's TextBlock (#698)
* Fixed issue with focus when right-clicking result * Using dynamic_cast in place of safe_cast
This commit is contained in:
parent
16e8e2d89e
commit
51c4845f88
1 changed files with 10 additions and 1 deletions
|
@ -377,7 +377,16 @@ void CalculationResult::OnTapped(TappedRoutedEventArgs ^ e)
|
||||||
|
|
||||||
void CalculationResult::OnRightTapped(RightTappedRoutedEventArgs ^ e)
|
void CalculationResult::OnRightTapped(RightTappedRoutedEventArgs ^ e)
|
||||||
{
|
{
|
||||||
|
auto requestedElement = e->OriginalSource;
|
||||||
|
|
||||||
|
if (requestedElement->Equals(dynamic_cast<Object ^>(m_textBlock)))
|
||||||
|
{
|
||||||
|
m_textBlock->Focus(::FocusState::Programmatic);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
this->Focus(::FocusState::Programmatic);
|
this->Focus(::FocusState::Programmatic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalculationResult::OnGotFocus(RoutedEventArgs ^ e)
|
void CalculationResult::OnGotFocus(RoutedEventArgs ^ e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue