Trouble Connecting Chart to C# Backened

Hello! I'm making a pretty basic GUI for my static physics class that will receive user input, generate two sets of coordinates (Shear Force Data and Bending Moment Data) based off of the user input, and plot those coordinates onto two different SfCharts. However I cannot get the TextBoxes to interact with my C# code that is supposed to generate my models. Please help!

SOURCE CODE:

CoordPoint.cs:
namespace InternalForcesCalculator.Models
{
    public class CoordPoint
    {
        public float XCoord { get; set; }
        public float YCoord { get; set; }
    }
}

ViewModel.cs
namespace InternalForcesCalculator.ViewModel
{
    public class ViewModel
    {
        public List<CoordPoint> ShearForceData { get; set; }
        public List<CoordPoint> BendingMomentData { get; set; }
        
        public float PointLoadingLocation { get; set; }
        public float PointLoadingMagnitude { get; set; }
        public float TriangularDistributedLoadingLocation { get; set; }
        public float TriangularDistributedLoadingMagnitude { get; set; }
        public float RectangularDistributedLoadingLocation { get; set; }
        public float RectangularDistributedLoadingMagnitude { get; set; }
        public float FreeMomentLocation { get; set; }
        public float FreeMomentMagnitude { get; set; }
        public float PinSupportLocation { get; set; }
        public float RollerSupportLocation { get; set; }
        public float FixedSupportLocation { get; set; }

        public ViewModel()
        {
            ShearForceData = CreateShearForceModel(
                PointLoadingLocation, 
                PointLoadingMagnitude, 
                TriangularDistributedLoadingLocation, 
                TriangularDistributedLoadingMagnitude, 
                RectangularDistributedLoadingLocation, 
                RectangularDistributedLoadingMagnitude, 
                FreeMomentLocation, 
                FreeMomentMagnitude,
                PinSupportLocation,
                RollerSupportLocation,
                FixedSupportLocation
                );
            BendingMomentData = CreateBendingMomentModel(
                PointLoadingLocation,
                PointLoadingMagnitude,
                TriangularDistributedLoadingLocation,
                TriangularDistributedLoadingMagnitude,
                RectangularDistributedLoadingLocation,
                RectangularDistributedLoadingMagnitude,
                FreeMomentLocation,
                FreeMomentMagnitude,
                PinSupportLocation,
                RollerSupportLocation,
                FixedSupportLocation
                );
        }

        public List<CoordPoint> CreateShearForceModel(
            float PointLoadingLocation,
            float PointLoadingMagnitude,
            float TriangularDistributedLoadingLocation,
            float TriangularDistributedLoadingMagnitude,
            float RectangularDistributedLoadingLocation,
            float RectangularDistributedLoadingMagnitude,
            float FreeMomentLocation,
            float FreeMomentMagnitude,
            float PinSupportLocation,
            float RollerSupportLocation,
            float FixedSupportLocation
            )
        {
            List<CoordPoint> Result = new List<CoordPoint>()           The idea is to have this function generate the Coord Points based upon entered data
            {
                new CoordPoint{ XCoord = PointLoadingLocation, YCoord = PointLoadingMagnitude },          These are just to test the textbox modify the chart
                new CoordPoint{ XCoord = TriangularDistributedLoadingLocation, YCoord = TriangularDistributedLoadingMagnitude }
            };

            return Result;
        }

        public List<CoordPoint> CreateBendingMomentModel(
            float PointLoadingLocation,
            float PointLoadingMagnitude,
            float TriangularDistributedLoadingLocation,
            float TriangularDistributedLoadingMagnitude,
            float RectangularDistributedLoadingLocation,
            float RectangularDistributedLoadingMagnitude,
            float FreeMomentLocation,
            float FreeMomentMagnitude,
            float PinSupportLocation,
            float RollerSupportLocation,
            float FixedSupportLocation
            )
        {
            List<CoordPoint> Result = new List<CoordPoint>()           The idea is to have this list generate the Coord Points based upon entered data
            {
                new CoordPoint{ XCoord = 0, YCoord = 0 },
            };

            return Result;
        }
    }
}

MainPage.xaml (The entire thing wouldn't fit so I've included only relevant parts)
<TextBox Text="{Binding PointLoadingLocation}" FontSize="16"/>            I have one of these for every textbox attribute

Assume functioning SfChartCreated
<syncfusion:StepAreaSeries Name="SFD" ShowTooltip="True" Interior="#5D9BD7" Label="Bending Moment Diagram" ItemsSource="{Binding ShearForceData}" XBindingPath="XCoord" YBindingPath="YCoord" />

<syncfusion:AreaSeries Name="BMD" ShowTooltip="True" Interior="#5D9BD7" Label="Bending Moment Diagram" ItemsSource="{Binding BendingMomentData}" XBindingPath="XCoord" YBindingPath="YCoord" />




2 Replies

SJ Suyamburaja Jayakumar Syncfusion Team April 23, 2020 03:59 AM UTC

Hi Samuel Bishop, 
 
Greetings from Syncfusion.  
 
Currently we are validating the reported query and we will update the complete details at the end of day. 
 
Please let us know if you need any further assistance.      
  
Regards,  
Suyamburaja J.  



SJ Suyamburaja Jayakumar Syncfusion Team April 25, 2020 07:50 PM UTC

Hi Samuel Bishop, 
 
Thanks for your patience.  
 
We have validated your requirement and we would like to let you know that you are not called the PropertyChanged event for your Model. You can resolve this problem by creating your ViewModel class from the INotifyPropertyChanged interface and calling PropertyChanged event. And we have prepared a sample based on your requirement and you can download the sample from the below link 
 
 
More information please refer the below KB link and UG link, 
 
Please let us know if you need any further assistance.      
  
Regards,  
Suyamburaja J.  


Loader.
Up arrow icon