Hi,I'm trying to add Items to a RadCarouselPanel through Code, But I'm having trouble...
This is my code:
...
<telerik:RadCarouselPanel Name="imgPicker" ItemsMovementAnimationDuration="0:0:0.5"
ItemsPerPage="11" PathPadding="70,50,70,50" IsOpacityEnabled="True"
IsScalingEnabled="True" IsSkewAngleYEnabled="True" Height="100" MinHeight="100" >
<telerik:RadCarouselPanel.Path>
<Path HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" Data="M 0,300 C0,300 500,300 500,300 " />
</telerik:RadCarouselPanel.Path>
<telerik:RadCarouselPanel.SkewAngleYStops>
<telerik:PathStopCollection>
<telerik:PathStop PathFraction="0.15" Value="-15" />
<telerik:PathStop PathFraction="0.45" Value="-15" />
<telerik:PathStop PathFraction="0.5" Value="0" />
<telerik:PathStop PathFraction="0.55" Value="15" />
<telerik:PathStop PathFraction="0.85" Value="15" />
</telerik:PathStopCollection>
</telerik:RadCarouselPanel.SkewAngleYStops>
<telerik:RadCarouselPanel.ScaleStops>
<telerik:PathStopCollection>
<telerik:PathStop PathFraction="0.4" Value="1.0" />
<telerik:PathStop PathFraction="0.5" Value="1.5" />
<telerik:PathStop PathFraction="0.6" Value="1.0" />
</telerik:PathStopCollection>
</telerik:RadCarouselPanel.ScaleStops>
<telerik:RadCarouselPanel.OpacityStops>
<telerik:PathStopCollection>
<telerik:PathStop PathFraction="0.0" Value="0.0" />
<telerik:PathStop PathFraction="0.1" Value="1.0" />
<telerik:PathStop PathFraction="0.9" Value="1.0" />
<telerik:PathStop PathFraction="1.0" Value="0.0" />
</telerik:PathStopCollection>
</telerik:RadCarouselPanel.OpacityStops>
</telerik:RadCarouselPanel>
...
And my CodeBehind:
public MainWindow ()
{
InitializeComponent();
imageList = new List<BitmapImage>();
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"Imgs/OCR1.TIF", UriKind.RelativeOrAbsolute);
bi.EndInit();
imageList.Add(bi);
bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"Imgs/OCR2.TIF", UriKind.RelativeOrAbsolute);
bi.EndInit();
imageList.Add(bi);
bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"Imgs/OCR3.TIF", UriKind.RelativeOrAbsolute);
bi.EndInit();
imageList.Add(bi);
imgPicker.DataContext = imageList;
}
Is this the right way to do this?
My panel is not showing anything =/
This is my code:
...
<telerik:RadCarouselPanel Name="imgPicker" ItemsMovementAnimationDuration="0:0:0.5"
ItemsPerPage="11" PathPadding="70,50,70,50" IsOpacityEnabled="True"
IsScalingEnabled="True" IsSkewAngleYEnabled="True" Height="100" MinHeight="100" >
<telerik:RadCarouselPanel.Path>
<Path HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" Data="M 0,300 C0,300 500,300 500,300 " />
</telerik:RadCarouselPanel.Path>
<telerik:RadCarouselPanel.SkewAngleYStops>
<telerik:PathStopCollection>
<telerik:PathStop PathFraction="0.15" Value="-15" />
<telerik:PathStop PathFraction="0.45" Value="-15" />
<telerik:PathStop PathFraction="0.5" Value="0" />
<telerik:PathStop PathFraction="0.55" Value="15" />
<telerik:PathStop PathFraction="0.85" Value="15" />
</telerik:PathStopCollection>
</telerik:RadCarouselPanel.SkewAngleYStops>
<telerik:RadCarouselPanel.ScaleStops>
<telerik:PathStopCollection>
<telerik:PathStop PathFraction="0.4" Value="1.0" />
<telerik:PathStop PathFraction="0.5" Value="1.5" />
<telerik:PathStop PathFraction="0.6" Value="1.0" />
</telerik:PathStopCollection>
</telerik:RadCarouselPanel.ScaleStops>
<telerik:RadCarouselPanel.OpacityStops>
<telerik:PathStopCollection>
<telerik:PathStop PathFraction="0.0" Value="0.0" />
<telerik:PathStop PathFraction="0.1" Value="1.0" />
<telerik:PathStop PathFraction="0.9" Value="1.0" />
<telerik:PathStop PathFraction="1.0" Value="0.0" />
</telerik:PathStopCollection>
</telerik:RadCarouselPanel.OpacityStops>
</telerik:RadCarouselPanel>
...
And my CodeBehind:
public MainWindow ()
{
InitializeComponent();
imageList = new List<BitmapImage>();
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"Imgs/OCR1.TIF", UriKind.RelativeOrAbsolute);
bi.EndInit();
imageList.Add(bi);
bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"Imgs/OCR2.TIF", UriKind.RelativeOrAbsolute);
bi.EndInit();
imageList.Add(bi);
bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"Imgs/OCR3.TIF", UriKind.RelativeOrAbsolute);
bi.EndInit();
imageList.Add(bi);
imgPicker.DataContext = imageList;
}
Is this the right way to do this?
My panel is not showing anything =/