Tag: longlistselector

分组LongListSelector:标题出现,项目不出现

C#中的WinPhone 8项目。 我正在尝试填充分组列表。 显示组标题,但项目不显示。 相关代码是: class MyPage { public class Group : IGrouping { public string Title{get;set;} public string[] Items; public string Key { get { return Title; } } public IEnumerator GetEnumerator() { return (Items as IEnumerable).GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return Items.GetEnumerator(); } } private Group[] m_ItemGroups = { new Group(){Title = “A”, […]

如何使用CollectionViewSource对LongListSelector进行排序

我有一个LongListSelector ,当前正在填充来自IsolatedStorage图像。 我希望能够按日期按升序或降序对这些进行排序。 我一直在参考http://babaandthepigman.wordpress.com/2011/07/03/wp7-collectionviewsource-sorting-a-listbox/寻求帮助。 出于某种原因,我无法将LongListSelector的ItemsSource绑定到CollectionViewSource以实现排序function。 PictureRepository.cs(在应用程序启动时从IsolatedStorage加载图片) #region Constants public const string IsolatedStoragePath = “Pictures”; #endregion #region Properties public ObservableCollection Pictures { get; private set; } #endregion #region Singleton Pattern private PictureRepository() { LoadAllPicturesFromIsolatedStorage(); } public static readonly PictureRepository Instance = new PictureRepository(); #endregion /// /// Saves to local storage /// This method gets two parameters: […]

如何在Windows Phone中对LongListSelector进行排序

我希望能够按升序或降序对绑定到LongListSelector的数据进行排序。 我无法将排序数据绑定到我的LongListSelector。 最初没有尝试实现排序,我的解决方案正在运行,但我相信在涉及排序时我遗漏了一些东西。 我还尝试了如何使用CollectionViewSource对LongListSelector进行排序而没有运气。 排序LongListSelector的最佳方法是什么? MainPage.xaml中 MainPage.xaml.cs(OLD) protected override void OnNavigatedTo(NavigationEventArgs e) { Recent.ItemsSource = App.PictureList.Pictures; //works! if (Settings.AscendingSort.Value) { //Recent.ItemsSource = App.PictureList.Pictures.OrderBy(x => x.DateTaken); //Error stating Cannot implicityly convert type ‘SYstem.Linq.IOrderedEnumerable to System.Collections.IList Recent.ItemsSource = App.PictureList.Pictures.OrderBy(x => x.DateTaken) as System.Collections.IList; //No error but nothing is displayed } else { //Recent.ItemsSource = App.PictureList.Pictures.OrderByDescending(x => x.DateTaken); […]

在Windows Phone 8中键盘打开时如何调整屏幕?

我在Windows Phone 8中工作。在我的应用程序的一个页面中有一个LongListSelector ,在它下面有一个TextBox 。 当TextBox聚焦时,键盘会打开。 当键盘打开时, LongListSelector向上移动键盘高度。 如果我通过键盘的偏移来保持LongListSelector的边距,那么LongListSelector的一些项目会在键盘下面。 我想要做的就是当键盘显示然后边缘将被更新,并且LongListSelector的前一个焦点项不应该在键盘下。 在这里,我不想使用ScrollTo()函数来滚动LongListSelector的特定项。 任何建议或帮助将不胜感激。

具有列表项选择样式的LongListSelector

我正在使用Windows Phone 8,我有Longlist选择器,其中包含很少的项目。 我使用下面的代码突出显示列表框中的所选项目。但我想要为LongListSelector实现相同的效果。 怎么做 ?

如何制作带有图像和字符串的Windows Phone应用程序LongListSelecter

我做了一个简单的长列表选择器应用程序没有跳转标题或标题模板。 我经历了漫长的旅程后进入谷歌和堆栈溢出。 我很满意。 该应用程序仅包含显示名称的文本块 – 如名字姓氏电话号码,但我需要添加照片,以及如何显示图片以及名称的代码。 我搜索很多无法得到一个正确的解决方案是我的代码: namespace listparee6 { public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); List speeddial = new List(); speeddial.Add(new SpeedDial ( “deepu”, “43” )); speeddial.Add(new SpeedDial ( “anoop”,”32″ )); speeddial.Add(new SpeedDial ( “abhilash”,”76″ )); SpeedDialLLS.ItemsSource = speeddial; […]

如何在LongListSelector中突出显示所选项

我想在我的LongListSelector中显示当前所选项目周围的边框。 我为我的LongListSelector设置了一个ItemTemplate,但我不确定如何修改Border以便只有当前选中的项包含边框。 MainPage.xaml中 … 目前, LongListSelector所有项都显示边框。 我宁愿在后面的代码中修改它,但到目前为止我没有工作 MainPage.xaml.cs中 private void recent_SelectionChanged(object sender, SelectionChangedEventArgs e) { var item = sender as LongListSelector item.BorderBrush = App.Current.Resources[“PhoneAccentBrush”] as SolidColorBrush; } 有任何想法吗?

保持事件Longlistselector

HEJ 我想创建一个标准的holdevent。 当您持有元素时,会出现一些您可以选择的选项,如新列表。 你是如何创造这个的,它只是简单地用弹出窗口完成还是有更聪明的方法? 额外 找到答案后,请参阅下面的答案,一些不错的信息是: 将上下文创建放在hold事件中。 然后,您可以根据项目更改为不同的上下文菜单。 您可以通过以下方式获取所持有的项目 private void StackPanel_Hold(object sender, GestureEventArgs e) { ItemViewModel itemViewModel = (sender as StackPanel).DataContext as ItemViewModel; string t = itemViewModel.LineOne; } 和 一个易于实现的好链接也是下面的youtube链接,在这里复制: Youtube

Windows Phone 8里面的LongListSelector内存泄漏图片

我有一个LongListSelector,它包含一个从Web加载大量图像的图像控件,这个工作正常一段时间,但是在我加载了一些图像后,我得到了内存exception。 我读过其他人对于内存不足以及大量图片有相同问题,但仍然没有找到解决方案。 我已经读过它与image / BitmapImage缓存有关。 这是我的LongListSelector,它包含图像控件: 在我的MainPage.xaml.cs中,我设置了LongListSelector的DataContext: llsGameList.DataContext = gd.GetGamesListItems; 这是我用来存储我的图像的类: public class GetGamesList { public Uri BoxArtFrontThumb { get; set; } } 这是包含所有图像的ObservableCollection: private ObservableCollection _GetGamesListItems = new ObservableCollection(); public ObservableCollection GetGamesListItems { get { return this._GetGamesListItems; } } 我希望我能清楚地解释清楚。 我真的希望有人可以帮助我解决这个记忆问题。 谢谢。

在LongListSelector中绑定数据

我指的是这里的例子: http : //dotnet.dzone.com/articles/using-longlistselector-control 这是我的代码: public class Chapters { private string mainTitle; public string MainTitle { get { return mainTitle; } set { mainTitle = value; } } private List subTitle; public List SubTitle { get { return subTitle; } set { subTitle = value; } } } private static IEnumerable GetCityList() { return myList; […]