diff --git a/Tasks/UrlTester/DT3/DT3cs.cs b/Tasks/UrlTester/DT3/DT3cs.cs
index 5ef830d..4f3ccb4 100644
--- a/Tasks/UrlTester/DT3/DT3cs.cs
+++ b/Tasks/UrlTester/DT3/DT3cs.cs
@@ -54,6 +54,7 @@ namespace DT3 {
{
url = value;
NotifyPropertyChanged();
+ _ = urlTester.GetUrlAsync(Url);
}
}
diff --git a/Tasks/UrlTester/MainWindow.xaml b/Tasks/UrlTester/MainWindow.xaml
index 5c0e20e..949bdf1 100644
--- a/Tasks/UrlTester/MainWindow.xaml
+++ b/Tasks/UrlTester/MainWindow.xaml
@@ -5,7 +5,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DT3"
mc:Ignorable="d"
- DataContext="{Binding RelativeSource={RelativeSource Self}}"
Title="MainWindow"
Height="450"
Width="800">
@@ -33,10 +32,9 @@
+ IsDefault="true" />
+ Text="{Binding Url, Mode=OneWayToSource}" />
diff --git a/Tasks/UrlTester/MainWindow.xaml.cs b/Tasks/UrlTester/MainWindow.xaml.cs
index 42af55b..6c92a91 100644
--- a/Tasks/UrlTester/MainWindow.xaml.cs
+++ b/Tasks/UrlTester/MainWindow.xaml.cs
@@ -10,6 +10,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DT2;
+using DT3;
namespace UrlTester;
@@ -18,39 +19,9 @@ namespace UrlTester;
///
public partial class MainWindow : Window
{
- public static readonly DependencyProperty SizeProperty = DependencyProperty.Register(
- "Size",
- typeof(int),
- typeof(MainWindow));
-
- public static readonly DependencyProperty TimeProperty = DependencyProperty.Register(
- "Time",
- typeof(long),
- typeof(MainWindow));
-
public MainWindow()
{
InitializeComponent();
- }
-
- public void GetUrl(object sender, RoutedEventArgs e)
- {
- var tester = new DT2.UrlTester();
- var stopWatch = new Stopwatch();
-
- tester.PageStart += (_) =>
- {
- stopWatch.Start();
- };
-
- tester.PageLoaded += (_, size) =>
- {
- stopWatch.Stop();
- SetValue(SizeProperty, size);
- SetValue(TimeProperty, stopWatch.ElapsedMilliseconds);
- Debug.WriteLine("");
- };
-
- _ = tester.GetUrlAsync(urlBox.Text);
+ DataContext = new UrlTesterModel();
}
}
\ No newline at end of file