상속: ContentPresenter, IScrollContentPresenter
 public ScrollViewerLayouter(ScrollContentPresenter view) : base(view)
 {
 }
        private void UpdateProperties(ScrollViewer sv)
        {
            // find child
            _scrollViewer = sv;
            _presenter = _scrollViewer.FindFirstChild<ScrollContentPresenter>();
            _container = (Grid)VisualTreeHelper.GetParent(_presenter);

            // add indicator
            _indicator = new PullToRefreshIndicator();
            _indicator.Height = IndicatorHeight;
            _indicator.VerticalAlignment = VerticalAlignment.Top;
            _indicator.RenderTransform = new TranslateTransform { Y = -IndicatorHeight };
            _indicator.Visibility = IsRefreshEnabled ? Visibility.Visible : Visibility.Collapsed;
            _container.Children.Insert(0, _indicator);

            // update properties
            _container.SizeChanged += Grid_SizeChanged;
            _container.Clip = new RectangleGeometry { Rect = new Rect(0, 0, _container.ActualWidth, _container.ActualHeight) };
            _presenter.ManipulationMode = ManipulationModes.TranslateY | ManipulationModes.TranslateRailsY |
                                          ManipulationModes.TranslateInertia | ManipulationModes.System;
            _presenter.ManipulationStarting += ScrollContentPresenter_OnManipulationStarting;
            _presenter.ManipulationInertiaStarting += ScrollContentPresenter_OnManipulationInertiaStarting;
            _presenter.ManipulationDelta += ScrollContentPresenter_OnManipulationDelta;
            _presenter.ManipulationCompleted += ScrollContentPresenter_OnManipulationCompleted;
            _presenter.RenderTransform = new TranslateTransform();
            _presenter.Background = new SolidColorBrush(Colors.Transparent);
        }
예제 #3
0
 public ScrollContentPresenterManipulationManager(ScrollContentPresenter scrollPresenter)
 {
     _scrollPresenter = scrollPresenter;
 }