Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6097637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:04:00+00:00 2026-05-23T13:04:00+00:00

Using the EventToCommand behaviour that comes with MVVM Light I am binding the SelectedItem

  • 0

Using the EventToCommand behaviour that comes with MVVM Light I am binding the SelectedItem of a ListBox to a RelayCommand on a ViewModel

All works great in my Windows Phone 7 app except that after navigating away from the View with the ListBox then back the SelectedItem is the same as before. Not what I want.

I tried reseting the selected index when navigating away but that causes the Command to trigger again.

Has anyone else solved this issue and how?

TIA

Patrick Long

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:04:00+00:00Added an answer on May 23, 2026 at 1:04 pm

    I switched away from using the SelectionChanged event. Now I do it all with TapGestures. Downside of this is that TapGesture does not work with EventToCommand behaviour so I am trapping the Gesture event in the View and firing the Command that is bound to the DataContext of the Sender.

    IMHO this is a lot neater than using SelctionChanged and mucking about with SelectedIndexes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the EventToCommand Class from the MVVM-light-Toolkit to handle the AutoGeneratingColumn-Event in the
I'm trying to follow this MVVM Light Toolkit V3 Alpha 2: EventToCommand behavior tutorial.
I'm using the MVVM Light Toolkit and I have a DataGrid bound to an
I am using MVVM in my application and binding combobox to my collection. However
I am making one application in MVVM using Galasoft MVVM Light toolkit. However i
I've data bound a ListBox in my MVVM Light Windows Phone 7 app, and
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
I have ViewModel, Which has a ObservableCollection[Employee] EmpCol , now that ViewModel is bind

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.