Skip to content

Commit

Permalink
New UI using Material Design n XAML Toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Timthreetwelve committed Jan 20, 2022
1 parent 03d2058 commit f86d2b4
Show file tree
Hide file tree
Showing 47 changed files with 1,759 additions and 819 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,6 @@ ASALocalRun/
# BeatPulse healthcheck temp database
healthchecksdb

/MigrationBackup/
.gitignore
.editorconfig
.gitignore
/GetMyIP/CurrentCommit.txt
6 changes: 3 additions & 3 deletions GetMyIP.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29123.88
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetMyIP", "GetMyIP\GetMyIP.csproj", "{68464B4E-0F4D-4653-978A-CF86C3735FB3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A4428067-3630-4BD9-8BBC-CF0D5F93A2D3}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
LICENSE = LICENSE
LICENSE.txt = LICENSE.txt
README.md = README.md
EndProjectSection
EndProject
Expand Down
120 changes: 0 additions & 120 deletions GetMyIP/About.xaml

This file was deleted.

34 changes: 0 additions & 34 deletions GetMyIP/About.xaml.cs

This file was deleted.

24 changes: 23 additions & 1 deletion GetMyIP/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GetMyIP"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
StartupUri="MainWindow.xaml">
<Application.Resources />
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<materialDesign:BundledTheme
BaseTheme="Light"
ColorAdjustment="{materialDesign:ColorAdjustment}"
PrimaryColor="Blue"
SecondaryColor="Red" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>

<!-- Style for the page headers -->
<Style
x:Key="PageHeader"
TargetType="TextBlock">
<Setter Property="FontSize" Value="20" />
<Setter Property="FontWeight" Value="DemiBold" />
<Setter Property="Padding" Value="10,2" />
</Style>

</ResourceDictionary>
</Application.Resources>
</Application>
44 changes: 44 additions & 0 deletions GetMyIP/Dialogs/ErrorDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<UserControl
x:Class="GetMyIP.Dialogs.ErrorDialog"
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:GetMyIP"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
d:DesignHeight="150"
d:DesignWidth="200"
mc:Ignorable="d">
<Border
BorderBrush="Red"
BorderThickness="2"
CornerRadius="3">
<StackPanel Margin="16">
<TextBlock
Margin="8"
Padding="10"
HorizontalAlignment="Center"
FontSize="14"
Text="{Binding Path=Message, FallbackValue='Message Here'}"
TextWrapping="Wrap" />
<StackPanel
Margin="8"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button
VerticalContentAlignment="Center"
Command="materialDesign:DialogHost.CloseDialogCommand"
Content="OK"
FontWeight="DemiBold"
IsDefault="True"
Style="{StaticResource MaterialDesignRaisedAccentButton}">
<Button.CommandParameter>
<system:Boolean>true</system:Boolean>
</Button.CommandParameter>
</Button>

</StackPanel>
</StackPanel>
</Border>
</UserControl>
24 changes: 24 additions & 0 deletions GetMyIP/Dialogs/ErrorDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright(c) Tim Kennedy. All Rights Reserved. Licensed under the MIT License.

using System.Windows.Controls;

namespace GetMyIP.Dialogs
{
/// <summary>
/// A dialog to display a message with an OK button.
/// This dialog has a RED border and button background.
/// </summary>
public partial class ErrorDialog : UserControl
{
/// <summary>
/// Message to be displayed
/// </summary>
public string Message { get; set; }

public ErrorDialog()
{
InitializeComponent();
DataContext = this;
}
}
}
39 changes: 39 additions & 0 deletions GetMyIP/Dialogs/OkDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<UserControl
x:Class="GetMyIP.Dialogs.OkDialog"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
MaxWidth="550"
MinHeight="100"
d:DesignHeight="150"
d:DesignWidth="200"
mc:Ignorable="d">
<StackPanel Margin="16">
<TextBlock
Margin="8"
Padding="10"
HorizontalAlignment="Center"
FontSize="14"
Text="{Binding Path=Message, FallbackValue='Message Here'}"
TextWrapping="Wrap" />

<StackPanel
Margin="8"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button
Command="materialDesign:DialogHost.CloseDialogCommand"
Content="OK"
FontWeight="DemiBold"
IsDefault="True"
Style="{StaticResource MaterialDesignRaisedButton}">
<Button.CommandParameter>
<system:Boolean>True</system:Boolean>
</Button.CommandParameter>
</Button>
</StackPanel>
</StackPanel>
</UserControl>
23 changes: 23 additions & 0 deletions GetMyIP/Dialogs/OkDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright(c) Tim Kennedy. All Rights Reserved. Licensed under the MIT License.

using System.Windows.Controls;

namespace GetMyIP.Dialogs
{
/// <summary>
/// A dialog to display a message with an OK button.
/// </summary>
public partial class OkDialog : UserControl
{
/// <summary>
/// Message to be displayed
/// </summary>
public string Message { get; set; }

public OkDialog()
{
InitializeComponent();
DataContext = this;
}
}
}
Loading

0 comments on commit f86d2b4

Please sign in to comment.