This is a migrated thread and some comments may be shown as answers.

Trouble Binding the flow direction on SlideAndZoomTransition

2 Answers 89 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 16 Dec 2010, 07:18 PM
I am getting 'System.ArgumentException: Object of type 'System.Windows.Data.Binding' cannot be converted to type 'System.Windows.FlowDirection'' when I am trying to bind the SlideDirection of the SlideAndZoomTransition to my viewModel.  The exception is occuring at the InitializeComponent() call in the constructor of the view. 

Xaml:
<telerik:RadTransitionControl x:Name="ActiveItem" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Duration="0:0:0.5" >
<telerik:RadTransitionControl.Transition>
    <telerikTransitions:SlideAndZoomTransition SlideDirection="{Binding Transition}"/>
    </telerik:RadTransitionControl.Transition>
</telerik:RadTransitionControl>

In ViewModel:
private FlowDirection _transition = FlowDirection.LeftToRight;

public FlowDirection Transition
{
get
{
return _transition;
}
set
{
_transition = value;
NotifyOfPropertyChange(() => Transition);
}
}

Any advice?

2 Answers, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 22 Dec 2010, 10:38 AM
Hi Mike,

The TransitionProvider is not a DependencyObject. The SlideDirection is not a DependencyProperty. Bind the Transition property of the Transition Control instead of the direction property. You can easily create a converter that based on the bound value would return "new SlideAndZoomTransition() { SlideDirection = LeftToRight}" or "new SlideAndZoomTransition() { SlideDirection = RightToLeft}".

Greetings,
Pana
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Eli
Top achievements
Rank 1
answered on 24 Oct 2011, 04:05 PM
How would you do it using xaml only?

        <Controls:RadTransitionControl Content="{Binding}">
            <Controls:RadTransitionControl.Transition>
                <TransitionEffects:SlideAndZoomTransition x:Name="SlideTransition"
                                                         />
            </Controls:RadTransitionControl.Transition>
         </Controls:RadTransitionControl>

Made converter as follows but won't let me bind to it, or use triggers to set

<!--SlideDirection="{Binding SlideRight, Converter={StaticResource BoolToDirectionConverter}}"-->
Tags
TransitionControl
Asked by
Mike
Top achievements
Rank 1
Answers by
Pana
Telerik team
Eli
Top achievements
Rank 1
Share this question
or