| 23 | namespace 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); |
nothing calls this directly
no test coverage detected