Esempio n. 1
0
        public async Task Create(ContainerVisual topContainer)
        {
            var compositor = topContainer.Compositor;
            Tile.Initialize(compositor);
            CommonAnimations.Initialize(compositor);

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

            _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.ColorFlashlight);

            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 TransitionLibrary(Compositor compositor, LayoutManager layoutManager)
        {
            _layoutManager = layoutManager;
            _windowWidth = 640;
            _windowHeight = 480;
            _zoomScale = 3.0f;
            _random = new Random();

            CreateAnimationTemplates(compositor);
        }