dont close the network list. just hide it so its reusable

This commit is contained in:
Grant Limberg 2016-11-21 12:54:27 -08:00
parent a6ed711492
commit 8ebcd44405
3 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WinUI"
mc:Ignorable="d" x:Class="WinUI.NetworkListView"
Title="ZeroTier One" Height="500" Width="500" Icon="ZeroTierIcon.ico">
Title="ZeroTier One" SizeToContent="Width" Height="500" Width="Auto" Icon="ZeroTierIcon.ico">
<Window.Resources>
<SolidColorBrush x:Key="GreenBrush" Color="#ff91a2a3"/>

View File

@ -17,6 +17,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.ComponentModel;
namespace WinUI
{
@ -41,6 +42,12 @@ namespace WinUI
{
}
protected override void OnClosing(CancelEventArgs e)
{
e.Cancel = true;
Hide();
}
private void onClosed(object sender, System.EventArgs e)
{
NetworkMonitor.Instance.UnsubscribeNetworkUpdates(updateNetworks);

View File

@ -29,7 +29,7 @@ namespace WinUI
{
private APIHandler handler = APIHandler.Instance;
private NetworkListView netListView = null;
private NetworkListView netListView = new NetworkListView();
private JoinNetworkView joinNetView = null;
private AboutView aboutView = null;
private PreferencesView prefsView = null;
@ -122,8 +122,9 @@ namespace WinUI
{
netListView = new WinUI.NetworkListView();
netListView.Closed += ShowNetworksClosed;
netListView.Show();
}
netListView.Show();
}
private void ShowNetworksClosed(object sender, System.EventArgs e)