winrt unselect ListView Item when click outside - xaml

How can I unselect all ListView items when I click outside the ListView in xaml for Windows Store Application?
When I add handlers to LostFocus event I unselect all but in case when I just want to chenge selected item LostFocus event also triggers.
Can anyone share the solution of this problem?

How about waiting a bit after LostFocus to see if it was indeed lost. Like by calling RunAsync on Dispatcher? Seems a bit like a hack, but it could work.

Related

Button click inside repeater UpdatePanel problem

I have button inside of repeater in a contentpage.
How can I use update panel with that?
I want to make that,
Button click inside a repeater triggers itemcommand function and after that not posstback refresh.
Best regards
Do you want this result?
Microsoft officially gave some good cases, you can refer to the following:
Specify and code handlers for the ItemCommand event of the Repeater control

RadDesktopAlert Click Event

Working with the RadDesktopAlert WinForms component by Telerik, I am wondering how can I perform an action when the user clicks anywhere on the alert window.
To put it blunt, the buttons suck, and it is much more natural (easier) for a user to just click anywhere in the window. I checked the basics, and there doesn't appear to be an event for "Click", nor does it appear to expose it's Hwnd or Handle.
The events that are available are
Closed
Closing
Disposed
Disposing
Opened
Opening
PropertyChanged
RadPropertyChanged
RadPropertyChanging
The problem with the buttons is the UI looks wacky when trying to right-align, and the "click" event doesn't fire unless you click well inside the button - TWICE. So using the Buttons are not an option. What I am looking for is a place to write code that runs when the user clicks anywhere on the RadDesktopAlert box.
Thanks in advance.
The RadDesktopAlert component, has a Popup property, which holds the actual popup element. You can use its Click event for the purpose:
AddHandler radDesktopAlert1.Popup.Click, AddressOf Popup_Click

What is another alternative to `TextChanged` event

I am working in windows form and have a few textboxes on a form.
These textboxes from top to bottom are connected, so if the text changes in textbox1, then txtbox2 and txtbox3 have to comply, if something changes in textbox2 then 3 has to comply;... and so on ... not going to bore you.
Now I was looking for an alternative, more efficient way of calling the textchanged event on the textboxes so it doesn't do everything everytime, even if one charater has changed....
Something like focus off textbox event ... or some other alternative .
This would be in vb.net and windows form.
You can use the TextBox.LostFocus event inherited from Control.LostFocus.
This event is fired when the control looses focus, like Tab or clicked on another control.
TextBox1.LostFocus perhaps? Or enable validation on the controls.
Control focus event order:
http://msdn.microsoft.com/en-gb/library/system.windows.forms.control.lostfocus.aspx
CausesValidation:
http://msdn.microsoft.com/en-gb/library/system.windows.forms.control.causesvalidation.aspx

vb.net Listview selectedItemChanged event fires when trying to select already selected item

Anyone has a clue what might go wrong? This behaviour happens after I make some changes in the grid that associates properties to the items in the listview, select a different item, at save prompt I cancel and revert the selection, now if I try to select the already selected item event fires. I dont know why.
I do change the selection programatically when I revert the selection if I cancel at the save promt.
I managed to reproduce this problem. It's resolved if you set the MultiSelect property to false. However, if you need multiple selections, another solution will be needed.
A UserControl 'wrapper' around the ListView that handles the SelectedItemChanged event and only responds if the item is different is an option.

Setup listbox selectedItem event in Expression Blend

I am trying to learn to use Expression Blend to build SilverLight UI. I am currently working with the ListBox and have managed to add it to my page. In addition, the list box is data-bound to a sample data source defined in Blend.
But I am unable to figure out how to wire up the selectedItem event in Blend. Is this not possible in Blend and do I need to do this part in Visual Studio?
If you select the ListBox, go to the Properties Pane. Next to the Name of the control there are two buttons - Properties and Events. If you click on the Events button it will switch to showing you all of the Events, of which the SelectionChanged event is listed. Note that there is not a "SelectedItem" event, only the SelectionChanged event. The SelectedItem property represents the currently selected item of the ListBox.
Hope that helps.