Don't create a new flyout every time the graph settings button is clicked (#1197)
* attempt a fix * fix ranges
This commit is contained in:
parent
7fb341e9b2
commit
db86e949f9
@ -296,8 +296,7 @@
|
|||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
<VisualStateGroup x:Name="CommonStates">
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
<VisualState x:Name="Normal">
|
<VisualState x:Name="Normal">
|
||||||
<Storyboard>
|
<Storyboard/>
|
||||||
</Storyboard>
|
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="PointerOver">
|
<VisualState x:Name="PointerOver">
|
||||||
<Storyboard>
|
<Storyboard>
|
||||||
@ -699,8 +698,8 @@
|
|||||||
</RepeatButton>
|
</RepeatButton>
|
||||||
|
|
||||||
<ToggleButton x:Uid="graphViewButton"
|
<ToggleButton x:Uid="graphViewButton"
|
||||||
MinHeight="40"
|
|
||||||
MinWidth="40"
|
MinWidth="40"
|
||||||
|
MinHeight="40"
|
||||||
Style="{ThemeResource ThemedGraphViewToggleButtonStyle}"
|
Style="{ThemeResource ThemedGraphViewToggleButtonStyle}"
|
||||||
contract7Present:CornerRadius="{ThemeResource BottomButtonCornerRadius}"
|
contract7Present:CornerRadius="{ThemeResource BottomButtonCornerRadius}"
|
||||||
AutomationProperties.AutomationId="graphViewButton"
|
AutomationProperties.AutomationId="graphViewButton"
|
||||||
|
@ -95,7 +95,7 @@ GraphingCalculator::GraphingCalculator()
|
|||||||
{
|
{
|
||||||
SharedShadow->Receivers->Append(GraphingControl);
|
SharedShadow->Receivers->Append(GraphingControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_accessibilitySettings->HighContrastChanged +=
|
m_accessibilitySettings->HighContrastChanged +=
|
||||||
ref new TypedEventHandler<AccessibilitySettings ^, Object ^>(this, &GraphingCalculator::OnHighContrastChanged);
|
ref new TypedEventHandler<AccessibilitySettings ^, Object ^>(this, &GraphingCalculator::OnHighContrastChanged);
|
||||||
|
|
||||||
@ -634,15 +634,18 @@ void GraphingCalculator::DisplayGraphSettings()
|
|||||||
m_graphSettings->GraphThemeSettingChanged += ref new EventHandler<bool>(this, &GraphingCalculator::OnGraphThemeSettingChanged);
|
m_graphSettings->GraphThemeSettingChanged += ref new EventHandler<bool>(this, &GraphingCalculator::OnGraphThemeSettingChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_graphSettings->IsMatchAppTheme = IsMatchAppTheme;
|
if (m_graphFlyout == nullptr)
|
||||||
|
{
|
||||||
|
m_graphFlyout = ref new Flyout();
|
||||||
|
m_graphFlyout->Content = m_graphSettings;
|
||||||
|
}
|
||||||
|
|
||||||
m_graphSettings->SetGrapher(this->GraphingControl);
|
m_graphSettings->SetGrapher(this->GraphingControl);
|
||||||
auto flyoutGraphSettings = ref new Flyout();
|
m_graphSettings->IsMatchAppTheme = IsMatchAppTheme;
|
||||||
flyoutGraphSettings->Content = m_graphSettings;
|
|
||||||
flyoutGraphSettings->Closing += ref new TypedEventHandler<FlyoutBase ^, FlyoutBaseClosingEventArgs ^>(this, &GraphingCalculator::OnSettingsFlyout_Closing);
|
|
||||||
|
|
||||||
auto options = ref new FlyoutShowOptions();
|
auto options = ref new FlyoutShowOptions();
|
||||||
options->Placement = FlyoutPlacementMode::BottomEdgeAlignedRight;
|
options->Placement = FlyoutPlacementMode::BottomEdgeAlignedRight;
|
||||||
flyoutGraphSettings->ShowAt(GraphSettingsButton, options);
|
m_graphFlyout->ShowAt(GraphSettingsButton, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalculatorApp::GraphingCalculator::AddTracePointerShadow()
|
void CalculatorApp::GraphingCalculator::AddTracePointerShadow()
|
||||||
@ -660,12 +663,6 @@ void CalculatorApp::GraphingCalculator::AddTracePointerShadow()
|
|||||||
::Hosting::ElementCompositionPreview::SetElementChildVisual(CursorShadow, shadowSpriteVisual);
|
::Hosting::ElementCompositionPreview::SetElementChildVisual(CursorShadow, shadowSpriteVisual);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphingCalculator::OnSettingsFlyout_Closing(FlyoutBase ^ sender, FlyoutBaseClosingEventArgs ^ args)
|
|
||||||
{
|
|
||||||
auto flyout = static_cast<Flyout ^>(sender);
|
|
||||||
auto graphingSetting = static_cast<GraphingSettings ^>(flyout->Content);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GraphingCalculator::Canvas_SizeChanged(Object ^ /*sender*/, SizeChangedEventArgs ^ e)
|
void GraphingCalculator::Canvas_SizeChanged(Object ^ /*sender*/, SizeChangedEventArgs ^ e)
|
||||||
{
|
{
|
||||||
// Initialize the pointer to the correct location to match initial value in GraphControl\DirectX\RenderMain.cpp
|
// Initialize the pointer to the correct location to match initial value in GraphControl\DirectX\RenderMain.cpp
|
||||||
@ -812,12 +809,12 @@ void GraphingCalculator::OnGraphThemeSettingChanged(Object ^ sender, bool isMatc
|
|||||||
IsMatchAppTheme = isMatchAppTheme;
|
IsMatchAppTheme = isMatchAppTheme;
|
||||||
WeakReference weakThis(this);
|
WeakReference weakThis(this);
|
||||||
this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([weakThis]() {
|
this->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([weakThis]() {
|
||||||
auto refThis = weakThis.Resolve<GraphingCalculator>();
|
auto refThis = weakThis.Resolve<GraphingCalculator>();
|
||||||
if (refThis != nullptr)
|
if (refThis != nullptr)
|
||||||
{
|
{
|
||||||
refThis->UpdateGraphTheme();
|
refThis->UpdateGraphTheme();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphingCalculator::GraphViewButton_Click(Object ^ sender, RoutedEventArgs ^ e)
|
void GraphingCalculator::GraphViewButton_Click(Object ^ sender, RoutedEventArgs ^ e)
|
||||||
@ -837,5 +834,6 @@ void GraphingCalculator::GraphViewButton_Click(Object ^ sender, RoutedEventArgs
|
|||||||
auto announcement = CalculatorAnnouncement::GetGraphViewBestFitChangedAnnouncement(announcementText);
|
auto announcement = CalculatorAnnouncement::GetGraphViewBestFitChangedAnnouncement(announcementText);
|
||||||
narratorNotifier->Announce(announcement);
|
narratorNotifier->Announce(announcement);
|
||||||
|
|
||||||
TraceLogger::GetInstance()->LogGraphButtonClicked(GraphButton::GraphView, IsManualAdjustment ? GraphButtonValue::ManualAdjustment : GraphButtonValue::AutomaticBestFit);
|
TraceLogger::GetInstance()->LogGraphButtonClicked(
|
||||||
|
GraphButton::GraphView, IsManualAdjustment ? GraphButtonValue::ManualAdjustment : GraphButtonValue::AutomaticBestFit);
|
||||||
}
|
}
|
||||||
|
@ -97,8 +97,8 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
|||||||
Windows::UI::ViewManagement::AccessibilitySettings ^ m_accessibilitySettings;
|
Windows::UI::ViewManagement::AccessibilitySettings ^ m_accessibilitySettings;
|
||||||
bool m_cursorShadowInitialized;
|
bool m_cursorShadowInitialized;
|
||||||
Windows::UI::ViewManagement::UISettings ^ m_uiSettings;
|
Windows::UI::ViewManagement::UISettings ^ m_uiSettings;
|
||||||
|
Windows::UI::Xaml::Controls::Flyout ^ m_graphFlyout;
|
||||||
CalculatorApp::GraphingSettings ^ m_graphSettings;
|
CalculatorApp::GraphingSettings ^ m_graphSettings;
|
||||||
void OnSettingsFlyout_Closing(Windows::UI::Xaml::Controls::Primitives::FlyoutBase ^ sender, Windows::UI::Xaml::Controls::Primitives::FlyoutBaseClosingEventArgs ^ args);
|
|
||||||
void Canvas_SizeChanged(Platform::Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
|
void Canvas_SizeChanged(Platform::Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
|
||||||
void OnHighContrastChanged(Windows::UI::ViewManagement::AccessibilitySettings ^ sender, Platform::Object ^ args);
|
void OnHighContrastChanged(Windows::UI::ViewManagement::AccessibilitySettings ^ sender, Platform::Object ^ args);
|
||||||
void OnEquationFormatRequested(Platform::Object ^ sender, CalculatorApp::Controls::MathRichEditBoxFormatRequest ^ e);
|
void OnEquationFormatRequested(Platform::Object ^ sender, CalculatorApp::Controls::MathRichEditBoxFormatRequest ^ e);
|
||||||
|
Loading…
Reference in New Issue
Block a user