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

Method CopyDialogWindow

FastCopy/CopyDialogWindow.xaml.cpp:25–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace winrt::FastCopy::implementation
24{
25 CopyDialogWindow::CopyDialogWindow()
26 {
27 InitializeComponent();
28
29 CenterWindow(*this, m_currentSize);
30 auto appWindow = GetAppWindow(*this);
31 auto presenter = appWindow.Presenter().as<winrt::Microsoft::UI::Windowing::OverlappedPresenter>();
32 presenter.IsResizable(false);
33 presenter.IsMaximizable(false);
34 presenter.IsMinimizable(true);
35
36 auto titleBar = appWindow.TitleBar();
37 titleBar.ExtendsContentIntoTitleBar(true);
38 titleBar.ButtonBackgroundColor(winrt::Windows::UI::Colors::Transparent());
39 titleBar.ButtonInactiveBackgroundColor(winrt::Windows::UI::Colors::Transparent());
40 Global::UIThread = DispatcherQueue();
41 Taskbar::SetProgressState(Global::MainHwnd, Taskbar::ProgressState::Indeterminate);
42
43
44 ViewModelLocator::GetInstance().RobocopyViewModel().DuplicateFiles().VectorChanged(
45 [this](winrt::Windows::Foundation::Collections::IObservableVector<winrt::FastCopy::FileCompareViewModel> original, auto)
46 {
47 auto const numElements = original.Size();
48 auto const clamped = std::clamp<uint32_t>(numElements, 0, std::size(Sizes) - 1);
49
50 if (m_currentSize == Sizes[clamped])
51 return;
52
53 playWindowAnimation(Sizes[clamped]);
54
55 /*set size cache*/
56 m_currentSize = Sizes[clamped];
57 }
58 );
59 Global::copyWindow = *this;
60 }
61 void CopyDialogWindow::Resize(winrt::Windows::Graphics::SizeInt32 size)
62 {
63 playWindowAnimation(size);

Callers

nothing calls this directly

Calls 8

CenterWindowFunction · 0.85
GetAppWindowFunction · 0.85
IsResizableMethod · 0.80
IsMaximizableMethod · 0.80
IsMinimizableMethod · 0.80
DuplicateFilesMethod · 0.80
SizeMethod · 0.80
RobocopyViewModelMethod · 0.45

Tested by

no test coverage detected