This question is locked. New answers and comments are not allowed.
I have a SlideView with several items inside and I want to navigate to a new page depending of the item selected.
For example, I tap item1 and it navigates to page1 but if I tap the item2 it should navigate to page2, and so on...
Here is my xaml:
For example, I tap item1 and it navigates to page1 but if I tap the item2 it should navigate to page2, and so on...
Here is my xaml:
<
telerikPrimitives:RadSlideView
x:Name
=
"slideViewApps"
Margin
=
"0"
ItemsSource
=
"{Binding}"
ItemRealizationMode
=
"ViewportItem"
CacheMode
=
"BitmapCache"
Tap
=
"slideViewApps_Tap"
>
<
telerikPrimitives:RadSlideView.ItemTemplate
>
<
DataTemplate
>
<
Grid
>
<
Image
Source
=
"{Binding AppsImagePath}"
Stretch
=
"None"
Grid.Row
=
"1"
Margin
=
"0"
/>
<
TextBlock
Text
=
"{Binding AppsTitle}"
FontSize
=
"{StaticResource PhoneFontSizeExtraLarge}"
Margin
=
"24,280,0,0"
/>
</
Grid
>
</
DataTemplate
>
</
telerikPrimitives:RadSlideView.ItemTemplate
>
<
telerikPrimitives:RadSlideView.ItemPreviewTemplate
>
<
DataTemplate
>
<
TextBlock
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Text
=
"{Binding AppsDescription}"
FontSize
=
"{StaticResource PhoneFontSizeLarge}"
/>
</
DataTemplate
>
</
telerikPrimitives:RadSlideView.ItemPreviewTemplate
>
and my C#
public StartPage()
{
InitializeComponent();
string[] appnames = { "Shazam", "Coachs's Eye", "Files and Folders Pro" };
string[] gamenames = { "Fifa 15", "Poker", "Tetris" };
List<
ViewModel
> items = new List<
ViewModel
>();
for (int i = 1; i <= 3; i++)
{
ViewModel model = new ViewModel()
{
AppsTitle = "#" + i + " " + appnames[i-1],
AppsImagePath = "ImagesApps/" + i + ".jpg",
AppsDescription = "best app of the week " + "# " + i,
GamesTitle = "#" + i + " " + gamenames[i - 1],
GamesImagePath = "ImagesGames/" + i + ".jpg",
GamesDescription = "best game of the week " + "# " + i
};
items.Add(model);
}
this.DataContext = items;
}
private void slideViewApps_Tap(object sender, GestureEventArgs e)
{
////////jump to a page depending of selection ???????????
this.NavigationService.Navigate(new Uri("/AppsView/App1.xaml", UriKind.RelativeOrAbsolute));
}
public class ViewModel
{
public string AppsTitle
{
get;
set;
}
public string AppsImagePath
{
get;
set;
}
public string AppsDescription
{
get;
set;
}
public string GamesTitle
{
get;
set;
}
public string GamesImagePath
{
get;
set;
}
public string GamesDescription
{
get;
set;
}
}
Any idea how can I perform this.
Thanks in advance,
Joaquim