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:
		
				
					committed by
					
						
						Pepe Rivera
					
				
			
			
				
	
			
			
			
						parent
						
							16e8e2d89e
						
					
				
				
					commit
					51c4845f88
				
			@@ -376,9 +376,18 @@ void CalculationResult::OnTapped(TappedRoutedEventArgs ^ 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);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CalculationResult::OnGotFocus(RoutedEventArgs ^ e)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user