Hello,
I have a Problem with the StackedFragmentSeries. I want to bind the title to a string in the ViewModel:
<ig:StackedColumnSeries.Series> <ig:StackedFragmentSeries ValueMemberPath="Values" Title="{Binding SeriesTitleValues}"/> <ig:StackedFragmentSeries ValueMemberPath="Errors" /></ig:StackedColumnSeries.Series>
Unfortunatly, this does not work. It will still display "Series Title" in the legend and I get the error:
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=SeriesTitleValues; DataItem=null; target element is 'StackedFragmentSeries' (HashCode=32244734); target property is 'Title' (type 'Object')
Is there a way to solve this problem? I have attached the example.
Thanks,
Michael
Hello Michael,
I'm glad that this helps you. If you need further assistance, don't hesitate to ask. I'll be more than happy to help you.
Sincerely,
Lazar Nikolov
Infragistics
www.infragistics.com/support
thank you for your help. This way it works perfectly.
Best regards,
Hello MiSu,
I've modified the sample application that you provided and I attach it here.
StackedFragmentSeries doesn't not inherit from FrameworkObject and that means that it doesn't have data context by default. To use binding with StackedFrameworkSeries you need to specify the data context adding Source to the Binding expression.
I've moved MainWindowViewModel in the Resources collection of the window and adding a Key to it. Then I've added Source to all Binding expressions that refer to the data context.
To notify the view when SeriesTitleValues is changed I've made a change in the ViewModel:
OnPropertyChanged("SeriesTitleValue"); changed to OnPropertyChanged("SeriesTitleValues"); since the property name is SeriesTitleValues.
You will find the changes in the attached sample and you can apply them to your application.
Let me know if you need any further assistance.