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

28 lines
613 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;
2024-08-15 19:46:43 +00:00
namespace StarsAssistant.Views;
2024-07-23 07:40:10 +00:00
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";
}
}
}