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

Method CopyDialog

FastCopy/CopyDialog.cpp:63–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62
63 CopyDialog::CopyDialog()
64 {
65 InitializeComponent();
66 ViewModel().DuplicateFiles().VectorChanged(
67 [this](winrt::Windows::Foundation::Collections::IObservableVector<winrt::FastCopy::FileCompareViewModel> original, auto)
68 {
69 if (original.Size() == 0)
70 {
71 UnloadObject(DuplicateFileInfoGrid());
72 UnloadObject(ContinueButton());
73 }
74 else
75 {
76 DispatcherQueue().TryEnqueue([this]
77 {
78 FindName(L"ContinueButton");
79 FindName(L"DuplicateFileItems");
80 FindName(L"DuplicateFileInfoGrid");
81 });
82 }
83 }
84 );
85 SettingsChangeListener::GetInstance().OnThemeChange(
86 [this](SettingsChangeListener::ThemeChangeEventArg e)
87 {
88 if (e.effect == 2)
89 {
90 switch (e.theme)
91 {
92 case 0: Background(nullptr); break;
93 case 1: Background(winrt::Microsoft::UI::Xaml::Media::SolidColorBrush{winrt::Windows::UI::Colors::White()}); break;
94 case 2: Background(winrt::Microsoft::UI::Xaml::Media::SolidColorBrush{winrt::Windows::UI::Colors::Black()}); break;
95 }
96 }
97 else
98 Background(nullptr);
99 }
100 );
101 ViewModelLocator::GetInstance().RobocopyViewModel().DuplicateFiles().VectorChanged(
102 [this](winrt::Windows::Foundation::Collections::IObservableVector<winrt::FastCopy::FileCompareViewModel> original, auto)
103 {
104 winrt::Microsoft::UI::Xaml::VisualStateManager::GoToState(
105 *this,
106 original.Size() == 0 ? L"HideDuplicateFiles" : L"ShowDuplicateFiles",
107 false
108 );
109 }
110 );
111 }
112
113 void CopyDialog::MainPanel_SizeChanged(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::SizeChangedEventArgs const& e)
114 {

Callers

nothing calls this directly

Calls 5

DuplicateFilesMethod · 0.80
SizeMethod · 0.80
TryEnqueueMethod · 0.80
OnThemeChangeMethod · 0.80
RobocopyViewModelMethod · 0.45

Tested by

no test coverage detected