iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have bindings set up with an autoincremental search using the UXSearchBox. I follow the samples pretty closely except that I am actually using a service call to populate the SearchResult.
While I do need to navigate to a different page once a selection is made (just as the samples do) I also need to execute some code that uses the SelectedItem value (once again I am binding that using a ViewModel).
My question is, then, what event fires after the user locks in a selection? The SelectionChanged event occurs while a user navigates through the dropdown...there is no Selecteditem chosen yet. I tried the Closed event but that doesn't seem to fire for some reason.
I have been able to use the KeyUp event and filter for the Enter key, so I can get the SelectedItem if the user isn't using the mouse to select an item from the dropdown. I've tried to use LeftMouseButtonUp to capture the selection with the mouse but that hasn't worked for me.
So, is there an event specific to the UXSearchBox that I can use to execute some code upon the actual locked-in selection of an item from the dropdown and to then navigate to another page? If not, could someone tell me how to get the Closed event or even the MouseLeftButtonUp event to work to capture that selected item?
Thanks for any help at all.
Hello,
Unfortunately, that is already our SelectedChanged event. For SelectedItem, it's true that we don't have this event. Normally, for SelectedItem, we used binding in SelectedItem property.e.g
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
For simple sample, I suggest you to see our ListBox sample. It shows a simple way how to implement SelectedItem binding.
Regards,Handy
Handy
Thanks for the quick response, but I'm already binding SelectedItem as you have described. Here is a brief summary of the problem I face and why I want to execute code upon selection.
I am using the UXSearchBox as a globally available incremental search control. It sits on the main page toolbar and there are frames that appear as separate pages as they are navigated to within the application. So, once a selection is chosen from the UXSearchBox, I want to set an application-level property to the object represented by the selected item from the search. Then I want to navigate to a page that will in turn use that object to populate itself and to further call for other data from our services related to the ID of that object.
Right now it looks like the only alternative I may have is to use a ViewModel that is globally available and attach that to the DataContext of the search control. In other words, instantiate this global ViewModel at app startup and pass it along to the search conrol in some way.
Any other ideas?
Yes, your current technique is correct. Or you can also try to access into your application level by using Application.Resource["your viewmodel.datacontext"].Regards,Handy
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname