MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / ShowGraphButton_Click

Method ShowGraphButton_Click

FastCopy/CopyDialog.cpp:122–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 void CopyDialog::ShowGraphButton_Click(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
123 {
124 if (m_showSpeedGraph)
125 {
126 HideGraphAnimation().Completed([this](auto...) { UnloadObject(SpeedGraph()); });
127 HideGraphAnimation().Begin();
128 winrt::Microsoft::UI::Xaml::VisualStateManager::GoToState(*this, L"HideGraph", false);
129 Global::copyWindow.Resize(m_originalWindowSize);
130 ViewModel().PropertyChanged(m_speedUpdateRevoker);
131 }
132 else
133 {
134 FindName(L"SpeedGraph").as<winrt::FastCopy::SpeedGraph>().Loaded([this](auto...)
135 {
136 GraphAnimation().Begin();
137 });
138 m_speedUpdateRevoker = ViewModel().PropertyChanged([this](auto, winrt::Microsoft::UI::Xaml::Data::PropertyChangedEventArgs e) {
139 if (e.PropertyName() == L"Speed")
140 {
141 SpeedGraph().SetSpeed(ViewModel().Percent(), ViewModel().Speed());
142 }
143 });
144
145 winrt::Microsoft::UI::Xaml::VisualStateManager::GoToState(*this, L"ShowGraph", false);
146 m_originalWindowSize = Global::copyWindow.ActualSize();
147 Global::copyWindow.Resize({ (int)m_originalWindowSize.Width, (int)m_originalWindowSize.Height + 190 });
148 }
149 m_showSpeedGraph = !m_showSpeedGraph;
150 }
151
152 void CopyDialog::ShowMenu(winrt::hstring path, winrt::Microsoft::UI::Xaml::Controls::MenuFlyout flyout)
153 {

Callers

nothing calls this directly

Calls 8

SpeedGraphClass · 0.85
BeginMethod · 0.80
ResizeMethod · 0.80
PropertyChangedMethod · 0.80
SetSpeedMethod · 0.80
SpeedMethod · 0.80
ActualSizeMethod · 0.80
PercentMethod · 0.45

Tested by

no test coverage detected