1
votes

The default behaviour for a ListBox used in a WP7 application is for the selected item to be highlighted in the PhoneAccentBrush. I am finding that with a ListBox that when I handle the SelectionChanged event (sets a property and closes popup that contains the ListBox) I never see the text color change to the PhoneAccentBrush - so the user never gets any feedback that they have selected the correct item. Is there a way to work around this and give the user feedback (even though it will only be momentary) as to which item they have selected.

2
I'm not very sure what you mean, the listBox.selectedItem is highlighted. Maybe you can try to have the item within the listBox datatemplate. - Nghia Nguyen
If you close the "popup that contains the listbox" when you select an item in the listbox what would be left to show the selection anyway? - Matt Lacey
With the delayed SelectionChaged (my answer below) the user has a visual feedback. It is a short instant, but long enough to make an impression on the user. - Jan Slodicka

2 Answers

1
votes

Delay your handling of SelectionChanged event, for example

void list_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    Dispatcher.BeginInvoke(action);
}

void action()
{
    // put your code here
}
0
votes

Take the Silverlight toolkit and add a tilt effect (push animation like in other apps).

Reference the toolkit in your project and add the namespace to use the toolkit:

<phone:PhoneApplicationPage 
    ...
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit">

In your datatemplate add the attached property IsTiltEnabled:

<DataTemplate>
    <Grid toolkit:TiltEffect.IsTiltEnabled="True">
        ...
    </Grid>
</DataTemplate>