Easy Steps to Create an Investment (SIP) Calculator in .NET MAUI | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (203)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (65)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (81)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (897)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (39)Extensions  (22)File Manager  (6)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (501)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (381)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (323)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Easy Steps to Create an Investment (SIP) Calculator in .NET MAUI

Easy Steps to Create an Investment (SIP) Calculator in .NET MAUI

“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 (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 and 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
Creating an Investment (SIP) Calculator in .NET MAUI

Note: If you are new to our Syncfusion .NET MAUI platform, please refer to the Slider and Radial Gauge documentation 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.
  2. Then, add the latest Syncfusion .NET MAUI Sliders package to the project.
    Install-Package Syncfusion.Maui.Sliders
  3. Now, add the latest Syncfusion .NET MAUI Gauges 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
Slider Control Displaying Investment Data

Default Slider

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

<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
Rendering a Default Slider in .NET MAUI App

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.

<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
Customizing the Slider Appearance in the .NET MAUI Investment Calculator

Add the Slider value to the text field

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

<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
Adding Slider Values to the Text Field in the .NET MAUI SIP Calculator

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.

<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
Dynamically Changing the Slider Values in the Text Field of the .NET MAUI SIP Calculator

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
Adding and Configuring Sliders in the .NET MAUI SIP Calculator

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.

<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
Changing Radial Gauge Values with Sliders in the .NET MAUI SIP Calculator

Adding labels

Now, create labels 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.

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

Desktop View of Investment (SIP) Calculator in .NET MAUI
Desktop View of Investment (SIP) Calculator in .NET MAUI

 The mobile layout will look like the following GIF image. 

Mobile View of the SIP Calculator in .NET MAUI
Mobile View of the SIP Calculator in .NET MAUI

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 and Radial Gauge controls for this app. There are more controls to check out. You can go through the complete .NET MAUI user guide for detailed explanations.

For questions, you can contact us through our support forums, support portal, or feedback portal. We are always happy to assist you!

Test Flight
App Center Badge
Google Play Store Badge
Microsoft Badge
Github Store Badge

Related blogs

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed