Skip to content

Commit f1121d2

Browse files
committed
UI improved
1 parent b34490c commit f1121d2

13 files changed

Lines changed: 100 additions & 54 deletions

Source/NETworkManager/MainWindow.xaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,16 +447,28 @@
447447
<!-- /BUGFIX-->
448448
</ListView>
449449
</ScrollViewer>
450-
<Grid Grid.Row="1" MaxWidth="{Binding ElementName=ApplicationViewGrid, Path=MinWidth}" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding SearchNothingFound, Converter={StaticResource BooleanToVisibilityConverter}}">
450+
<Grid Grid.Row="1" MaxWidth="{Binding ElementName=ApplicationViewGrid, Path=MinWidth}" VerticalAlignment="Center" Visibility="{Binding SearchNothingFound, Converter={StaticResource BooleanToVisibilityConverter}}">
451451
<Grid.RowDefinitions>
452452
<RowDefinition Height="Auto" />
453453
<RowDefinition Height="Auto" />
454454
</Grid.RowDefinitions>
455-
<Rectangle Grid.Row="0" Width="24" Height="24" Fill="{DynamicResource GrayBrush3}" Margin="10">
456-
<Rectangle.OpacityMask>
457-
<VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=FilterRemoveOutline}" />
458-
</Rectangle.OpacityMask>
459-
</Rectangle>
455+
<Button Grid.Row="0" Command="{Binding ClearSearchCommand}" Style="{StaticResource CleanButton}" Margin="0,0,0,10">
456+
<Rectangle Width="24" Height="24">
457+
<Rectangle.OpacityMask>
458+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=FilterRemoveOutline}" />
459+
</Rectangle.OpacityMask>
460+
<Rectangle.Style>
461+
<Style TargetType="{x:Type Rectangle}">
462+
<Setter Property="Fill" Value="{DynamicResource GrayBrush3}" />
463+
<Style.Triggers>
464+
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True">
465+
<Setter Property="Fill" Value="{DynamicResource GrayBrush5}" />
466+
</DataTrigger>
467+
</Style.Triggers>
468+
</Style>
469+
</Rectangle.Style>
470+
</Rectangle>
471+
</Button>
460472
<TextBlock Grid.Row="1" Style="{StaticResource HeaderTextBlock}" Foreground="{DynamicResource GrayBrush3}" Text="{DynamicResource String_SearchedApplicationNotFound}" Margin="10,0" TextWrapping="Wrap" TextAlignment="Center" />
461473
</Grid>
462474
<Border Grid.Row="2" BorderBrush="{DynamicResource GrayBrush8}" BorderThickness="0,1,0,0" Background="Transparent">

Source/NETworkManager/MainWindow.xaml.cs

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public bool ApplicationView_Expand
5959
SettingsManager.Current.ApplicationView_Expand = value;
6060

6161
if (!value)
62-
ClearSearchFilterOnApplicationListMinimize();
62+
ClearSearchOnApplicationListMinimize();
6363

6464
_applicationView_Expand = value;
6565
OnPropertyChanged();
@@ -76,7 +76,7 @@ public bool IsTextBoxSearchFocused
7676
return;
7777

7878
if (!value)
79-
ClearSearchFilterOnApplicationListMinimize();
79+
ClearSearchOnApplicationListMinimize();
8080

8181
_isTextBoxSearchFocused = value;
8282
OnPropertyChanged();
@@ -93,7 +93,7 @@ public bool OpenApplicationList
9393
return;
9494

9595
if (!value)
96-
ClearSearchFilterOnApplicationListMinimize();
96+
ClearSearchOnApplicationListMinimize();
9797

9898
_openApplicationList = value;
9999
OnPropertyChanged();
@@ -110,7 +110,7 @@ public bool IsMouseOverApplicationList
110110
return;
111111

112112
if (!value)
113-
ClearSearchFilterOnApplicationListMinimize();
113+
ClearSearchOnApplicationListMinimize();
114114

115115
_isMouseOverApplicationList = value;
116116
OnPropertyChanged();
@@ -404,8 +404,8 @@ private async void MetroWindowMain_Closing(object sender, CancelEventArgs e)
404404
PingHostView pingHostView;
405405
TracerouteHostView tracerouteHostView;
406406
DNSLookupHostView dnsLookupHostView;
407-
RemoteDesktopView remoteDesktopView;
408-
PuTTYView puTTYView;
407+
RemoteDesktopHostView remoteDesktopHostView;
408+
PuTTYHostView puTTYHostView;
409409
SNMPHostView snmpHostView;
410410
WakeOnLANView wakeOnLANView;
411411
SubnetCalculatorHostView subnetCalculatorHostView;
@@ -459,16 +459,16 @@ private void ChangeApplicationView(ApplicationViewManager.Name name)
459459
contentControlApplication.Content = dnsLookupHostView;
460460
break;
461461
case ApplicationViewManager.Name.RemoteDesktop:
462-
if (remoteDesktopView == null)
463-
remoteDesktopView = new RemoteDesktopView();
462+
if (remoteDesktopHostView == null)
463+
remoteDesktopHostView = new RemoteDesktopHostView();
464464

465-
contentControlApplication.Content = remoteDesktopView;
465+
contentControlApplication.Content = remoteDesktopHostView;
466466
break;
467467
case ApplicationViewManager.Name.PuTTY:
468-
if (puTTYView == null)
469-
puTTYView = new PuTTYView();
468+
if (puTTYHostView == null)
469+
puTTYHostView = new PuTTYHostView();
470470

471-
contentControlApplication.Content = puTTYView;
471+
contentControlApplication.Content = puTTYHostView;
472472
break;
473473
case ApplicationViewManager.Name.SNMP:
474474
if (snmpHostView == null)
@@ -511,7 +511,7 @@ private void ChangeApplicationView(ApplicationViewManager.Name name)
511511
currentApplicationViewName = name;
512512
}
513513

514-
private void ClearSearchFilterOnApplicationListMinimize()
514+
private void ClearSearchOnApplicationListMinimize()
515515
{
516516
if (ApplicationView_Expand)
517517
return;
@@ -963,6 +963,16 @@ private void TextBoxSearchLostKeyboardFocusAction()
963963

964964
IsTextBoxSearchFocused = false;
965965
}
966+
967+
public ICommand ClearSearchCommand
968+
{
969+
get { return new RelayCommand(p => ClearSearchAction()); }
970+
}
971+
972+
private void ClearSearchAction()
973+
{
974+
Search = string.Empty;
975+
}
966976
#endregion
967977

968978
#region Bugfixes

Source/NETworkManager/NETworkManager.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@
377377
<Compile Include="Views\TracerouteHostView.xaml.cs">
378378
<DependentUpon>TracerouteHostView.xaml</DependentUpon>
379379
</Compile>
380-
<Compile Include="Views\PuTTYView.xaml.cs">
381-
<DependentUpon>PuTTYView.xaml</DependentUpon>
380+
<Compile Include="Views\PuTTYHostView.xaml.cs">
381+
<DependentUpon>PuTTYHostView.xaml</DependentUpon>
382382
</Compile>
383383
<Compile Include="Views\PingHostView.xaml.cs">
384384
<DependentUpon>PingHostView.xaml</DependentUpon>
@@ -410,8 +410,8 @@
410410
<Compile Include="Views\LookupPortLookupView.xaml.cs">
411411
<DependentUpon>LookupPortLookupView.xaml</DependentUpon>
412412
</Compile>
413-
<Compile Include="Views\RemoteDesktopView.xaml.cs">
414-
<DependentUpon>RemoteDesktopView.xaml</DependentUpon>
413+
<Compile Include="Views\RemoteDesktopHostView.xaml.cs">
414+
<DependentUpon>RemoteDesktopHostView.xaml</DependentUpon>
415415
</Compile>
416416
<Compile Include="Controls\DragablzPingTabHostWindow.xaml.cs">
417417
<DependentUpon>DragablzPingTabHostWindow.xaml</DependentUpon>
@@ -666,7 +666,7 @@
666666
<Generator>MSBuild:Compile</Generator>
667667
<SubType>Designer</SubType>
668668
</Page>
669-
<Page Include="Views\PuTTYView.xaml">
669+
<Page Include="Views\PuTTYHostView.xaml">
670670
<Generator>MSBuild:Compile</Generator>
671671
<SubType>Designer</SubType>
672672
</Page>
@@ -710,7 +710,7 @@
710710
<Generator>MSBuild:Compile</Generator>
711711
<SubType>Designer</SubType>
712712
</Page>
713-
<Page Include="Views\RemoteDesktopView.xaml">
713+
<Page Include="Views\RemoteDesktopHostView.xaml">
714714
<Generator>MSBuild:Compile</Generator>
715715
<SubType>Designer</SubType>
716716
</Page>

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,14 @@
400400
<system:String x:Key="String_OverwriteSettingsInTheDestinationFolder">Einstellungen im Zielordner überschreiben?\n\nWenn Sie auf "Verschieben &amp; neu starten" klicken, werden die restlichen Dateien kopiert und die Anwendung danach mit den neuen Einstellungen neu gestartet!</system:String>
401401
<system:String x:Key="String_Ping">Ping</system:String>
402402
<system:String x:Key="String_Trace">Trace</system:String>
403-
<system:String x:Key="String_AddATabToPerformANetworkScan">Fügen Sie eine Registerkarte hinzu, um einen Netzwerk-Scan durchzuführen...</system:String>
404-
<system:String x:Key="String_AddATabToPerformAPortScan">Fügen Sie eine Registerkarte hinzu, um einen Port-Scan durchzuführen...</system:String>
405-
<system:String x:Key="String_AddATabToPerformAPing">Fügen Sie eine Registerkarte hinzu, um einen Ping durchzuführen...</system:String>
406-
<system:String x:Key="String_AddATabToPerformATrace">Fügen Sie eine Registerkarte hinzu, um eine Ablaufverfolgung durchzuführen...</system:String>
407-
<system:String x:Key="String_AddATabToPerformADNSLookup">Fügen Sie eine Registerkarte hinzu, um eine DNS-Suche durchzuführen...</system:String>
408-
<system:String x:Key="String_AddATabToPerformAnSNMPAction">Fügen Sie eine Registerkarte hinzu, um eine SNMP-Aktion auszuführen...</system:String>
409-
<system:String x:Key="String_AddATabToQueryTheHTTPHeaders">Fügen Sie eine Registerkarte hinzu, um die HTTP Headers abzufragen...</system:String>
410-
<system:String x:Key="String_OpenANewConnectioByAddingANewTabOrDoubleClickingOnASession">Öffnen Sie eine neue Verbindung, indem Sie eine neue Registerkarte hinzufügen oder auf eine Sitzung doppelklicken...</system:String>
403+
<system:String x:Key="String_AddATabToPerformANetworkScan">Füge eine Registerkarte hinzu, um einen Netzwerk-Scan durchzuführen...</system:String>
404+
<system:String x:Key="String_AddATabToPerformAPortScan">Füge eine Registerkarte hinzu, um einen Port-Scan durchzuführen...</system:String>
405+
<system:String x:Key="String_AddATabToPerformAPing">Füge eine Registerkarte hinzu, um einen Ping durchzuführen...</system:String>
406+
<system:String x:Key="String_AddATabToPerformATrace">Füge eine Registerkarte hinzu, um eine Ablaufverfolgung durchzuführen...</system:String>
407+
<system:String x:Key="String_AddATabToPerformADNSLookup">Füge eine Registerkarte hinzu, um eine DNS-Suche durchzuführen...</system:String>
408+
<system:String x:Key="String_AddATabToPerformAnSNMPAction">Füge eine Registerkarte hinzu, um eine SNMP-Aktion auszuführen...</system:String>
409+
<system:String x:Key="String_AddATabToQueryTheHTTPHeaders">Füge eine Registerkarte hinzu, um die HTTP Headers abzufragen...</system:String>
410+
<system:String x:Key="String_AddATabToOpenANewConnection">Füge eine Registerkarte hinzu, um eine neue Verbindung zu öffnen...</system:String>
411411

412412
<!-- Documentation title -->
413413
<system:String x:Key="String_DocumentationTitle_00001">Wie installiere ich RDP 8.1 unter Windows 7 / Server 2008 R2?</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
<system:String x:Key="String_AddATabToPerformADNSLookup">Add a tab to perform a DNS lookup...</system:String>
408408
<system:String x:Key="String_AddATabToPerformAnSNMPAction">Add a tab to perform an SNMP action...</system:String>
409409
<system:String x:Key="String_AddATabToQueryTheHTTPHeaders">Add a tab to query the HTTP headers...</system:String>
410-
<system:String x:Key="String_OpenANewConnectioByAddingANewTabOrDoubleClickingOnASession">Open a new connection by adding a new tab or double-clicking on a session...</system:String>
410+
<system:String x:Key="String_AddATabToOpenANewConnection">Add a tab to open a new connection...</system:String>
411411

412412
<!-- Documentation title -->
413413
<system:String x:Key="String_DocumentationTitle_00001">How to install RDP 8.1 on Windows 7/Server 2008 R2</system:String>

Source/NETworkManager/ViewModels/PuTTYViewModel.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using NETworkManager.Controls;
33
using Dragablz;
44
using System.Windows.Input;
5-
using System.Windows;
65
using MahApps.Metro.Controls.Dialogs;
76
using NETworkManager.Models.Settings;
87
using System.Collections.Generic;
@@ -18,7 +17,7 @@
1817

1918
namespace NETworkManager.ViewModels
2019
{
21-
public class PuTTYViewModel : ViewModelBase
20+
public class PuTTYHostViewModel : ViewModelBase
2221
{
2322
#region Variables
2423
private IDialogCoordinator dialogCoordinator;
@@ -116,7 +115,7 @@ public string Search
116115
#endregion
117116

118117
#region Constructor
119-
public PuTTYViewModel(IDialogCoordinator instance)
118+
public PuTTYHostViewModel(IDialogCoordinator instance)
120119
{
121120
dialogCoordinator = instance;
122121

Source/NETworkManager/ViewModels/RemoteDesktopViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace NETworkManager.ViewModels
1717
{
18-
public class RemoteDesktopViewModel : ViewModelBase
18+
public class RemoteDesktopHostViewModel : ViewModelBase
1919
{
2020
#region Variables
2121
private IDialogCoordinator dialogCoordinator;
@@ -113,7 +113,7 @@ public string Search
113113
#endregion
114114

115115
#region Constructor
116-
public RemoteDesktopViewModel(IDialogCoordinator instance)
116+
public RemoteDesktopHostViewModel(IDialogCoordinator instance)
117117
{
118118
dialogCoordinator = instance;
119119

Source/NETworkManager/ViewModels/SettingsViewModel.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Text.RegularExpressions;
88
using NETworkManager.Utilities;
9+
using System.Windows.Input;
910

1011
namespace NETworkManager.ViewModels.Settings
1112
{
@@ -141,6 +142,18 @@ private void LoadSettings()
141142
}
142143
#endregion
143144

145+
#region ICommands & Actions
146+
public ICommand ClearSearchCommand
147+
{
148+
get { return new RelayCommand(p => ClearSearchAction()); }
149+
}
150+
151+
private void ClearSearchAction()
152+
{
153+
Search = string.Empty;
154+
}
155+
#endregion
156+
144157
#region Methods
145158
public void ChangeSettingsView(ApplicationViewManager.Name applicationName)
146159
{

Source/NETworkManager/Views/PuTTYView.xaml renamed to Source/NETworkManager/Views/PuTTYHostView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<UserControl x:Class="NETworkManager.Views.PuTTYView"
1+
<UserControl x:Class="NETworkManager.Views.PuTTYHostView"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -92,7 +92,7 @@
9292
</Rectangle.Style>
9393
</Rectangle>
9494
</Button>
95-
<TextBlock Text="{DynamicResource String_OpenANewConnectioByAddingANewTabOrDoubleClickingOnASession}" Style="{StaticResource MessageTextBlock}" />
95+
<TextBlock Text="{DynamicResource String_AddATabToOpenANewConnection}" Style="{StaticResource MessageTextBlock}" />
9696
</StackPanel>
9797
</Grid>
9898
<Border Grid.Column="1" Grid.Row="0" BorderThickness="1,0,0,0" BorderBrush="{DynamicResource GrayBrush8}">

Source/NETworkManager/Views/PuTTYView.xaml.cs renamed to Source/NETworkManager/Views/PuTTYHostView.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
namespace NETworkManager.Views
66
{
7-
public partial class PuTTYView : UserControl
7+
public partial class PuTTYHostView : UserControl
88
{
9-
PuTTYViewModel viewModel = new PuTTYViewModel(DialogCoordinator.Instance);
9+
PuTTYHostViewModel viewModel = new PuTTYHostViewModel(DialogCoordinator.Instance);
1010

11-
public PuTTYView()
11+
public PuTTYHostView()
1212
{
1313
InitializeComponent();
1414
DataContext = viewModel;

0 commit comments

Comments
 (0)