Fix usability issues with settings flyout (#1049)
* various settings fixes * PR fixes
This commit is contained in:
@@ -471,7 +471,7 @@
|
||||
</Grid.Resources>
|
||||
<graphControl:Grapher Name="GraphingControl"
|
||||
Style="{ThemeResource ThemedGrapherStyle}"
|
||||
ForceProportionalAxes="True"
|
||||
ForceProportionalAxes="False"
|
||||
LosingFocus="GraphingControl_LosingFocus"
|
||||
LostFocus="GraphingControl_LostFocus"
|
||||
RequestedTheme="Light"
|
||||
|
@@ -581,7 +581,6 @@ void GraphingCalculator::OnSettingsFlyout_Closing(FlyoutBase ^ sender, FlyoutBas
|
||||
{
|
||||
auto flyout = static_cast<Flyout ^>(sender);
|
||||
auto graphingSetting = static_cast<GraphingSettings ^>(flyout->Content);
|
||||
args->Cancel = graphingSetting->CanBeClose();
|
||||
}
|
||||
|
||||
void GraphingCalculator::Canvas_SizeChanged(Object ^ /*sender*/, SizeChangedEventArgs ^ e)
|
||||
|
@@ -57,37 +57,6 @@ void GraphingSettings::GridSettingsTextBox_PreviewKeyDown(Platform::Object ^ sen
|
||||
}
|
||||
}
|
||||
|
||||
bool GraphingSettings::CanBeClose()
|
||||
{
|
||||
auto focusedElement = FocusManager::GetFocusedElement();
|
||||
|
||||
// Move focus so we are sure all values are in sync with the VM
|
||||
if (focusedElement != nullptr)
|
||||
{
|
||||
if (focusedElement->Equals(SettingsXMin))
|
||||
{
|
||||
auto textbox = static_cast<TextBox ^>(focusedElement);
|
||||
ViewModel->XMin = textbox->Text;
|
||||
}
|
||||
else if (focusedElement->Equals(SettingsXMax))
|
||||
{
|
||||
auto textbox = static_cast<TextBox ^>(focusedElement);
|
||||
ViewModel->XMax = textbox->Text;
|
||||
}
|
||||
else if (focusedElement->Equals(SettingsYMin))
|
||||
{
|
||||
auto textbox = static_cast<TextBox ^>(focusedElement);
|
||||
ViewModel->YMin = textbox->Text;
|
||||
}
|
||||
else if (focusedElement->Equals(SettingsYMax))
|
||||
{
|
||||
auto textbox = static_cast<TextBox ^>(focusedElement);
|
||||
ViewModel->YMax = textbox->Text;
|
||||
}
|
||||
}
|
||||
return ViewModel != nullptr && ViewModel->HasError();
|
||||
}
|
||||
|
||||
void GraphingSettings::RefreshRanges()
|
||||
{
|
||||
ViewModel->InitRanges();
|
||||
|
@@ -20,7 +20,6 @@ namespace CalculatorApp
|
||||
PROPERTY_R(CalculatorApp::ViewModel::GraphingSettingsViewModel ^, ViewModel);
|
||||
Windows::UI::Xaml::Style ^ SelectTextBoxStyle(bool incorrectRange, bool error);
|
||||
void SetGrapher(GraphControl::Grapher ^ grapher);
|
||||
bool CanBeClose();
|
||||
void RefreshRanges();
|
||||
private:
|
||||
void GridSettingsTextBox_PreviewKeyDown(Platform::Object ^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e);
|
||||
|
Reference in New Issue
Block a user