-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A WPF application called Ultimate Temperature Converter has been added to the solution to demonstrate the purpose and capabilities of the Ultimate Temperature library.
- Loading branch information
Showing
16 changed files
with
1,067 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Application x:Class="UltimateTemperatureConverter.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:UltimateTemperatureConverter" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Windows; | ||
|
||
namespace UltimateTemperatureLibrary.WPF | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
UltimateTemperatureLibrary.WPF/Extensions/TextBoxExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Reflection; | ||
using System.Windows.Controls; | ||
|
||
namespace UltimateTemperatureLibrary.WPF.Extensions | ||
{ | ||
public static class TextBoxExt | ||
{ | ||
private static readonly FieldInfo Field; | ||
private static readonly PropertyInfo Prop; | ||
|
||
static TextBoxExt() | ||
{ | ||
Type type = typeof(Control); | ||
Field = type.GetField("text", BindingFlags.Instance | BindingFlags.NonPublic); | ||
Prop = type.GetProperty("WindowText", BindingFlags.Instance | BindingFlags.NonPublic); | ||
} | ||
|
||
public static void SetText(this TextBox box, string text) | ||
{ | ||
Field.SetValue(box, text); | ||
Prop.SetValue(box, text, null); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,255 @@ | ||
<Window | ||
x:Class="UltimateTemperatureLibrary.WPF.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:UltimateTemperatureLibrary.WPF" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
Title="Ultimate Temperature Converter" | ||
Width="500" | ||
Height="550" | ||
MinWidth="500" | ||
MinHeight="550" | ||
MaxWidth="500" | ||
MaxHeight="550" | ||
mc:Ignorable="d" | ||
> | ||
<Grid | ||
Margin="0,0,0,0" | ||
> | ||
<Grid.RowDefinitions> | ||
<RowDefinition | ||
Height="494*" | ||
/> | ||
<RowDefinition | ||
Height="5*" | ||
/> | ||
<RowDefinition | ||
Height="20*" | ||
/> | ||
</Grid.RowDefinitions> | ||
<TextBlock | ||
Margin="94,10,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="20" | ||
FontWeight="Bold" | ||
Text="Ultimate Temperature Converter" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,68,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
Text="Kelvin:" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBox | ||
Name="KelvinTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,66,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
MaxLines="1" | ||
Text="273.15 K" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,108,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
TextWrapping="Wrap" | ||
><Run | ||
Text="Celsius" | ||
/><Run | ||
Text=":" | ||
/></TextBlock> | ||
<TextBox | ||
Name="CelsiusTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,106,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
LostFocus="OnLostFocus" | ||
MaxLines="1" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,148,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
Text="Fahrenheit:" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBox | ||
Name="FahrenheitTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,146,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
MaxLines="1" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,188,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
Text="Rankine:" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBox | ||
Name="RankineTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,186,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
MaxLines="1" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,227,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
Text="Delisle:" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBox | ||
Name="DelisleTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,225,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
MaxLines="1" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,267,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
Text="Newton:" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBox | ||
Name="NewtonTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,265,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
MaxLines="1" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,308,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
Text="Réaumur" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBox | ||
Name="RéaumurTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,306,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
MaxLines="1" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Height="21" | ||
Margin="12,348,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
Text="Rømer" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBox | ||
Name="RømerTextBox" | ||
Grid.Row="0" | ||
Width="300" | ||
Height="23" | ||
Margin="117,346,0,0" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
FontSize="16" | ||
FontWeight="Bold" | ||
MaxLines="1" | ||
TextChanged="OnTextChanged" | ||
TextWrapping="Wrap" | ||
/> | ||
<TextBlock | ||
Grid.Row="0" | ||
Grid.RowSpan="3" | ||
Width="300" | ||
Height="30" | ||
Margin="10,0,0,10" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Bottom" | ||
FontSize="16" | ||
> | ||
<Hyperlink | ||
NavigateUri="https://github.com/KUTlime/Ultimate-Temperature-Library/" | ||
RequestNavigate="Hyperlink_RequestNavigate" | ||
> | ||
Powered by Ultimate Temperature Library | ||
</Hyperlink> | ||
</TextBlock> | ||
|
||
</Grid> | ||
</Window> |
Oops, something went wrong.