Exemplo n.º 1
0
        public void ScrollToCurrentOffset()
        {
            MainFlip.GetBindingExpression(FlipView.ItemsSourceProperty).UpdateSource();
            var container    = MainFlip.ContainerFromItem(this);
            var scrollViewer = FindChildrenObjectByType <ScrollViewer>(container);

            var store  = new StoreToFiles();
            var offset = store.LoadOffset(Thread);

            scrollViewer.ScrollToVerticalOffset(offset);
            this.MainFlip.SelectionChanged += MainFlip_SelectionChanged;

            //scrollViewer.ViewChanged += ScrollViewer_ViewChanged;
        }
        private void CreateNextFlipPage()
        {
            var items = (ObservableCollection <IFlipModel>)MainFlip.ItemsSource;

            if (items.Count > MainFlip.SelectedIndex + 1)
            {
                var count = items.Count;
                for (var i = items.Count - 1; i > MainFlip.SelectedIndex; i--)
                {
                    items.RemoveAt(i);
                }
            }
            var newFlip = new ItaFlipModel(MainFlip, SelectedItem);

            items.Add(newFlip);
            //Task.Delay(300).Wait();
            //MainFlip.SelectedIndex++;
            MainFlip.GetBindingExpression(FlipView.ItemsSourceProperty).UpdateSource();
            MainFlip.SelectedItem = newFlip;
        }