Redesign graph buttons + replace ActiveTracing button by a ToggleButton (#864)

* redesign graph buttons

* fix high-contrast and focus
This commit is contained in:
Rudy Huyn 2019-12-12 09:38:10 -08:00 committed by Pepe Rivera
parent f593c621aa
commit f282605bc6
4 changed files with 269 additions and 265 deletions

View file

@ -18,11 +18,12 @@ public
public
delegate void TracingValueChangedEventHandler(Windows::Foundation::Point value);
[Windows::UI::Xaml::Markup::ContentPropertyAttribute(Name = L"Equations")] public ref class Grapher sealed : public Windows::UI::Xaml::Controls::Control
[Windows::UI::Xaml::Markup::ContentPropertyAttribute(Name = L"Equations")] public ref class Grapher sealed : public Windows::UI::Xaml::Controls::Control, public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
event TracingValueChangedEventHandler ^ TracingValueChangedEvent;
event TracingChangedEventHandler ^ TracingChangedEvent;
virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler ^ PropertyChanged;
public:
Grapher();
@ -93,17 +94,22 @@ public
#pragma endregion
// Pass active tracing turned on or off down to the renderer
property bool ActiveTracing
{
bool get()
{
return m_renderMain->ActiveTracing;
return m_renderMain != nullptr && m_renderMain->ActiveTracing;
}
void set(bool value)
{
m_renderMain->ActiveTracing = value;
UpdateTracingChanged();
if (m_renderMain != nullptr && m_renderMain->ActiveTracing != value)
{
m_renderMain->ActiveTracing = value;
UpdateTracingChanged();
PropertyChanged(this, ref new Windows::UI::Xaml::Data::PropertyChangedEventArgs(L"ActiveTracing"));
}
}
}