# Suma 3.0

Start the integrated development environment **Microsoft Visual Studio 2026**, create a new project and name it **Suma 3.0**.

## MainPage.xaml

This file contains the source code for the application's user interface design.

```xml
<!-- User Interface (UI): Suma 3.0 -->
<StackPanel Padding="50" Background="Orange">

    <!-- Title -->
    <TextBlock Text="Suma 3.0" FontSize="42" />

    <!-- A -->
    <TextBlock Text="A=" FontSize="24" />
    <TextBox x:Name="boxA" FontSize="24" />

    <!-- B -->
    <TextBlock Text="B=" FontSize="24" />
    <TextBox x:Name="boxB" FontSize="24" />

    <!-- A+B -->
    <TextBlock Text="A+B=" FontSize="24" />
    <TextBox x:Name="boxAB" FontSize="24" />

    <!-- Button -->
    <Button Content="Sum" FontSize="24"
            Margin="0 20 0 0" Padding="20 10 20 10"
            Click="OnButtonClicked" />

</StackPanel>
```

## MainPage.xaml.cs

This file contains the source code for the application's business logic.

```csharp
// Business Logic (BL): Suma 3.0
public sealed partial class MainWindow : Window
{
    // Constructor
    public MainWindow()
    {
        InitializeComponent();
    }

    // Button Click Event Handler
    private void OnButtonClicked(object sender, RoutedEventArgs e)
    {
        var A = int.Parse(this.boxA.Text);
        var B = int.Parse(this.boxB.Text);
        var C = A + B;
        this.boxAB.Text = C.ToString();
    }
}
```

## Running the app

Run the application and test its functionality as shown in the figure below.

![](https://3608896458-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8MhIbAe4EayNL4gLUc2U%2Fuploads%2Fgit-blob-d2de40dd9af1d48e449b8c4b190288e802bc2340%2F308_Suma_3.0.png?alt=media)

*Fig. 3.8. Suma 3.0*

{% hint style="danger" %}
**Note**

Do you notice similarities with the examples from Chapter 1? Try to implement all examples from Chapter 1 yourself, using the **Windows UI Library** (WinUI) as the project type.
{% endhint %}
