<telerik:RadCoverFlow Width=
"700"
Canvas.ZIndex=
"1200"
Grid.Row=
"1"
Grid.ColumnSpan=
"2"
OffsetY=
"60"
OffsetX=
"0"
Opacity=
"0"
ItemsSource=
"{Binding}"
x:Name=
"Cover"
SelectionChanged=
"Cover_Change"
DistanceBetweenItems=
"50"
ReflectionOpacity=
"2"
ReflectionHeight=
"0.25"
RotationY=
"45"
ItemScale=
".75"
VerticalAlignment=
"Stretch"
HorizontalAlignment=
"Left"
Margin=
"10,30,35,20"
>
<telerik:RadCoverFlow.Resources>
<Style TargetType=
"telerik:RadCoverFlowItem"
>
<Setter Property=
"telerik:RadDragAndDropManager.AllowDrag"
Value=
"True"
></Setter>
</Style>
</telerik:RadCoverFlow.Resources>
<telerik:RadCoverFlow.ItemTemplate>
<DataTemplate x:Name=
"cfDataTemplate"
>
<ContentPresenter Content=
"{Binding ObtainedImage}"
HorizontalAlignment=
"Stretch"
VerticalAlignment=
"Stretch"
telerik:RadCoverFlow.EnableLoadNotification=
"True"
></ContentPresenter>
</DataTemplate>
</telerik:RadCoverFlow.ItemTemplate>
</telerik:RadCoverFlow>
public
class
Slide
{
public
Slide()
{
public
string
ImageName {
get
;
set
; }
public
BitmapImage ObtainedBitmap {
get
;
set
; }
public
Image ObtainedImage {
get
;
set
; }
}
The images are obtained as a stream using WCF services and then bitmap images and Image objects are created from them. Everytime I bind the collection to the coverflow datacontext I get the following unhandled exception:
ExceptionObject {System.ArgumentException: Value does not fall within the expected range.
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
at System.Windows.FrameworkElement.OnTreeParentUpdated(DependencyObject newParent, Boolean bIsNewParentAlive)
at System.Windows.DependencyObject.UpdateTreeParent(IManagedPeer oldParent, IManagedPeer newParent, Boolean bIsNewParentAlive, Boolean keepReferenceToParent)
at MS.Internal.FrameworkCallbacks.ManagedPeerTreeUpdate(IntPtr oldParentElement, IntPtr parentElement, IntPtr childElement, Byte bIsParentAlive, Byte bKeepReferenceToParent, Byte bCanCreateParent)} System.Exception {System.ArgumentException}
And one less image gets displayed in the coverflow. Basically if there are 10 images that are obtained using WCF services and put into the collection and then the collection is binded to the coverflow datacontext, it throws the above exception and 9 images gets displayed with blank space for one of the images.