error with DependencyProperty in indicators

4 posts, 0 answers
  1. Masoud
    Masoud avatar
    15 posts
    Member since:
    Aug 2013

    Posted 17 Dec 2014 Link to this post

    hi to everybody
    i tried to use indicators to my project with get help demo telerik
    i createing some class .for instance FinancialIndicatorSwitch  and FinancialSeriesTypeSwitch and etc
    but when i start i get this error
    Error    2    A 'Binding' cannot be used within a 'RadCartesianChart' collection. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.    C:\Users\masoud\Documents\Visual Studio 2013\Projects\exercise_telerik\testchart\testchart\View\indacator.xaml    36    36    testchart

    it say problem is in dependencyproperty that define in class and use in view
    where this dp use in view in define here
    <chart:RadCartesianChart x:Name="RadChart1" Palette="Windows8" Margin="20,0,8,0"
                                       example:FinancialIndicatorSwitch.MainIndicator="{Binding MainIndicator, Mode=TwoWay}"
                                       example:FinancialSeriesTypeSwitch.SeriesType="{Binding SeriesType}"
     
     
    and
     
            <chart:RadCartesianChart x:Name="RadChart2" Palette="Windows8" Grid.Row="1" Margin="20,10,8,0"
                                       example:FinancialIndicatorSwitch.SecondaryIndicator="{Binding SecondaryIndicator, Mode=TwoWay}">

    i tried to solution this  error but i was unsuccessful 
    please help me
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 19 Dec 2014 Link to this post

    Hello Masoud,

    I am unsure what the problem is. Are you perhaps setting the attached property to some collection? The stack trace says that you have a collection of charts and you are setting the attached property to that collection.

    I am attaching a simple project with a single attached property. Upon setting the attached property, a message box is show. You can write your custom logic in the attached property changed handler. I hope this helps.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Masoud
    Masoud avatar
    15 posts
    Member since:
    Aug 2013

    Posted 19 Dec 2014 Link to this post

    hello Petar Marchev
    i tried to solution this error but i cant.
    i attach my project
    this is copy of demo indicator
    i remove dll file for volume file was huge
    http://uplod.ir/v9cbdk7wf4x8/test.rar.htm

  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 23 Dec 2014 Link to this post

    Hi Masoud,

    I was unable to download the project. When I go to the indicated link, I see two gauges and two buttons. Even though I changed the language to English, not much of the content was in English and I didn't see a download button anywhere. I clicked on both of the buttons I see, but still could not download the project.

    Have you examined the project I provided? Do you see any differences with your code?

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top