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
@ -377,7 +377,16 @@ void CalculationResult::OnTapped(TappedRoutedEventArgs ^ e)
|
|||||||
|
|
||||||
void CalculationResult::OnRightTapped(RightTappedRoutedEventArgs ^ e)
|
void CalculationResult::OnRightTapped(RightTappedRoutedEventArgs ^ e)
|
||||||
{
|
{
|
||||||
this->Focus(::FocusState::Programmatic);
|
auto requestedElement = e->OriginalSource;
|
||||||
|
|
||||||
|
if (requestedElement->Equals(dynamic_cast<Object ^>(m_textBlock)))
|
||||||
|
{
|
||||||
|
m_textBlock->Focus(::FocusState::Programmatic);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->Focus(::FocusState::Programmatic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalculationResult::OnGotFocus(RoutedEventArgs ^ e)
|
void CalculationResult::OnGotFocus(RoutedEventArgs ^ e)
|
||||||
|
Loading…
Reference in New Issue
Block a user