IsSelected

Mar 23, 2010 at 10:00 PM
Edited Mar 24, 2010 at 3:40 PM

I'm trying to have something show only when IsSelected. Here's a quickie example

<c:CoverFlowControl.ItemTemplate>
   <DataTemplate>
      <Grid Visibility="{Binding IsSelected, Converter{StaticResource visConv}}">

Yet when you bind to IsSelected they all show up. Is this correct?

I was even going to try it in the SelectedItemChanged in the control itself, but that just dies on build:
Error > No overload for 'flowControl_SelectedItemChanged' matches delegate 'SelectedItemChangedEvent

Generated function example:

void flowControl_SelectedItemChanged(CoverFlowEventArgs e)

Any ideas? Just want to show something only on the frontmost selected item.

Feb 8, 2012 at 3:48 PM

use on the fly add event handler as below:

 

public MainPage()

flowControl.ItemsSource = trailers;

KeyDown += flowControl.OnKeyDown;

media.MediaEnded += new RoutedEventHandler 

(media_MediaEnded);
 

media.MediaFailed +=new EventHandler<ExceptionRoutedEventArgs 

>(media_MediaFailed);  

media.BufferingProgressChanged +=new RoutedEventHandler

(media_BufferingProgressChanged);

MouseWheel +=new MouseWheelEventHandler

(MainPage_MouseWheel);

Loaded +=new RoutedEventHandler

(MainPage_Loaded);

flowControl.SelectedItemChanged += new SelectedItemChangedEvent

(flowControl_SelectedItemChanged);

 

}

 

 

{

InitializeComponent();

trailers =new ObservableCollection<MovieTrailer>();