예제 #1
0
        private async Task SendStrokeUpdates(SlideshowSlideView view)
        {
            if (updatingStrokes)
            {
                viewToUpdate = view;
                return;
            }

            updatingStrokes = true;
            viewToUpdate    = null;

            bool success = false;

            var data = await view.GetStrokeData();

            int index = _adventure.Photos.IndexOf(view.Photo);

            var message = new ValueSet();

            message.Add("stroke_data", data);
            message.Add("index", index);
            var response = await ConnectedService.Instance.SendMessageFromClientAsync(message, SlideshowMessageTypeEnum.UpdateStrokes);

            success = response != null && response.ContainsKey("AOK");

            updatingStrokes = false;
            if (viewToUpdate != null)
            {
                SendStrokeUpdates(viewToUpdate);
            }
        }
예제 #2
0
        private void SlideshowSlideView_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var view  = sender as SlideshowSlideView;
            var items = PhotoTimeline.FindChildren <TimelineItem>().ToList();

            if (PhotoTimeline.TimelinePanel.IsLocked)
            {
                PhotoTimeline.TimelinePanel.IsLocked = false;
                HandleIndexUpdateFromHost(_hostSlide);

                for (var i = 0; i < items.Count(); i++)
                {
                    items[i].Fade(1).Start();
                    items[i].IsHitTestVisible = true;
                }
            }
            else
            {
                PhotoTimeline.TimelinePanel.IsLocked = true;

                var   photoIndex = _adventure.Photos.IndexOf(view.Photo);
                var   size       = Math.Min(ActualWidth, ActualHeight);
                float scale      = (float)size / (float)view.Height;
                float center     = (float)view.Height / 2;

                view.Scale(scale, scale, center, center, duration: 200).Start();
                PhotoTimeline.CurrentItemIndex = photoIndex;
                SendIndexUpdate();

                for (var i = 0; i < items.Count(); i++)
                {
                    if (i != photoIndex)
                    {
                        items[i].Fade(0, 200).Start();
                        items[i].IsHitTestVisible = false;
                    }
                }

                if (_selectedSlide != null && _selectedSlide != view)
                {
                    _selectedSlide?.Scale(1, 1, center, center, 100).Start();
                }
                _selectedSlide = view;
            }
        }