WPF Record Navigator (VCR) Control

I haven’t seen any examples of a record navigator in WPF so I decided to create one.

What it is:

  • Allows you to bind to a collection of elements and navigate through each one.

What it isn’t:

  • Currently it doesn’t have any hooks for styling.
  • The Current Index is read-only and can only be navigated using the buttons.

The implementation is pretty straight forward. It uses routed commands to handle all the navigation. The trick to making the implementation simple was to forward everything on to a ListBox. The template contains a ListBox named “PART_List” which has it’s visibility set to Collapsed. This allows me to bind the TextBlocks that display the Count and Current Position directly to the ListBox. Also for all of the navigation commands, the Command Executed handlers simply forward their calls to the corresponding methods on the ListBox. The ListBox also just binds it’s ItemsSource and IsSynchronizedWithCurrentItem directly to the corresponding Dependency Properties on the RecordNavigator.

I hope this control is useful to some of you. I’ll be further refining it to support styling and allow the user to jump to a specific index. Please give me any feedback you have. If there is any bugs or anything it should do that it doesn’t, please let me know.

Download

You can download the code here: record-navigator. Make sure to change the extension from .doc to .zip.

kick it on DotNetKicks.com

Advertisements

2 Responses to WPF Record Navigator (VCR) Control

  1. Rajat says:

    Hi, I was looking for a BingingNavigator control in WPF , and after much search found your blog. Your control looks quite promising. I was wondering if you have come up with an enhanced version which supports styling also.
    Please let me know. I will be very keen to see that..

    Regards,
    Rajat

  2. Kamal says:

    Hi

    Thanks for posting nice article. I like to include combobox in navigator control and I have an issue with SelectionChanged event with command binding.Please let me know if have an idea.
    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: