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

C# Controls.LongListSelector类代码示例

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

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



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

示例1: AddVisibileContainers

        /// <summary>
        /// Retrieves the visible containers in a LongListSelector and adds them to <paramref name="items"/>.
        /// </summary>
        /// <param name="list">LongListSelector that contains the items.</param>
        /// <param name="itemsPanel">Direct parent of the items.</param>
        /// <param name="items">List to populate with the containers currently in the viewport</param>
        /// <param name="selectContent">
        /// Specifies whether to return the container or its content.
        /// For headers, we can't apply projections on the container directly 
        /// (or everything will go blank), so we will apply them on the 
        /// content instead.
        /// </param>
        private static void AddVisibileContainers(LongListSelector list, Canvas itemsPanel, List<KeyValuePair<double, FrameworkElement>> items, bool selectContent)
        {
            foreach (DependencyObject obj in itemsPanel.GetVisualChildren())
            {
                ContentPresenter container = obj as ContentPresenter;
                if (container != null &&
                    (!selectContent ||
                    (VisualTreeHelper.GetChildrenCount(container) == 1 &&
                     VisualTreeHelper.GetChild(container, 0) is FrameworkElement)))
                {
                    GeneralTransform itemTransform = null;
                    try
                    {
                        itemTransform = container.TransformToVisual(list);
                    }
                    catch (ArgumentException)
                    {
                        // Ignore failures when not in the visual tree
                        break;
                    }

                    Rect boundingBox = new Rect(itemTransform.Transform(new Point()), itemTransform.Transform(new Point(container.ActualWidth, container.ActualHeight)));

                    if (boundingBox.Bottom > 0 && boundingBox.Top < list.ActualHeight)
                    {
                        items.Add(
                            new KeyValuePair<double, FrameworkElement>(
                                boundingBox.Top, 
                                selectContent 
                                ? (FrameworkElement)VisualTreeHelper.GetChild(container, 0) 
                                : container));
                    }
                }
            }
        }
开发者ID:JanJoris,项目名称:VikingApp,代码行数:47,代码来源:LongListSelectorExtensions.cs


示例2: LongListSelectorHelper

public LongListSelectorHelper(LongListSelector longListSelector)
{
    longListSelector.SelectionChanged += (sender, args) =>
            {
                var methodName = GetSelectionChangedMethodName(longListSelector);

                var dataContext = GetMethodContext(longListSelector);
                if (dataContext == null)
                {
                    dataContext = longListSelector.DataContext;
                }

                var method = dataContext.GetType().GetTypeInfo().GetDeclaredMethod(methodName);
                var parms = method.GetParameters();

                if (parms != null && parms.Length == 1)
                {
                    method.Invoke(dataContext, new[] { longListSelector.SelectedItem });
                }
                else
                {
                    method.Invoke(dataContext, null);
                }
            };
}
开发者ID:slodge,项目名称:Charmed,代码行数:25,代码来源:LongListSelectorHelper.cs


示例3: LongListSelectorAnimator

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="dispatcher">Der Dispatcher der Seite des LongListSelectors.</param>
        /// <param name="longListSelector">Der LongListSelector zum animieren.</param>
        internal LongListSelectorAnimator(Dispatcher dispatcher, LongListSelector longListSelector)
        {
            this.dispatcher = dispatcher;

            longListSelector.GroupViewOpened += LongListSelector_GroupViewOpened;
            longListSelector.GroupViewClosing += LongListSelector_GroupViewClosing;
        }
开发者ID:JulianMH,项目名称:DoIt,代码行数:12,代码来源:LongListSelectorHelper.cs


示例4: GetItemsInViewPort

        /// <summary>
        /// Gets the items that are currently in the viewport
        /// of a LongListSelector and adds them
        /// into a list of weak references.
        /// </summary>
        /// <param name="list">
        /// The LongListSelector instance to search on.
        /// </param>
        /// <param name="items">
        /// The list of weak references where the items in 
        /// the viewport will be added.
        /// </param>
        public static void GetItemsInViewPort(LongListSelector list, IList<WeakReference> items)
        {
            DependencyObject child = list;

            if (VisualTreeHelper.GetChildrenCount(list) == 0)
            {
                // no child yet
                return;
            }

            list.UpdateLayout();

            do
            {
                child = VisualTreeHelper.GetChild(child, 0);
            } while (VisualTreeHelper.GetChildrenCount(child) > 0 && !(child is Canvas));

            if (child is Canvas && 
                VisualTreeHelper.GetChildrenCount(child) > 0 && 
                VisualTreeHelper.GetChild(child, 0) is Canvas)
            {
                Canvas headersPanel = (Canvas)child;
                Canvas itemsPanel = (Canvas)VisualTreeHelper.GetChild(child, 0);
                var itemsInList = new List<KeyValuePair<double, FrameworkElement>>();

                AddVisibileContainers(list, itemsPanel, itemsInList, /* selectContent = */ false);
                AddVisibileContainers(list, headersPanel, itemsInList, /* selectContent = */ true);

                foreach (var pair in itemsInList.OrderBy(selector => selector.Key))
                {
                    items.Add(new WeakReference(pair.Value));
                }
            }
        }
开发者ID:skyyuxuan,项目名称:WPToolkit,代码行数:46,代码来源:LongListSelectorExtensions.cs


示例5: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PeopleHub;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.peopleLongListSelector = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("peopleLongListSelector")));
 }
开发者ID:kamaelyoung,项目名称:LongListSelectorDemo,代码行数:9,代码来源:MainPage.g.i.cs


示例6: BindLLS

 private void BindLLS(LongListSelector element)
 {
     this.lls = element;
     this.lls.ManipulationStateChanged += lls_ManipulationStateChanged;
     this.lls.MouseLeftButtonDown += lls_MouseLeftButtonDown;
     this.lls.MouseMove += lls_MouseMove;
     this.lls.ItemRealized += OnViewportChanged;
     this.lls.ItemUnrealized += OnViewportChanged;
 }
开发者ID:kaanoo2904,项目名称:Nuget.NTD,代码行数:9,代码来源:RefreshIndicator.cs


示例7: SetListUnableAndShowMessage

 public void SetListUnableAndShowMessage(LongListSelector list, TextBlock messageTextBlock, string message)
 {
     this.Dispatcher.BeginInvoke(() =>
     {
         list.Visibility = Visibility.Collapsed;
         messageTextBlock.Text = message;
         messageTextBlock.Visibility = Visibility.Visible;
     });
 }
开发者ID:pinthecloud,项目名称:pin_the_cloud,代码行数:9,代码来源:PtcPage.cs


示例8: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/SACIS;component/Pages/Messages/Inbox/Inbox.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.LLsMensagens = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("LLsMensagens")));
 }
开发者ID:burnermanx,项目名称:sacis-wp8,代码行数:9,代码来源:Inbox.g.i.cs


示例9: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/MetroFanfou;component/UserControls/MessageList.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.DataListBox = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("DataListBox")));
 }
开发者ID:chwzou,项目名称:WP7Fanfou,代码行数:9,代码来源:MessageList.g.cs


示例10: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Inviticus;component/Immunization.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.ImmunizationList = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("ImmunizationList")));
 }
开发者ID:edwardkawuma,项目名称:inviticus,代码行数:10,代码来源:Immunization.g.cs


示例11: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PsychicTest;component/View/Score.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.LstHighScore = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("LstHighScore")));
 }
开发者ID:kiendev,项目名称:PsychicTest,代码行数:10,代码来源:Score.g.i.cs


示例12: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Map%20Application%20With%20Google%20API;component/HomePage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.longlist = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("longlist")));
 }
开发者ID:koustuvsinha,项目名称:findmybus,代码行数:10,代码来源:HomePage.g.i.cs


示例13: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/site2App.WP8;component/SharePage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.ListSelector = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("ListSelector")));
 }
开发者ID:Kevnz,项目名称:wat,代码行数:10,代码来源:SharePage.g.cs


示例14: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PocketSphinxWindowsPhoneDemo;component/PlaylistPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.AddrSong1 = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("AddrSong1")));
 }
开发者ID:sikyurabmt,项目名称:HQL,代码行数:10,代码来源:PlaylistPage.g.i.cs


示例15: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/map-routing;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.MyMap = ((Microsoft.Phone.Maps.Controls.Map)(this.FindName("MyMap")));
     this.RouteLLS = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("RouteLLS")));
 }
开发者ID:iamatsundere,项目名称:test-map,代码行数:10,代码来源:MainPage.g.cs


示例16: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Sci-Time;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.YearRange = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("YearRange")));
     this.recents = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("recents")));
 }
开发者ID:ujaiswal,项目名称:Sci_Time_Windows_Phone,代码行数:10,代码来源:MainPage.g.cs


示例17: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/MusicPlayer;component/PlayList/ListPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.pivot = ((Microsoft.Phone.Controls.Pivot)(this.FindName("pivot")));
     this.lls = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("lls")));
 }
开发者ID:jevonsflash,项目名称:MusicPlayer,代码行数:10,代码来源:ListPage.g.i.cs


示例18: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PCWINDOWS;component/UnitConverter.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ListHeader = ((System.Windows.Controls.TextBlock)(this.FindName("ListHeader")));
     this.StateListBox = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("StateListBox")));
 }
开发者ID:sabarinadhamara,项目名称:PCWindows,代码行数:10,代码来源:UnitConverter.g.i.cs


示例19: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/PhoneApp4;component/6Rzgowska-Kurczaki.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel = ((System.Windows.Controls.ScrollViewer)(this.FindName("ContentPanel")));
     this.lista = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("lista")));
 }
开发者ID:kamilpiwo,项目名称:WPMobileMPK,代码行数:10,代码来源:6Rzgowska-Kurczaki.g.cs


示例20: LongListSelectorOberserver

		public LongListSelectorOberserver(LongListSelector lls)
		{
			this.lls = lls;
			viewportControl = FindViewport(lls);
			lls.ItemRealized += LLS_ItemRealized;
			lls.ItemUnrealized += LLS_ItemUnrealized;
			//lls.ManipulationStateChanged += LLS_ManipulationStateChanged;
			//lls.ManipulationDelta +=lls_ManipulationDelta;
			//lls.MouseMove += listbox_MouseMove;
		}
开发者ID:fuchu,项目名称:LightNovelClientWindows,代码行数:10,代码来源:ChapterViewPage.xaml.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Controls.Panorama类代码示例发布时间:2022-05-26
下一篇:
C# Controls.ListPicker类代码示例发布时间: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