Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
XamChart Scene
posted

I would like to know the ActualWidth and ActualHeight of the XamChart.Scene, but it's resulting to 0.0. I added a Loaded event on my .cs file.

How can I get the ActualWidth and ActualHeight of the XamChart.Scene?

Parents
No Data
Reply
  • 9836
    Suggested Answer
    posted

    I suppose the ActualHeight and ActualWidth returns 0 in the Loaded event just because the Scene element is not created at this time. You can handle the  Loaded event of the Scene instead e.g.

    xamChart1.Scene.Loaded+=new RoutedEventHandler(Scene_Loaded);

    private void Scene_Loaded(object sender, RoutedEventArgs e)

            double width = xamChart1.Scene.ActualWidth;
            double height = xamChart1.Scene.ActualHeight;
            MessageBox.Show(width.ToString() + " " + height.ToString());

    Let me know if you have any questions with this matter.

    Vlad

Children
No Data