summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2016-11-21 12:54:27 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2016-11-21 12:54:27 -0800
commit8ebcd44405841dc0b7529336cdc5207bda876633 (patch)
tree049be61c48f1de3482306c562a8f3cc5527f38b8 /windows
parenta6ed711492eddfc85afa6fe171e69d7f8798ec23 (diff)
downloadinfinitytier-8ebcd44405841dc0b7529336cdc5207bda876633.tar.gz
infinitytier-8ebcd44405841dc0b7529336cdc5207bda876633.zip
dont close the network list. just hide it so its reusable
Diffstat (limited to 'windows')
-rw-r--r--windows/WinUI/NetworkListView.xaml2
-rw-r--r--windows/WinUI/NetworkListView.xaml.cs7
-rw-r--r--windows/WinUI/ToolbarItem.xaml.cs5
3 files changed, 11 insertions, 3 deletions
diff --git a/windows/WinUI/NetworkListView.xaml b/windows/WinUI/NetworkListView.xaml
index 30a3e257..1dc774b7 100644
--- a/windows/WinUI/NetworkListView.xaml
+++ b/windows/WinUI/NetworkListView.xaml
@@ -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"/>
diff --git a/windows/WinUI/NetworkListView.xaml.cs b/windows/WinUI/NetworkListView.xaml.cs
index 586f5dc2..26c40255 100644
--- a/windows/WinUI/NetworkListView.xaml.cs
+++ b/windows/WinUI/NetworkListView.xaml.cs
@@ -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);
diff --git a/windows/WinUI/ToolbarItem.xaml.cs b/windows/WinUI/ToolbarItem.xaml.cs
index b0c77b3f..3de573b7 100644
--- a/windows/WinUI/ToolbarItem.xaml.cs
+++ b/windows/WinUI/ToolbarItem.xaml.cs
@@ -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)