Hi all,
I'm trying to use a List of custom class to fill the itemsSource of RadCarousel.
This is the code of Page1.xaml:
And this is the code to fill the RadCarousel Page1.xaml.vb:
When I run the application appears 10 radcarousel items but the labels with the property Apellidos still empty... what's wrong?
Thank's in advance.
Gerard
I'm trying to use a List of custom class to fill the itemsSource of RadCarousel.
This is the code of Page1.xaml:
<Page x:Class="Page1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
xmlns:carousel="clr-namespace:Telerik.Windows.Controls.Carousel;assembly=Telerik.Windows.Controls.Navigation" |
Title="Page1"> |
<Grid> |
<telerik:RadCarousel x:Name="carPacientes" HorizontalAlignment="Stretch" |
VerticalAlignment="Stretch" Background="Black" AutoGenerateDataPresenters="False" Foreground="White"> |
<telerik:RadCarousel.Resources> |
<Style TargetType="telerik:CarouselItem"> |
<Setter Property="Template"> |
<Setter.Value> |
<ControlTemplate TargetType="telerik:CarouselItem"> |
<Label Content="{Binding Path=Apellidos}" FontSize="12" Foreground="Black" Background="Aqua" /> |
</ControlTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
</telerik:RadCarousel.Resources> |
</telerik:RadCarousel> |
</Grid> |
</Page> |
And this is the code to fill the RadCarousel Page1.xaml.vb:
Imports MDOL.Business.Logic |
Partial Public Class Page1 |
Public Shared opcion As String |
Public Sub New() |
InitializeComponent() |
Dim pacs As List(Of Paciente) = New List(Of Paciente) |
Dim pac As Paciente = Nothing |
For i = 1 To 10 |
pac = New Paciente |
pac.IdPaciente = Convert.ToString(i) |
pac.Nombre = "Gerard" |
pac.Apellidos = "Subirana" |
pacs.Add(pac) |
pac = Nothing |
Next |
Me.carPacientes.ItemsSource = pacs |
End Sub |
End Class |
When I run the application appears 10 radcarousel items but the labels with the property Apellidos still empty... what's wrong?
Thank's in advance.
Gerard