sa/GetStartedApp/Views/MainWindow.axaml.cs
2024-07-23 09:40:10 +02:00

28 lines
612 B
C#

using Avalonia.Controls;
using Avalonia.Interactivity;
using System.Diagnostics;
using System;
namespace GetStartedApp.Views;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
public void ButtonClicked(object source, RoutedEventArgs args)
{
if (Double.TryParse(celsius.Text, out double C))
{
var F = C * (9d / 5d) + 32;
fahrenheit.Text = F.ToString("0.0");
}
else
{
celsius.Text = "0";
fahrenheit.Text = "0";
}
}
}