Network list window opens with click on the menu item

This commit is contained in:
Grant Limberg
2016-11-08 16:31:07 -08:00
parent e1f9f7b6dc
commit 7cf3d2caa1
8 changed files with 57 additions and 42 deletions

View File

@ -24,7 +24,9 @@ namespace WinUI
/// </summary>
public partial class ToolbarItem : Window
{
APIHandler handler = APIHandler.Instance;
private APIHandler handler = APIHandler.Instance;
NetworkList netList = null;
public ToolbarItem()
{
@ -40,5 +42,29 @@ namespace WinUI
{
Console.WriteLine("PreviewTrayContextMenuOpen");
}
private void ToolbarItem_NodeIDClicked(object sender, System.Windows.RoutedEventArgs e)
{
}
private void ToolbarItem_ShowNetworksClicked(object sender, System.Windows.RoutedEventArgs e)
{
if (netList == null)
{
netList = new WinUI.NetworkList();
netList.Closed += ShowNetworksClosed;
}
if (!netList.IsVisible)
{
netList.Show();
}
}
private void ShowNetworksClosed(object sender, System.EventArgs e)
{
netList = null;
}
}
}