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


C# ListView.ScrollIntoView方法代码示例

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


在下文中一共展示了ListView.ScrollIntoView方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ScrollToLastItem

 public void ScrollToLastItem(ListView lv)
 {
     lv.SelectedItem = lv.Items.GetItemAt(lv.Items.Count - 1);
     lv.ScrollIntoView(lv.SelectedItem);
     ListViewItem item = lv.ItemContainerGenerator.ContainerFromItem(lv.SelectedItem) as ListViewItem;
     if (item != null)
     {
         item.Focus();
     }
 }
开发者ID:bjarkimg,项目名称:MPExtended,代码行数:10,代码来源:TabServerLogs.xaml.cs

示例2: ListView_ItemsChanged

        private void ListView_ItemsChanged(ListView listView, ItemsChangedEventArgs e)
        {
            DebugHelper.AssertUIThread();

            if ((listView != null) && (e != null))
            {
                switch (e.Action)
                {
                    case NotifyCollectionChangedAction.Add:
                        if (MetadataViewContent.lastFocused == this)
                        {
                            int newIndex = listView.Items.Count - 1;
                            listView.SelectedIndex = newIndex;
                            listView.ScrollIntoView(listView.Items[newIndex]);
                            this.setNextMetadatFocus = listView;
                        }
                        break;

                    default:
                        this.setNextMetadatFocus = null;
                        break;
                }
            }
        }
开发者ID:UnaNancyOwen,项目名称:Kinect-Studio-Sample,代码行数:24,代码来源:MetadataViewContent.xaml.cs

示例3: List_OnLoaded

 void List_OnLoaded(object sender, RoutedEventArgs e)
 {
     list = (ListView) sender;
     list.ScrollIntoView(list.SelectedItem);
 }
开发者ID:Klaudit,项目名称:inbox2_desktop,代码行数:5,代码来源:DetailsView.xaml.cs

示例4: OnAutoScrollToCurrentItem

 /// <summary>
 /// This method will be called when the ListBox should
 /// be scrolled to the given index
 /// </summary>
 /// <param name="listBox">The ListBox which should be scrolled</param>
 /// <param name="index">The index of the item to which it should be scrolled</param>
 public static void OnAutoScrollToCurrentItem(ListView listBox, int index)
 {
     if (listBox != null && listBox.Items != null && listBox.Items.Count > index && index >= 0)
         listBox.ScrollIntoView(listBox.Items[index]);
 }
开发者ID:cotopboy,项目名称:nxdaigou_git,代码行数:11,代码来源:ListViewExtender.cs

示例5: ScrollToLastItem

 public void ScrollToLastItem(ListView lv)
 {
     lv.ScrollIntoView(lv.Items.GetItemAt(lv.Items.Count - 1));
 }
开发者ID:puenktchen,项目名称:MPExtended,代码行数:4,代码来源:TabServerLogs.xaml.cs

示例6: AddTasks

		private void AddTasks(Type[] taskTypes, ListView listView)
		{
			if (taskTypes == null)
				throw new ArgumentNullException("taskTypes");

			if (listView == null)
				throw new ArgumentNullException("listView");

			//if (Tasks.Any(t => t.GetType() == task.GetType()))
			//{
			//	var msg = "Multi".ValidateLicense();

			//	if (msg != null)
			//	{
			//		_logManager.Application.AddErrorLog(msg);

			//		new MessageBoxBuilder()
			//			.Text(LocalizedStrings.Str2903Params.Put(task.GetDisplayName()))
			//			.Warning()
			//			.Owner(this)
			//			.Show();

			//		return;	
			//	}
			//}

			BusyIndicator.IsBusy = true;
			BusyIndicator.BusyContent = LocalizedStrings.Str2904Params.Put(taskTypes.First().GetDisplayName());

			var tasks = new List<IHydraTask>();

			Task.Factory
				.StartNew(() =>
				{
					foreach (var type in taskTypes)
					{
						this.GuiSync(() =>
						{
							BusyIndicator.BusyContent = LocalizedStrings.Str2904Params.Put(type.GetDisplayName());
						});

						var task = type.CreateInstance<IHydraTask>();

						var settings = new HydraTaskSettings
						{
							Id = Guid.NewGuid(),
							WorkingFrom = TimeSpan.Zero,
							WorkingTo = TimeHelper.LessOneDay,
							IsDefault = true,
							TaskType = type.GetTypeName(false),
						};

						_entityRegistry.TasksSettings.Add(settings);
						_entityRegistry.TasksSettings.DelayAction.WaitFlush();

						InitTask(task, settings);

						var allSec = _entityRegistry.Securities.ReadById(Core.Extensions.AllSecurityId);

						task.Settings.Securities.Add(task.ToTaskSecurity(allSec));
						task.Settings.Securities.DelayAction.WaitFlush();

						tasks.Add(task);
					}
				})
				.ContinueWithExceptionHandling(this, res =>
				{
					BusyIndicator.IsBusy = false;

					if (!res)
						return;

					Tasks.AddRange(tasks);

					var last = tasks.LastOrDefault();

					if (last != null)
					{
						NavigationBar.SelectedIndex = last.IsCategoryOf(TaskCategories.Tool) ? 1 : 0;

						listView.SelectedItem = last;
						listView.ScrollIntoView(last);

						foreach (var task in tasks)
						{
							var pane = EnsureTaskPane(task);

							if (pane != null)
								ShowPane(pane);

							//EditTask(newTask);	
						}
					}
				});
		}
开发者ID:carlosaduro,项目名称:StockSharp,代码行数:95,代码来源:MainWindow_Tasks.cs

示例7: OnAutoScrollToCurrentItem

 /// <summary>
 /// This method will be called when the ListBox should
 /// be scrolled to the given index
 /// </summary>
 /// <param name="listView">The ListBox which should be scrolled</param>
 /// <param name="index">The index of the item to which it should be scrolled</param>
 public static void OnAutoScrollToCurrentItem(ListView listView)
 {
     listView.ScrollIntoView(listView.Items.CurrentItem);
 }
开发者ID:wilson0x4d,项目名称:Mubox,代码行数:10,代码来源:ListViewExtenders.cs

示例8: ShowLrc

        /// <summary>
        /// 显示歌词
        /// </summary>
        public void ShowLrc(int min, int sec,TextBox txtb1,ListView lrc1)
        {
            if (count >= maxCount || maxCount <= 0) return;
            int time = min * 60 + sec;
            string show;
            if (time < lrcTime[0])
            {
                show = "歌名:" + ti + "演唱:" + ar + "专辑:" + al + "制作:" + by;
                txtb1.Text = show;
            }
            if (time == lrcTime[count])
            {

                show = lrcText[lrcIndex[count++]];

                lrc1.SelectedItem = show;
                lrc1.ScrollIntoView(lrc1.SelectedItem);
                txtb1.Text = show;

            }
            else if (time > lrcTime[count])
            {
                int i2 = lrcTime.Count();
                for (int i = count; i < i2 - 1; i++)
                {
                    if (time <= lrcTime[i])
                    {
                        count = i;
                        break;

                    }
                }
            }
            else if (count > 0 && time < lrcTime[count - 1])
            {
                for (int i = 0; i < count - 1; i++)
                {
                    if (time >= lrcTime[i])
                    {
                        count = i;
                        break;

                    }
                }
            }
        }
开发者ID:iarray,项目名称:LoveMusic,代码行数:49,代码来源:Lrc.cs


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