Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Clicking image in Carsousel
posted

How do you open another Window, Page, etc. by clicking on an image that is in xamCarouselPanel?

Parents
No Data
Reply
  • 54937
    Offline posted

    This question was originally posted and responded to on the archives forums. You can see that post here: http://tinyurl.com/29z68x

    I'm copying that response here:

    This isn't really specific to the XamCarouselPanel but basically you need to
    use a Hyperlink.

    e.g.
    <Window x:Class="Test"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:igWindows="http://infragistics.com/Windows"
      xmlns:igEditors="http://infragistics.com/Editors"
      xmlns:igDP="http://infragistics.com/DataPresetner"
        Title="Test" Height="300" Width="300"
        >
    <Grid>
      <igWindows:XamCarouselPanel Hyperlink.RequestNavigate="OnNavigate">
       <TextBlock>
        <Hyperlink NavigateUri="http://es.infragistics.com">
         <Image Source="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg" Width="50" />
        </Hyperlink>
       </TextBlock>
      </igWindows:XamCarouselPanel>
      <x:Code>
      <![CDATA[
        void OnNavigate(object sender, RoutedEventArgs e)
        {
       RequestNavigateEventArgs rn = e as RequestNavigateEventArgs;
       string uri = rn.Uri.ToString();
       System.Diagnostics.Process.Start(uri);
       e.Handled = true;
        }
       ]]>
      </x:Code>

    </Grid>
    </Window>

    Note, I embedded the code to handle the RequestNavigate in the xaml just for
    simplicity in this example. You would normally have this in the code behind
    file - or it might not be necessary to handle the event if you're using this
    in an xbap, etc.

Children
No Data