当前位置: 首页>>代码示例>>C#>>正文


C# Controls.ScrollChangedEventArgs类代码示例

本文整理汇总了C#中System.Windows.Controls.ScrollChangedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ScrollChangedEventArgs类的具体用法?C# ScrollChangedEventArgs怎么用?C# ScrollChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ScrollChangedEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了ScrollChangedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnScrollChanged

        /// <summary>
        /// Fix horizontal offset on scrolling changes.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnScrollChanged(ScrollChangedEventArgs e)
        {
            //if( e.HorizontalChange != 0 )
            this.ScrollToHorizontalOffset(fixedHorizontalOffset);

            base.OnScrollChanged(e);
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:11,代码来源:ModelTreeViewScrollViewer.cs

示例2: HandleScrollChanged

		void HandleScrollChanged (object sender, ScrollChangedEventArgs e)
		{
			if (Value != scrollValue) {
				scrollValue = Value;
				Context.InvokeUserCode (EventSink.OnValueChanged);
			}
		}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:ScrollControlBackend.cs

示例3: DataGrid2_ScrollChanged

		private void DataGrid2_ScrollChanged(object sender, ScrollChangedEventArgs e)
		{
			if (e.HorizontalChange != 0.0f)
			{
				ScrollViewer sv = null;
				Type t = DataGrid2.GetType();
				try
				{
					sv = t.InvokeMember("InternalScrollHost", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetProperty, null, DataGrid1, null) as ScrollViewer;
					sv.ScrollToHorizontalOffset(e.HorizontalOffset);
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message);
				}
			}
			if (e.VerticalChange != 0.0f)
			{
				ScrollViewer sv = null;
				Type t = DataGrid2.GetType();
				try
				{
					sv = t.InvokeMember("InternalScrollHost", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetProperty, null, DataGrid1, null) as ScrollViewer;
					sv.ScrollToVerticalOffset(e.VerticalOffset);
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message);
				}
			}
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:31,代码来源:DeviceConfigurationView.xaml.cs

示例4: ScrollViewer_ScrollChanged

        private static void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e) {
            if (e.VerticalChange != 0 || e.HorizontalChange != 0) {
                var changedScrollViewer = sender as ScrollViewer;

                Scroll(changedScrollViewer);
            }
        }
开发者ID:mmalek06,项目名称:FunkyCodeEditor,代码行数:7,代码来源:ScrollSynchronizer.cs

示例5: AutoScrollListBox_ScrollChanged

        private void AutoScrollListBox_ScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            try
            {
                var scrollViewer = sender as ScrollViewer;
                if (scrollViewer == null)
                {
                    return;
                }

                var ratio = scrollViewer.VerticalOffset / scrollViewer.ScrollableHeight;
                if (ratio >= 0.9)
                //if (scrollViewer.VerticalOffset >= scrollViewer.ScrollableHeight)
                {
                    if (LazyLoadCommand != null && LazyLoadCommand.CanExecute(null))
                    {
                        LazyLoadCommand.Execute(null);
                    }
                }

                //Debug.WriteLine(scrollViewer.HorizontalOffset + " / " + scrollViewer.ScrollableWidth + " -- " + scrollViewer.VerticalOffset + " / " + scrollViewer.ScrollableHeight + " (" + (scrollViewer.VerticalOffset / scrollViewer.ScrollableHeight) + ")");
            }
            catch (Exception ex)
            {
                Debug.WriteLine("AutoScrollListBox_ScrollChanged: " + ex);
                throw;
            }
        }
开发者ID:Andrew-Hanlon,项目名称:CCSWE-Libraries,代码行数:28,代码来源:AutoScrollListBox.cs

示例6: RichTextBox_ScrollChanged

        /// <summary>
        /// Method synchronizes vertical scrollbar in RichTextBoxes components
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RichTextBox_ScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            var textToSync = (sender == richTextBoxLines) ? richTextBoxNumbers : richTextBoxLines;

            textToSync.ScrollToVerticalOffset(e.VerticalOffset);
            textToSync.ScrollToHorizontalOffset(e.HorizontalOffset);
        }
开发者ID:Leksor,项目名称:Narzedzie-do-przegladania-zmian,代码行数:12,代码来源:PreviewFile.xaml.cs

示例7: ScrollViewer_ScrollChanged

        private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            var scrollViewer = (ScrollViewer)sender;

            // User scroll event : set or unset autoscroll mode
            if (e.ExtentHeightChange == 0)
            {   // Content unchanged : user scroll event
                if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight)
                {   // Scroll bar is in bottom
                    // Set autoscroll mode
                    _autoScroll = true;
                }
                else
                {   // Scroll bar isn't in bottom
                    // Unset autoscroll mode
                    _autoScroll = false;
                }
            }

            // Content scroll event : autoscroll eventually
            if (_autoScroll && e.ExtentHeightChange != 0)
            {   // Content changed and autoscroll mode set
                // Autoscroll
                scrollViewer.ScrollToVerticalOffset(scrollViewer.ExtentHeight);
            }

        }
开发者ID:guitcastro,项目名称:lime,代码行数:27,代码来源:Trace.xaml.cs

示例8: svSetCategoryGroupDisplay_ScrollChanged

		private void svSetCategoryGroupDisplay_ScrollChanged(object sender, ScrollChangedEventArgs e)
		{
			ScrollViewer sv = sender as ScrollViewer;
			bSetCategoryGroupDisplayHorizontal.Width = sv.ViewportWidth * sv.ViewportWidth / sv.ExtentWidth;
			bSetCategoryGroupDisplayVertical.Height = sv.ViewportHeight * sv.ViewportHeight / sv.ExtentHeight;

			bSetCategoryGroupDisplayHorizontal.Margin = new Thickness(sv.ViewportWidth * sv.HorizontalOffset / sv.ExtentWidth, 0, 0, 0);
			bSetCategoryGroupDisplayVertical.Margin = new Thickness(0, sv.ViewportHeight * sv.VerticalOffset / sv.ExtentHeight, 0, 0);

			bOpacityLayerLeft.Visibility = bOpacityLayerRight.Visibility = System.Windows.Visibility.Visible;
			if (bSetCategoryGroupDisplayHorizontal.Width >= sv.ViewportWidth)
				bOpacityLayerLeft.Visibility = bOpacityLayerRight.Visibility = System.Windows.Visibility.Collapsed;
			else if (bSetCategoryGroupDisplayHorizontal.Margin.Left <= 0)
				bOpacityLayerLeft.Visibility = System.Windows.Visibility.Collapsed;
			else if (bSetCategoryGroupDisplayHorizontal.Margin.Left + bSetCategoryGroupDisplayHorizontal.Width >= sv.ViewportWidth)
				bOpacityLayerRight.Visibility = System.Windows.Visibility.Collapsed;

			bOpacityLayerTop.Visibility = bOpacityLayerBottom.Visibility = System.Windows.Visibility.Visible;
			if (bSetCategoryGroupDisplayVertical.Height >= sv.ViewportHeight)
				bOpacityLayerTop.Visibility = bOpacityLayerBottom.Visibility = System.Windows.Visibility.Collapsed;
			else if (bSetCategoryGroupDisplayVertical.Margin.Top <= 0)
				bOpacityLayerTop.Visibility = System.Windows.Visibility.Collapsed;
			else if (bSetCategoryGroupDisplayVertical.Margin.Top + bSetCategoryGroupDisplayVertical.Height >= sv.ViewportHeight)
				bOpacityLayerBottom.Visibility = System.Windows.Visibility.Collapsed;
		}
开发者ID:micahpaul,项目名称:dominion_net_multi,代码行数:25,代码来源:wCardSelection.xaml.cs

示例9: OnScrollChanged

		protected override void OnScrollChanged(ScrollChangedEventArgs e)
		{
			HorizontalPosition = HorizontalOffset;
			VerticalPosition = VerticalOffset;
			HorizontalMax = ScrollableWidth;
			VerticalMax = ScrollableHeight;
		}
开发者ID:xyandro,项目名称:NeoEdit,代码行数:7,代码来源:BindableScrollViewer.cs

示例10: ScrollViewer_ScrollChanged

        public void ScrollViewer_ScrollChanged( object sender, ScrollChangedEventArgs ev )
        {
            if ( ev.Source.GetType( ) == typeof( ScrollViewer ) ) {
                return;
            }

            // Calculate scrollbar situation before the scroll change
            double oldVh = ev.ViewportHeight - ev.ViewportHeightChange;
            double oldVo = ev.VerticalOffset - ev.VerticalChange;
            double oldEh = ev.ExtentHeight - ev.ExtentHeightChange;

            var oldNeeded = ( oldEh >= oldVh );
            var oldAtBottom = Math.Abs( ( oldVh + oldVo ) - oldEh ) < 0.01;

            // Calculate scrollbar situation after the scroll change
            double newVh = ev.ViewportHeight;
            double newVo = ev.VerticalOffset;
            double newEh = ev.ExtentHeight;

            var newNeeded = ( newEh >= newVh );
            var newAtBottom = Math.Abs( ( newVh + newVo ) - newEh ) < 0.01;

            if ( ( !oldNeeded && newNeeded ) || ( oldAtBottom && !newAtBottom ) ) {
                Dispatcher.BeginInvoke( (Action) ScrollViewer.ScrollToBottom );
            }
        }
开发者ID:BGCX261,项目名称:ziveirc-svn-to-git,代码行数:26,代码来源:PanelImpl.cs

示例11: OnScrollChanged

        protected override void OnScrollChanged(ScrollChangedEventArgs e)
        {
            base.OnScrollChanged(e);

            var panel = Content as Panel;
            if (panel == null)
            {
                return;
            }

            var viewport = new Rect(new Point(0, 0), RenderSize);

            foreach (UIElement child in panel.Children)
            {
                if (!child.IsVisible)
                {
                    SetIsInViewport(child, false);
                    continue;
                }

                var transform = child.TransformToAncestor(this);
                var childBounds = transform.TransformBounds(new Rect(new Point(0, 0), child.RenderSize));
                SetIsInViewport(child, viewport.IntersectsWith(childBounds));
            }
        }
开发者ID:sgnatonski,项目名称:slavapp,代码行数:25,代码来源:ViewportAwareScrollViewer.cs

示例12: ScrollViewer_ScrollChanged

 private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
 {
     ScrollViewer sv = sender as ScrollViewer;
     if (sv.VerticalOffset == sv.ScrollableHeight)
     {
         sv.ScrollToEnd();//debug breakpoint
     }
 }
开发者ID:tranthanhrim,项目名称:gomoku,代码行数:8,代码来源:ChatBox.xaml.cs

示例13: _scrollViewer_ScrollChanged

        void _scrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            if (_scrollViewer == null || LoadMoreCommand == null)
                return;

            if (e.VerticalOffset == _scrollViewer.ScrollableHeight && e.VerticalChange != 0)
                LoadMoreCommand.Execute(null);
        }
开发者ID:justdude,项目名称:meridian,代码行数:8,代码来源:ExtendedListBox.cs

示例14: ChangesetHistoryGrid_ScrollChanged

        private void ChangesetHistoryGrid_ScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            var scrollViewer = UIHelper.FindChild<ScrollViewer>(this, "GraphScrollViewer");
            scrollViewer.ScrollToVerticalOffset(Math.Floor(e.VerticalOffset) * 24);

            var dataGrid = UIHelper.FindChild<DataGrid>(this, "ChangesetHistoryGrid");
            scrollViewer.Height = Math.Abs(dataGrid.ActualHeight - 24);
        }
开发者ID:jez9999,项目名称:Git-GUI,代码行数:8,代码来源:ChangesetHistory.xaml.cs

示例15: OnHScrollChanged

 private static void OnHScrollChanged(object sender, ScrollChangedEventArgs e)
 {
     if (e.HorizontalChange != 0)
     {
         var changedScrollViewer = sender as ScrollViewer;
         ApplyHScroll(changedScrollViewer);
     }
 }
开发者ID:hansuky,项目名称:Yuhan,代码行数:8,代码来源:ScrollSynchronizer.cs


注:本文中的System.Windows.Controls.ScrollChangedEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。