-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an "historic" button in DownDetector page (#202)
- Loading branch information
1 parent
ea05d05
commit 46c4ebe
Showing
8 changed files
with
202 additions
and
9 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
InternetTest/InternetTest/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,25 @@ | ||
<UserControl x:Class="InternetTest.UserControls.HistoricItem" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:InternetTest.UserControls" | ||
xmlns:lang="clr-namespace:InternetTest.Properties" | ||
mc:Ignorable="d" FontFamily="..\Fonts\#Montserrat" | ||
d:DesignHeight="50" d:DesignWidth="200" Margin="0,0,0,5"> | ||
<Border CornerRadius="10" Padding="5" Background="{Binding Source={StaticResource Background2}}"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<StackPanel Grid.Column="0" VerticalAlignment="Center"> | ||
<TextBlock x:Name="SiteNameTxt" Foreground="{Binding Source={StaticResource Foreground1}}" d:Text="https://leocorporation.dev" TextWrapping="Wrap"/> | ||
<TextBlock x:Name="StateTxt" Foreground="{Binding Source={StaticResource Foreground1}}" d:Text="Up" FontWeight="Bold"/> | ||
</StackPanel> | ||
|
||
<Button Content="" Margin="5" x:Name="DismissBtn" Click="DismissBtn_Click" Grid.Column="1" FontFamily="..\Fonts\#FluentSystemIcons-Regular" Foreground="{Binding Source={StaticResource Foreground1}}" Background="{Binding Source={StaticResource Background2}}" Style="{DynamicResource TabButtonStyle}" Padding="5" Width="25" Height="25"/> | ||
</Grid> | ||
</Border> | ||
</UserControl> |
74 changes: 74 additions & 0 deletions
74
InternetTest/InternetTest/UserControls/HistoricItem.xaml.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,74 @@ | ||
/* | ||
MIT License | ||
Copyright (c) Léo Corporation | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
using InternetTest.Classes; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace InternetTest.UserControls | ||
{ | ||
/// <summary> | ||
/// Interaction logic for HistoricItem.xaml | ||
/// </summary> | ||
public partial class HistoricItem : UserControl | ||
{ | ||
string URL { get; init; } | ||
string Status { get; init; } | ||
StackPanel StackPanel { get; init; } | ||
public HistoricItem(string url, string status, StackPanel stackPanel) | ||
{ | ||
InitializeComponent(); | ||
URL = url; | ||
Status = status; | ||
StackPanel = stackPanel; | ||
InitUI(); | ||
} | ||
|
||
private void InitUI() | ||
{ | ||
SiteNameTxt.Text = URL; // Set text | ||
StateTxt.Text = Status; // Set text | ||
} | ||
|
||
private void DismissBtn_Click(object sender, RoutedEventArgs e) | ||
{ | ||
StackPanel.Children.Remove(this); // Remove | ||
if (StackPanel.Children.Count == 0) | ||
{ | ||
Global.DownDetectorPage.HistoryBtn_Click(this, null); | ||
} | ||
} | ||
} | ||
} |