Esempio n. 1
0
        public async Task Create(ContainerVisual topContainer, CompositionImageFactory imageFactory)
        {
            _compositor = topContainer.Compositor;
            Tile.Initialize(_compositor);
            CommonAnimations.Initialize(_compositor);

            _layoutManager = new LayoutManager();
            await _layoutManager.Create(topContainer, imageFactory);

            _transitionLibrary = new TransitionLibrary(_compositor, _layoutManager);
            _random            = new Random();

            NearSlideEntry = new TransitionEntry(
                TransitionKind.NearSlide,
                _layoutManager.GetNearNeighbor,
                _transitionLibrary.CreateNearSlideTransition,
                TransitionOptions.Select,
                TransitionDesaturationMode.None);

            FarSlideEntry = new TransitionEntry(
                TransitionKind.FarSlide,
                _layoutManager.GetFarNeighbor,
                _transitionLibrary.CreateFarSlideTransition,
                TransitionOptions.Select,
                TransitionDesaturationMode.Regular);

            ZoomEntry = new TransitionEntry(
                TransitionKind.Zoom,
                _layoutManager.GetFarNeighbor,
                _transitionLibrary.CreateZoomAndPanTransition,
                TransitionOptions.Select,
                TransitionDesaturationMode.Regular);

            StackEntry = new TransitionEntry(
                TransitionKind.Stack,
                _layoutManager.GetCurrentPictureFrame,
                _transitionLibrary.CreateStackTransition,
                TransitionOptions.Select,
                TransitionDesaturationMode.None);

            UnstackEntry = new TransitionEntry(
                TransitionKind.Stack,
                _layoutManager.GetCurrentPictureFrame,
                _transitionLibrary.CreateUnstackTransition,
                TransitionOptions.Select,
                TransitionDesaturationMode.None);

            _entries = new TransitionEntry[]
            {
                //NearSlideEntry,
                FarSlideEntry,
                //ZoomEntry,
                //StackEntry,
                //UnstackEntry,
            };
        }
Esempio n. 2
0
        public void Dispose()
        {
            _currentSelectedTile = null;

            if (_layoutManager != null)
            {
                _layoutManager.Dispose();
                _layoutManager = null;
            }

            if (_transitionLibrary != null)
            {
                _transitionLibrary.Dispose();
                _transitionLibrary = null;
            }

            CommonAnimations.Uninitialize();
            Tile.Uninitialize();
        }