Skip to content

Commit 0969c7d

Browse files
committed
Notification added, when no profiles found
1 parent 98a2afc commit 0969c7d

4 files changed

Lines changed: 46 additions & 25 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
<system:String x:Key="String_ComingSoon">Kommt demnächst!</system:String>
226226
<system:String x:Key="String_Override">überschreiben</system:String>
227227
<system:String x:Key="String_Add">hinzufügen</system:String>
228+
<system:String x:Key="String_NoProfilesFoundCreateOne">Keine Profile gefunden! Erstelle eins...</system:String>
228229

229230
<!-- Buttons -->
230231
<system:String x:Key="String_Button_Change">Wechseln</system:String>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@
225225
<system:String x:Key="String_ComingSoon">Coming Soon!</system:String>
226226
<system:String x:Key="String_Override">override</system:String>
227227
<system:String x:Key="String_Add">add</system:String>
228-
228+
<system:String x:Key="String_NoProfilesFoundCreateOne">No profiles found! Create one...</system:String>
229+
229230
<!-- Buttons -->
230231
<system:String x:Key="String_Button_Change">Change</system:String>
231232
<system:String x:Key="String_Button_Default">Default</system:String>

Source/NETworkManager/ViewModels/Applications/NetworkInterfaceViewModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,9 @@ public NetworkInterfaceProfileInfo SelectedProfile
579579
{
580580
get { return _selectedProfile; }
581581
set
582-
{
582+
{
583+
584+
583585
if (value == _selectedProfile)
584586
return;
585587

@@ -633,7 +635,7 @@ public NetworkInterfaceViewModel(IDialogCoordinator instance)
633635
NetworkInterfaceProfileManager.Load();
634636

635637
_networkInterfaceProfiles = CollectionViewSource.GetDefaultView(NetworkInterfaceProfileManager.Profiles);
636-
638+
637639
LoadSettings();
638640

639641
_isLoading = false;

Source/NETworkManager/Views/Applications/NetworkInterfaceView.xaml

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -478,28 +478,45 @@
478478
</Grid>
479479
<Border Grid.Column="1" BorderThickness="1,0,0,0" BorderBrush="{DynamicResource GrayBrush8}">
480480
<Expander x:Name="expanderProfile" Header="{DynamicResource String_Header_Profiles}" Style="{StaticResource ProfileExpander}" IsExpanded="{Binding ExpandProfileView}">
481-
<ListBox x:Name="listBoxProfiles" Width="250" FontSize="14" ItemsSource="{Binding NetworkInterfaceProfiles}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedProfile}">
482-
<ListBox.Resources>
483-
<Style TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource DefaulScrollViewer}" />
484-
<ContextMenu x:Key="ListBoxItemContextMenu" Opened="ContextMenu_Opened" MinWidth="150">
485-
<MenuItem Header="{DynamicResource String_Delete}" Command="{Binding DeleteProfileCommand}">
486-
<MenuItem.Icon>
487-
<Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
488-
<Rectangle.OpacityMask>
489-
<VisualBrush Stretch="Uniform" Visual="{IconPacks:PackIconMaterialLight Kind=Delete}" />
490-
</Rectangle.OpacityMask>
491-
</Rectangle>
492-
</MenuItem.Icon>
493-
</MenuItem>
494-
</ContextMenu>
495-
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource MetroListBoxItem}">
496-
<Setter Property="ContextMenu" Value="{StaticResource ListBoxItemContextMenu}" />
497-
</Style>
498-
</ListBox.Resources>
499-
<ListBox.InputBindings>
500-
<KeyBinding Command="{Binding DeleteProfileCommand}" Key="Delete" />
501-
</ListBox.InputBindings>
502-
</ListBox>
481+
<Grid Width="250">
482+
<Grid.RowDefinitions>
483+
<RowDefinition Height="*" />
484+
</Grid.RowDefinitions>
485+
<ListBox Grid.Column="0" Grid.Row="0" x:Name="listBoxProfiles" FontSize="14" ItemsSource="{Binding NetworkInterfaceProfiles}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedProfile}">
486+
<ListBox.Resources>
487+
<Style TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource DefaulScrollViewer}" />
488+
<ContextMenu x:Key="ListBoxItemContextMenu" Opened="ContextMenu_Opened" MinWidth="150">
489+
<MenuItem Header="{DynamicResource String_Delete}" Command="{Binding DeleteProfileCommand}">
490+
<MenuItem.Icon>
491+
<Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}">
492+
<Rectangle.OpacityMask>
493+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:PackIconMaterialLight Kind=Delete}" />
494+
</Rectangle.OpacityMask>
495+
</Rectangle>
496+
</MenuItem.Icon>
497+
</MenuItem>
498+
</ContextMenu>
499+
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource MetroListBoxItem}">
500+
<Setter Property="ContextMenu" Value="{StaticResource ListBoxItemContextMenu}" />
501+
</Style>
502+
</ListBox.Resources>
503+
<ListBox.InputBindings>
504+
<KeyBinding Command="{Binding DeleteProfileCommand}" Key="Delete" />
505+
</ListBox.InputBindings>
506+
</ListBox>
507+
<TextBlock Grid.Row="0" FontSize="18" Foreground="{DynamicResource GrayBrush3}" Text="{DynamicResource String_NoProfilesFoundCreateOne}" VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center" Margin="10,0" >
508+
<TextBlock.Style>
509+
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextBlock}">
510+
<Setter Property="Visibility" Value="Collapsed" />
511+
<Style.Triggers>
512+
<DataTrigger Binding="{Binding NetworkInterfaceProfiles.Count}" Value="0">
513+
<Setter Property="Visibility" Value="Visible" />
514+
</DataTrigger>
515+
</Style.Triggers>
516+
</Style>
517+
</TextBlock.Style>
518+
</TextBlock>
519+
</Grid>
503520
</Expander>
504521
</Border>
505522
</Grid>

0 commit comments

Comments
 (0)