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

Method TilesControl

FastCopy/TilesControl.cpp:11–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace winrt::FastCopy::implementation
10{
11 TilesControl::TilesControl()
12 {
13 m_loadedRevoker = Loaded(winrt::auto_revoke, [this](auto...)->winrt::Windows::Foundation::IAsyncAction
14 {
15 auto dispatcher = DispatcherQueue();
16 auto thisPtr = this;
17
18 Width(Items().GetAt(0).as<Type>().ActualWidth());
19 Height(Items().GetAt(0).as<Type>().ActualHeight());
20
21 auto const size = Items().Size();
22 m_renderOffsets.resize(size);
23 m_renderOffsets[0] = 0;
24
25 Items().GetAt(0).as<Type>().RenderTransform(winrt::Microsoft::UI::Xaml::Media::TranslateTransform{});
26
27 for (int i = 1; i < size; ++i)
28 {
29 winrt::Microsoft::UI::Xaml::Media::TranslateTransform translate;
30 translate.Y(10000);
31 Items().GetAt(i).as<Type>().RenderTransform(translate);
32 m_renderOffsets[i] = m_renderOffsets[i - 1] + Items().GetAt(i - 1).as<Type>().ActualHeight();
33 }
34 co_await std::chrono::seconds{3};
35
36 bool isFirst = true;
37 while (true)
38 {
39 for (int i = 0; i < size; ++i)
40 {
41 co_await wil::resume_foreground(dispatcher);
42 if (!isFirst)
43 {
44 thisPtr->makeAnimation(i == 0 ? size - 1 : i - 1, i);
45 }
46 isFirst = false;
47 co_await std::chrono::seconds{3};
48 }
49 }
50 });
51 }
52
53 void TilesControl::makeAnimation(int previousItemIndex, int currentItemIndex)
54 {

Callers

nothing calls this directly

Calls 2

SizeMethod · 0.80
makeAnimationMethod · 0.45

Tested by

no test coverage detected