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!
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;
}
}
}
<syncfusion:AreaSeries Name="BMD" ShowTooltip="True" Interior="#5D9BD7" Label="Bending Moment Diagram" ItemsSource="{Binding BendingMomentData}" XBindingPath="XCoord" YBindingPath="YCoord" />