-
May 9th, 2013, 01:36 AM
#1
[RESOLVED] WPF: Binding to IEnumerator?
I have two buttons, (next button and previous button) that moves to the next or previous record, I am using IEnumerator for this and added the MovePrevious method. Upon moving records, I am manually populating the data of this FlowDocumentPageViewer. I am thinking, is there a way that I can just bind the FlowDocumentPageViewer to a collection or something so that when I traverse records then it will automatically reflected in the viewer?
Thanks!
-
May 9th, 2013, 02:45 AM
#2
Re: WPF: Binding to IEnumerator?
You should probably be using some class derived from CollectionView, e.g. ListCollectionView for IList data sources. You bind your list to it and bind it to your controls and it provides the navigation. I've not used WPF much so I don't know all the details but I believe that you can use a CollectionViewSource in XAML.
-
May 9th, 2013, 01:55 PM
#3
Re: WPF: Binding to IEnumerator?
You could put all record in an (invisible) listview and bind the FlowDocumentPageViewer to the selectedItem property
-
May 10th, 2013, 01:03 AM
#4
Re: WPF: Binding to IEnumerator?
Originally Posted by Lightning
You could put all record in an (invisible) listview and bind the FlowDocumentPageViewer to the selectedItem property
Somehow I've considered doing that but I thought it maybe ugly. Looking at CollectionView for now, I hope it will work in my case.
-
May 10th, 2013, 01:10 AM
#5
Re: WPF: Binding to IEnumerator?
Originally Posted by Lightning
You could put all record in an (invisible) listview and bind the FlowDocumentPageViewer to the selectedItem property
That would be a complete hack and a horrible solution. Controls are for user interaction and that is all they should be used for.
-
May 10th, 2013, 11:09 PM
#6
Re: [RESOLVED] WPF: Binding to IEnumerator?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|