Jump to content
Software FX Community

Data Binding support for MVVM


asteele

Recommended Posts

DataBinding is supported on some but not all of the properties of the chart. The reason for this is that for a property to support binding it has to be a DependencyProperty which has a performance/memory/implementation cost.

Unfortunately I don't think we have a list of which properties are DPs but in each class, if you see a static property with the same name as the property + "Property" it will mean it is a DP, e.g. ChartFX.WPF.Chart.GalleryProperty implies Gallery is a DP of the Chart class.

Most axis properties are in fact DPs if you are having problems, please try to create a simplified sample where the you can show the unexpected behavior and post the sample. This will allow us to fix any issues or point out alternatives.

Note that most collections are not DPs, e.g. the ConditionalAttributes collection of the Chart class is not a DP, this is similar to most WPF built-in controls, for example the ColumnDefinitions property of the Grid class is not a DP.

Regards,

JuanC

Link to comment
Share on other sites

AxisX ="{Binding Path=AxisXControl}" AxisY="{Binding Path=AxisYControl}"

is the binding I tried.  Then ahveing properties in the viewmodel of:

ChartFX.WPF.Axis AxisXControl { get; set; }

ChartFX.WPF.Axis AxisYControl { get; set; }

and finally trying to set them as so:

AxisXControl.Max = Convert.ToDouble(GraphViewModel.Xmax);

 

AxisXControl.Min = Convert.ToDouble(GraphViewModel.Xmin);

 

AxisYControl.Max = Convert.ToDouble(GraphViewModel.Ymax);

 

AxisYControl.Min = Convert.ToDouble(GraphViewModel.Ymin);

Afterwhich nothing happens to the min and max of the X and Y axes on the graph.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...