collectionview

How to get real count of a CollectionView, when Filter is in use?

青春壹個敷衍的年華 提交于 2020-01-04 01:57:20
问题 When I have a <Label Content="{Binding ItemCount}"/> on my View to bind to a property on the ViewModel. On the viewmodel I have the property defined as public int ItemCount { get { RowViewModelsCollectionView.Count; } } I am clearly asking for count on the CollectionView , where I am expecting to get the count of only visible items. Unfortunately I get the count of the entire rows, even the ones not showing on the view due the filter. Update: in Ctor: RowViewModelsCollectionView= new

swift iOS - UICollectionView images mixed up after fast scroll

只愿长相守 提交于 2019-12-30 08:16:01
问题 I am new to swift and iOS programming, but I have been able to build a mostly stable starting interface for my application in Xcode. The CollectionView grabs an image and text from an array of dictionaries created from a csv file on my home network server. The cvs file contains data in the following format (note, urls have been changed to protect licensed images): csv file csv file is @ url https://myserver.com/csv.txt and contains the following Title";"SeriesImageURL Title1";"https:/

swift iOS - UICollectionView images mixed up after fast scroll

笑着哭i 提交于 2019-12-30 08:15:09
问题 I am new to swift and iOS programming, but I have been able to build a mostly stable starting interface for my application in Xcode. The CollectionView grabs an image and text from an array of dictionaries created from a csv file on my home network server. The cvs file contains data in the following format (note, urls have been changed to protect licensed images): csv file csv file is @ url https://myserver.com/csv.txt and contains the following Title";"SeriesImageURL Title1";"https:/

Images arent shown in my collectionviewcells. iOS(swift)

孤街浪徒 提交于 2019-12-25 07:58:36
问题 I got an array with all the images i got from the camera. They are saved in my coreData. If a user takes a new photo, the photo will be saved in the core data and then i replace the normal array data with the coreData images. So if i go back to the collection view, only the first and the last image is shown. When i print the images[indexpath.item] out i got the images. But they arent shown in the cells. I have a custom class for the imageView in the cell and the imageView has constraints, so

How to filter a TreeView in WPF?

送分小仙女□ 提交于 2019-12-24 22:09:35
问题 I'm having troubles doing filtering on a WPF TreeView. Here is my TreeView XAML: <TreeView x:Name="ResourcesTreeView" ItemsSource="{Binding Path=FilteredResources}"> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type models:HierarchicalResource}" ItemsSource="{Binding ContainedResources}"> <StackPanel Orientation="Horizontal"> <Image Source="{Binding ResourceIdentifier.ResourceType, Converter={StaticResource ResourceTypeToIconConverter}}" Stretch="Uniform" Height="23"

Adding a static cell to a UICollectionView

痴心易碎 提交于 2019-12-24 16:29:01
问题 I have a UICollectionView that displays cells from an array. I want the first cell to be a static cell that serves as a prompt to segue into a create flow (eventually adding a new cell). My approach would have been to add two sections to my collectionView, but I currently can't figure out how to return a cell within cellForItemAtIndexPath if I do so. This is my attempt: func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell

How to destroy or detach a CollectionView

流过昼夜 提交于 2019-12-23 20:03:23
问题 I observe an odd behaviour of WPF ItemsControls: If a set the ItemsSource to an object which implements INotifyCollectionChanged and after that set the ItemsSource to null, the CollectionView which was created to provide the data to the ItemsControl still listens to the CollectionChanged -event of the source object. If now the source collection is changed through a different thread, the CollectionView throws an exception (without being attached to any control). While I understand why this is

How to create customized UICollectionView with 2 or more custom cells?

无人久伴 提交于 2019-12-22 03:16:11
问题 in my project I want to use UICollectionView with custom cells, I created collection view with custom cells but I want to use Different size of custom cell in my project I followed some tutorials but I din`t get it properly, and below I attached sample screen shot of what i really looking for collection view. 回答1: One of the possible ways to create this is to use sizeForItemAtIndexPath and then return the size for your Cell . Here are some useful links on Github which are exactly doing what

Own CollectionView for paging, sorting and filtering

江枫思渺然 提交于 2019-12-19 10:22:25
问题 I've implemented my own CollectionView to bind a collection of data to a DataGrid in WPF. The main goal was the pagination, which is working quite well. I've written the following C# code: public class SchemesCollectionView : CollectionView { private readonly IList<Scheme> innerList; private readonly int itemsPerPage; private int currentPage = 1; public SchemesCollectionView(IList<Scheme> source, int itemsPerPage) : base(source) { innerList = source; this.itemsPerPage = itemsPerPage; } public

Binding SelectedItems of Listview

不打扰是莪最后的温柔 提交于 2019-12-17 21:18:13
问题 how can i bind SelectedItems of a ListView ? My ListView has multipleSelection attribute and I'm using CollectionView for its contents.. I've heard about Attached property and I tried implementing this with the one I found here: Sync SelectedItems in a muliselect listbox with a collection in ViewModel I can multiple select the items by clicking rows but I can't use the Shift keyboard for multi-selecting many rows instantly... Also, when I filter my collection and refresh it, my selection are