Easy Steps to Create an Investment (SIP) Calculator in .NET MAUI
Tags: dotnet, csharp, maui, mobile
Published: 2022-06-13 11:11:48

---
title: Easy Steps to Create an Investment (SIP) Calculator in .NET MAUI
published: true
date: 2022-06-09 11:30:05 UTC
tags: dotnet, csharp, maui, mobile
canonical_url: https://www.syncfusion.com/blogs/post/easy-steps-to-create-an-investment-sip-calculator-in-net-maui.aspx
cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Easy-Steps-to-Create-an-Investment-SIP-Calculator-in-.NET-MAUI-672x372.png
---

**“Never depend on a single income. Make investment to create a second source”**

**– Warren Buffet**

Today, people are more likely to be investing their money in securities like stocks, mutual funds, and bonds. There are several [systematic investment planning](https://en.wikipedia.org/wiki/Systematic_investment_plan "Wikipedia page for Systematic Investment Planning") (SIP) applications available. They all have an attractive UI to estimate an investment plan for us.

To build any investment planning app, we need sliders to interact with, a radial gauge to show the output, and some text box controls.

Our Syncfusion [.NET MAUI Slider](https://www.syncfusion.com/maui-controls/maui-slider ".NET MAUI Slider") and [Radial Gauge](https://www.syncfusion.com/maui-controls/maui-radial-gauge ".NET MAUI Radial Gauge") are highly customizable data visualization controls providing a rich set of features.

Let’s smartly design a SIP calculator with these controls!

The following is the UI we want to achieve in this article.

![Creating an Investment (SIP) Calculator in .NET MAUI](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Creating-an-Investment-SIP-Calculator-in-.NET-MAUI-2.gif)
<figcaption>Creating an Investment (SIP) Calculator in .NET MAUI</figcaption>

**Note:** If you are new to our Syncfusion .NET MAUI platform, please refer to the [Slider](https://help.syncfusion.com/maui/slider/getting-started "Getting Started with .NET MAUI Slider") and [Radial Gauge documentation](https://help.syncfusion.com/maui/radial-gauge/getting-started "Getting Started with .NET MAUI Radial Gauge") before proceeding.

## Create a SIP calculator in .NET MAUI

Follow these steps to create a SIP calculator app in .NET MAUI.

### Install and configure the .NET MAUI controls.

1. First, [create a simple .NET MAUI project](https://docs.microsoft.com/en-us/dotnet/maui/get-started/first-app?pivots=devices-android "Build your first .NET MAUI app documentation").
2. Then, add the latest Syncfusion [.NET MAUI Sliders](https://www.nuget.org/packages/Syncfusion.Maui.Sliders "Syncfusion.Maui.Sliders NuGet package") package to the project.  

```
Install-Package Syncfusion.Maui.Sliders
```

3. Now, add the latest Syncfusion [.NET MAUI Gauges](https://www.nuget.org/packages/Syncfusion.Maui.Gauges "Syncfusion.Maui.Gauges NuGet package") package to the project.  

```
Install-Package Syncfusion.Maui.Gauges
```

### Add and initialize the .NET MAUI Slider.

Let’s create a slider to show the initial investment details, along with a text field to display the selected value. ** **

![Slider Control Displaying Investment Data](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Slider-Control-Displaying-Investment-Data-2.png)
<figcaption>Slider Control Displaying Investment Data</figcaption>

### Default Slider

Refer to the following code to add a default slider to your app.

```html
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:sliders="clr-namespace:Syncfusion.Maui.Sliders;assembly=Syncfusion.Maui.Sliders">
 
<ContentPage.Content>
    <sliders:SfSlider Value="0.5" />
</ContentPage.Content>
```

![Rendering a Default Slider in .NET MAUI App](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Rendering-a-Default-Slider-in-.NET-MAUI-App-1.png)
<figcaption>Rendering a Default Slider in .NET MAUI App</figcaption>

### Customize the sider appearance

You can customize the Syncfusion .NET MAUI Slider control as you wish. For this app, we’ll customize the size and color of the Slider. We’ll also define the minimum and maximum values for the investment options.

Refer to the following code.

```html
<sliders:SfSlider x:Name="InvestSlider"
                    Minimum="500"
                    Maximum="100000"
                    Value="{Binding MonthlyInvestment}"
                    Grid.Row="1">
 
  <sliders:SfSlider.TrackStyle>
     <sliders:SliderTrackStyle ActiveFill="#00d09c"
                               InactiveFill="#ecedef"
                               ActiveSize="5"
                               InactiveSize="5" />
  </sliders:SfSlider.TrackStyle>
 
  <sliders:SfSlider.ThumbStyle>
    <sliders:SliderThumbStyle Fill="White"
                              Radius="15"
                              Stroke="Grey"
                              StrokeThickness=".5" />
  </sliders:SfSlider.ThumbStyle>
 
  <sliders:SfSlider.ThumbOverlayStyle>
    <sliders:SliderThumbOverlayStyle Radius="15" />
  </sliders:SfSlider.ThumbOverlayStyle>
</sliders:SfSlider>
```

Now, the UI will look like the following image.

![Customizing the Slider Appearance in the .NET MAUI Investment Calculator](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Customizing-the-Slider-Appearance-in-the-.NET-MAUI-Investment-Calculator.png)
<figcaption>Customizing the Slider Appearance in the .NET MAUI Investment Calculator</figcaption>

### Add the Slider value to the text field

Now, add the Slider values to the text field like in the following code example.

```html
<Grid ColumnDefinitions="*,*"
      Grid.Row="0">
 
  <Label Text="Monthly Investment"
         TextColor="Black"
         Grid.Column="0"
         Padding="25,30,0,0" />
 
  <Entry WidthRequest="100"
         HeightRequest="30"
         Grid.Column="1"
         HorizontalOptions="End"
         VerticalOptions="End"
         Placeholder="10000"
         IsEnabled="False"
         TextColor="Green"
         Text="{Binding Value, Source={x:Reference InvestSlider},StringFormat='$ {0:0}'}"
         BackgroundColor="#e5faf5" />
</Grid>
```

Refer to the following output image.

![Adding Slider Values to the Text Field in the .NET MAUI SIP Calculator](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Adding-Slider-Values-to-the-Text-Field-in-the-.NET-MAUI-SIP-Calculator-1.png)
<figcaption>Adding Slider Values to the Text Field in the .NET MAUI SIP Calculator</figcaption>

Once the UI is set up, add the value changes to the text field. To do so, bind the slider value to the label.

Refer to the following code example.

```html
<Grid ColumnDefinitions="*,*"
      Grid.Row="0">
 
  <Label Text="Monthly Investment"
         TextColor="Black"
         Grid.Column="0"
         Padding="25,30,0,0" />
    
  <Entry WidthRequest="100"
         HeightRequest="30"
         Grid.Column="1"
         HorizontalOptions="End"
         VerticalOptions="End"
         Placeholder="10000"
         IsEnabled="False"
         TextColor="Green"
         Text="{Binding Value, Source={x:Reference InvestSlider},StringFormat='$ {0:0}'}"
         BackgroundColor="#e5faf5" />
 
</Grid>
 
<sliders:SfSlider x:Name="InvestSlider"
                      Minimum="500"
                      Maximum="100000"
                      Value="{Binding MonthlyInvestment}"
                      Grid.Row="1">
 
  <sliders:SfSlider.TrackStyle>
    <sliders:SliderTrackStyle ActiveFill="#00d09c"
                              InactiveFill="#ecedef"
                              ActiveSize="5"
                              InactiveSize="5" />
  </sliders:SfSlider.TrackStyle>
 
  <sliders:SfSlider.ThumbStyle>
    <sliders:SliderThumbStyle Fill="White"
                              Radius="15"
                              Stroke="Grey"
                              StrokeThickness=".5" />
  </sliders:SfSlider.ThumbStyle>
 
  <sliders:SfSlider.ThumbOverlayStyle>
    <sliders:SliderThumbOverlayStyle Radius="15" />
  </sliders:SfSlider.ThumbOverlayStyle>
</sliders:SfSlider>
```

![Dynamically Changing the Slider Values in the Text Field of the .NET MAUI SIP Calculator](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Dynamically-Changing-the-Slider-Values-in-the-Text-Field-of-the-.NET-MAUI-SIP-Calculator-1.gif)
<figcaption>Dynamically Changing the Slider Values in the Text Field of the .NET MAUI SIP Calculator</figcaption>

## Create other sliders

For our app, we’ll add two more slider controls for the expected return rate and time period. Repeat the previous steps to design these sliders.

Once we have added all the sliders to our project, the UI will look like the following image.

![Adding and Configuring Sliders in the .NET MAUI SIP Calculator](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Adding-and-Configuring-Sliders-in-the-.NET-MAUI-SIP-Calculator-1.png)
<figcaption>Adding and Configuring Sliders in the .NET MAUI SIP Calculator</figcaption>

### Add the .NET MAUI Radial Gauge to show the results

Then, create the .NET MAUI Radial Gauge to show the Sliders’ values in it.

Refer to the following code example.

```html
<gauge:SfRadialGauge Grid.Row="1">
  <gauge:SfRadialGauge.Axes>
     <gauge:RadialAxis Minimum="1"
                       Maximum="30"
                       Interval="1"
                       Margin="20,10,0,0"
                       StartAngle="270"
                       EndAngle="270"
                       RadiusFactor=".9"
                       ShowLabels="False"
                       ShowTicks="False">
                          
          <gauge:RadialAxis.AxisLineStyle>
             <gauge:RadialLineStyle ThicknessUnit="Pixel"
                                    Thickness="50" />
          </gauge:RadialAxis.AxisLineStyle>
 
          <gauge:RadialAxis.Ranges>
            <gauge:RadialRange StartValue="0"
                               EndValue="30"
                               StartWidth="50"
                               EndWidth="50"
                               Fill="#98a4ff" />
 
            <gauge:RadialRange StartValue="0"
                               EndValue="17"
                               StartWidth="50"
                               EndWidth="50"
                               Fill="#98a4ff" />
 
            <gauge:RadialRange StartValue="{Binding ExpectedReturnRate}"
                               EndValue="30"
                               StartWidth="50"
                               EndWidth="50"
                               Fill="#5367ff" />
         </gauge:RadialAxis.Ranges>
      </gauge:RadialAxis>
  </gauge:SfRadialGauge.Axes>
 
</gauge:SfRadialGauge>
```

Executing this code example will render the UI like in the following GIF image.

![Changing Radial Gauge Values with Sliders in the .NET MAUI SIP Calculator](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Changing-Radial-Gauge-Values-with-Sliders-in-the-.NET-MAUI-SIP-Calculator-1.gif)
<figcaption>Changing Radial Gauge Values with Sliders in the .NET MAUI SIP Calculator</figcaption>

### Adding labels

Now, create [labels](https://docs.microsoft.com/en-us/dotnet/maui/user-interface/controls/label "labels in .NET MAUI documentation") to spell out the results from our data visualization control.

This is just a business logic that involves simple calculations. For more details, refer to the [.NET MAUI SIP calculator demo on GitHub](https://github.com/SyncfusionExamples/maui-sip-calculator ".NET MAUI SIP calculator GitHub demo").

Once done, the desktop UI will look like the following GIF image.

![Desktop View of Investment (SIP) Calculator in .NET MAUI](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Desktop-View-of-Investment-SIP-Calculator-in-.NET-MAUI-2.gif)
<figcaption>Desktop View of Investment (SIP) Calculator in .NET MAUI</figcaption>

The mobile layout will look like the following GIF image.

![Mobile View of the SIP Calculator in .NET MAUI](https://www.syncfusion.com/blogs/wp-content/uploads/2022/06/Mobile-View-of-the-SIP-Calculator-in-.NET-MAUI-1.gif)
<figcaption>Mobile View of the SIP Calculator in .NET MAUI</figcaption>

## Conclusion

Thanks for reading! This app has a lot of room to improve in the UI and functionalities. Still, this is a good start. I hope this blog was useful and you enjoyed creating an investment calculator app in .NET MAUI.

We have used only the [Syncfusion .NET MAUI Sliders](https://www.syncfusion.com/maui-controls/maui-slider ".NET MAUI Sliders") and [Radial Gauge](https://www.syncfusion.com/maui-controls/maui-radial-gauge ".NET MAUI Radial Gauge") controls for this app. There are more controls to check out. You can go through the complete [.NET MAUI user guide](https://help.syncfusion.com/maui/introduction/overview ".NET MAUI controls documentation") for detailed explanations.

For questions, you can contact us through our [support forums](https://www.syncfusion.com/forums "Syncfusion support forums"), [support portal](https://support.syncfusion.com/ "Syncfusion support portal"), or [feedback portal](https://www.syncfusion.com/feedback "Syncfusion feedback portal"). We are always happy to assist you!