Calling a method and outputing

KonoDioDaKonoDioDa USMember ✭✭

Hello everyone I'm pretty new to Xamarin and I'm just not sure what to do here. I'm trying to take three values, one is an input, one is a slider and one is a stepper :

    <Label Text="Monthly: " x:Name="result"/>

    <Slider x:Name="Monthly"

    <Label Text="Number of Years: " x:Name="result2"/>

    <Stepper x:Name="Years"

I've taken these and turned them into three Variables inside of my button method

public void OnButtonClicked(object sender, EventArgs e)

        var Value = double.Parse(Investment.Text);
        var Value2 = Monthly;
        var Value3 = Years;


I have a method that I need to call to calculate these

public double TotalCalculate(double investment1,
double monthly1,
double years1,
int compounds1,
double interestRate)

        var Investment2 = monthly * 12 / compounds1;
        interestRate /= 100;

        var Calculation = Math.Pow(1 + interestRate / compounds1, compounds1 * years1);
        var Principle = investment1 * Calculation;
        var future = Investment2 * (Calculation - 1) * (compounds1 / interestRate);
        return Principle + future;

( compounds1 and interestRate are going to be unused at the moment, too be added in later)

My biggest problem is figuring out how to add those three values together with the method, if this is too little information I can elaborate, ty for all the help!

Best Answer


Sign In or Register to comment.