Rectangle clientRect = GetClientAreaBounds();
Rectangle rect = GetBounds();
- __pGallery = new (std::nothrow) Gallery();
- __pGallery->Construct(Rectangle(0, clientRect.y, rect.width, rect.height));
- __pGallery->SetName(L"GalleryControl");
+ __pGallery = static_cast<Gallery*>(GetControl(L"IDC_GALLERY"));
+ AppAssert(__pGallery);
+
__pGallery->SetItemProvider(*this);
__pGallery->AddGalleryEventListener(*this);
__pGallery->SetBackgroundColor(COLOR_GALLERY_BG);
- AddControl(*__pGallery);
- __pGallery->SetTextOfEmptyGallery(ResourceManager::GetString(L"IDS_COM_BODY_LOADING"));
SlideShowTransitionEffect effect = __pPresentationModel->GetTransitionEffectOfSlideShow();