• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.ScrollChangedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: scrollBar_ScrollChanged

		private void scrollBar_ScrollChanged(object sender, ScrollChangedEventArgs e)
		{
			if(!_suppressScroll)
			{
				scrollBarV.ScrollToVerticalOffset(e.VerticalOffset);
				scrollBarH.ScrollToHorizontalOffset(e.HorizontalOffset);
			}
		} 
开发者ID:T1Easyware,项目名称:Soheil,代码行数:8,代码来源:SkillCenter.xaml.cs


示例17: smethod1

		private static void smethod1(object sender, ScrollChangedEventArgs e)
		{
			if (e.VerticalChange != 0.0 || e.HorizontalChange != 0.0)
			{
				ScrollViewer scrollViewer = sender as ScrollViewer;
				ScrollSynchronizer.smethod2(scrollViewer);
			}
		}
开发者ID:akordowski,项目名称:Source-Code-Atomiq,代码行数:8,代码来源:ScrollSynchronizer.cs


示例18: List_ScrollChanged

 private void List_ScrollChanged(object sender, ScrollChangedEventArgs e)
 {
     var vm = this.DataContext as TimelineListCoreViewModel;
     if (vm == null) return;
     var sv = GetScrollViewer(this.List);
     if (sv != null)
         vm.ScrollIndex = (int)sv.VerticalOffset;
 }
开发者ID:c0a5tar,项目名称:Mystique,代码行数:8,代码来源:TimelineListCore.xaml.cs


示例19: ScrollViewerScrollChanged

 /// <summary>
 /// Load movies if control has reached bottom position
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="e">Event args</param>
 private async void ScrollViewerScrollChanged(object sender, ScrollChangedEventArgs e)
 {
     var totalHeight = e.VerticalOffset + e.ViewportHeight;
     if (!totalHeight.Equals(e.ExtentHeight)) return;
     var vm = DataContext as PopularTabViewModel;
     if (vm != null && !vm.IsLoadingMovies)
         await vm.LoadMoviesAsync();
 }
开发者ID:JnCV17,项目名称:Popcorn,代码行数:13,代码来源:PopularMovies.xaml.cs


示例20: ScrollChanged

        void ScrollChanged(object sender, ScrollChangedEventArgs e)
        {
            _isAtEnd = e.ExtentHeight - (e.VerticalOffset + e.ViewportHeight) <= 1.0;

            if (!_isAtEnd && e.VerticalOffset == lastVerticalOffset)
                _scrollViewer.ScrollToEnd();
            lastVerticalOffset = e.VerticalOffset;
        }
开发者ID:pointgaming,项目名称:point-gaming-desktop,代码行数:8,代码来源:AutoScroller.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.ScrollViewer类代码示例发布时间:2022-05-26
下一篇:
C# Controls.SaveFileDialog类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap