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

Start and Endpoint Binding in an Animation

1 Answer 44 Views
Animation
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alexander
Top achievements
Rank 1
Alexander asked on 30 Jul 2013, 06:33 AM
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

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 02 Aug 2013, 08:32 AM
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 >>
Tags
Animation
Asked by
Alexander
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or