sa/Stars Assistant/Views/MainWindow.axaml.cs

28 lines
612 B
C#
Raw Normal View History

2024-07-23 07:40:10 +00:00
using Avalonia.Controls;
using Avalonia.Interactivity;
using System.Diagnostics;
using System;
namespace net.nehmer.sa.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";
}
}
}