Start and Endpoint Binding in an Animation

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    8 posts
    Member since:
    Jul 2013

    Posted 30 Jul 2013 Link to this post

    Hi Guys,

    I have tried to make the start and end points dynamic and wanted to bind the Start and End point of an animation.
    I have tried to bind it them to a Point or a String but in threw a XamlParseExecption

    Xaml code looks like this:

    <UserControl.Resources>
            <DataTemplate x:Name="OverlayTemplate">
      
                    <Image Margin="24,0" HorizontalAlignment="Left" VerticalAlignment="Top" Source="/Images/temp/simpleMarker.png" Stretch="None"/>
     
            </DataTemplate>
     
            <telerikCore:RadSlideAnimation  x:Name="OverlayContentDisplayAnimation" StartPoint="{Binding Path=StartPoint}" EndPoint="{Binding Path=EndPoint}" Duration="00:00:0.2"/>
        </UserControl.Resources>

    in the ViewModel class there are the Properties. (of course I only had one of the Properties bound at a time)
    private Point _startPoint;
     
            public String StartPoint
            {
                get
                {  
                    _startPoint.X = 200;
                    _startPoint.Y = 200;
                    return String.Format("{0},{1}", _startPoint.X, _startPoint.Y);
                }
            }
     
            private Point _endPoint;
     
            public Point EndPoint
            {
                get
                {
                    _endPoint.X = 200;
                    _endPoint.Y = 200;
                    return _endPoint; }
                set
                {
                    var oldVal = _endPoint;
                    _endPoint = value;
                    if (_endPoint != oldVal)
                        RaisePropertyChanged("EndPoint");
                }
            }

    Does anybody know which data type is required to make the Binding work?

    Thanks in advance

    Alex
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 02 Aug 2013 Link to this post

    Hello Alexander,

    Thank you for your question.

    The reason for the exception is not the type of the property. It is the fact that the StartPoint and EndPoint properties are not Dependency Properties so they can't be used with binding. You can try to define different animations and choose to play the one that you wish depending on the data that you wanted to bind to.

    Let me know if you need additional assistance.

    Regards,
    Todor
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top