Fix analyze button being enabled with error (#1061)

This commit is contained in:
Pepe Rivera 2020-03-11 09:41:37 -07:00 committed by GitHub
parent d11873caf6
commit 2caea01c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -74,7 +74,7 @@ void EquationTextBox::OnApplyTemplate()
if (m_richEditContextMenu != nullptr) if (m_richEditContextMenu != nullptr)
{ {
m_richEditContextMenu->Opening += ref new EventHandler<Platform::Object ^>(this, &EquationTextBox::OnRichEditMenuOpening); m_richEditContextMenu->Opened += ref new EventHandler<Platform::Object ^>(this, &EquationTextBox::OnRichEditMenuOpened);
} }
if (m_deleteButton != nullptr) if (m_deleteButton != nullptr)
@ -344,11 +344,11 @@ bool EquationTextBox::RichEditHasContent()
return !text->IsEmpty(); return !text->IsEmpty();
} }
void EquationTextBox::OnRichEditMenuOpening(Object ^ /*sender*/, Object ^ /*args*/) void EquationTextBox::OnRichEditMenuOpened(Object ^ /*sender*/, Object ^ /*args*/)
{ {
if (m_kgfEquationMenuItem != nullptr) if (m_kgfEquationMenuItem != nullptr)
{ {
m_kgfEquationMenuItem->IsEnabled = m_HasFocus && RichEditHasContent(); m_kgfEquationMenuItem->IsEnabled = m_HasFocus && !HasError && RichEditHasContent();
} }
if (m_colorChooserMenuItem != nullptr) if (m_colorChooserMenuItem != nullptr)

View File

@ -58,7 +58,7 @@ namespace CalculatorApp
void OnRemoveButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void OnRemoveButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnColorChooserButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void OnColorChooserButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnFunctionButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void OnFunctionButtonClicked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnRichEditMenuOpening(Platform::Object ^ sender, Platform::Object ^ args); void OnRichEditMenuOpened(Platform::Object ^ sender, Platform::Object ^ args);
void OnColorFlyoutOpened(Platform::Object ^ sender, Platform::Object ^ e); void OnColorFlyoutOpened(Platform::Object ^ sender, Platform::Object ^ e);
void OnColorFlyoutClosed(Platform::Object ^ sender, Platform::Object ^ e); void OnColorFlyoutClosed(Platform::Object ^ sender, Platform::Object ^ e);