I am using RadSlideView in my project. It contains of ContentViews each of them is RelativeLayout with some content. Previously I was using "RelativeToParent" constraing, but now I need to use "RelativeToView". If I use RelativeToView constaint, I have this exception: "System.ArgumentNullException: 'Value cannot be null. Parameter name: key'. This exception occurs only when I place my relative layout inside the SlideVIew and use RelativeToView constraint.
In this case exception occurs:
<telerikPrimitives:RadSlideView> <telerikPrimitives:RadSlideView.ItemsSource> <x:Array Type="{x:Type ContentView}"> <ContentView> <RelativeLayout> <Label x:Name="lbl" Text="RelativeLayout" RelativeLayout.XConstraint = "{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5, Constant=-50}" RelativeLayout.YConstraint = "{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.5, Constant=-150}" /> <BoxView Color="Blue" RelativeLayout.XConstraint = "{ConstraintExpression Type=RelativeToView, ElementName=lbl, Property=X, Factor=1, Constant=-30}" RelativeLayout.YConstraint = "{ConstraintExpression Type=RelativeToView, ElementName=lbl, Property=Y, Factor=1, Constant=30}" RelativeLayout.WidthConstraint = "150" RelativeLayout.HeightConstraint = "100" /> </RelativeLayout> </ContentView> </x:Array> </telerikPrimitives:RadSlideView.ItemsSource></telerikPrimitives:RadSlideView>
In this case everything is okay (I don't place RelativeLayout into the RadSlideVIew):
<RelativeLayout> <Label x:Name="lbl" Text="RelativeLayout" RelativeLayout.XConstraint = "{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5, Constant=-50}" RelativeLayout.YConstraint = "{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.5, Constant=-150}" /> <BoxView Color="Blue" RelativeLayout.XConstraint = "{ConstraintExpression Type=RelativeToView, ElementName=lbl, Property=X, Factor=1, Constant=-30}" RelativeLayout.YConstraint = "{ConstraintExpression Type=RelativeToView, ElementName=lbl, Property=Y, Factor=1, Constant=30}" RelativeLayout.WidthConstraint = "150" RelativeLayout.HeightConstraint = "100" /> </RelativeLayout>
