Dependency Injection, frist UI Reworks
This commit is contained in:
		@@ -19,18 +19,7 @@
 | 
			
		||||
 | 
			
		||||
    <TabControl>
 | 
			
		||||
        <TabItem Header="Home">
 | 
			
		||||
            <StackPanel>
 | 
			
		||||
                <Border Margin="5" CornerRadius="10" Background="LightBlue">
 | 
			
		||||
                    <TextBlock Margin="5" FontSize="24" HorizontalAlignment="Center" Text="{Binding Greeting}"></TextBlock>
 | 
			
		||||
                </Border>
 | 
			
		||||
                <Grid ShowGridLines="True" Margin="5" ColumnDefinitions="120, 100" RowDefinitions="Auto, Auto, Auto">  
 | 
			
		||||
                    <Label Grid.Row="0" Grid.Column="0" Margin="10">Celsius</Label>
 | 
			
		||||
                    <TextBox Grid.Row="0" Grid.Column="1" Margin="0 5" Text="0" Name="celsius"/>
 | 
			
		||||
                    <Label Grid.Row="1" Grid.Column="0" Margin="10">Fahrenheit</Label>
 | 
			
		||||
                    <TextBox Grid.Row="1"  Grid.Column="1" Margin="0 5" Text="0" Name="fahrenheit"/>
 | 
			
		||||
                    <Button Grid.Row="2" Grid.Column="1" Margin="0 5" Click="ButtonClicked">Calculate</Button>
 | 
			
		||||
                </Grid>
 | 
			
		||||
            </StackPanel>
 | 
			
		||||
            Welcome to Stars Assistant!
 | 
			
		||||
        </TabItem>
 | 
			
		||||
        <TabItem Header="DataGrid">
 | 
			
		||||
            <DataGrid ItemsSource="{Binding Planets}"   
 | 
			
		||||
 
 | 
			
		||||
@@ -11,18 +11,4 @@ public partial class MainWindow : Window
 | 
			
		||||
    {
 | 
			
		||||
        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";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user