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


C# Controls.LongListSelector类代码示例

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


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


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