Skip to content

Commit

Permalink
Updated profile contextmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandKoenig committed Jun 29, 2021
1 parent 59b1d41 commit 6278bcf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions MessageCommunicator.TestGui/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
MinWidth="200" MinHeight="200"
Width="800" Height="550"
Icon="Assets/MessageCommunicator.ico"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaToDecorationsHint="False"
Title="MessageCommunicator">
<local:MainWindowFrame x:Name="CtrlWindowFrame"
Status="{Binding Path=StatusBarState}">
Expand Down Expand Up @@ -65,7 +65,6 @@
Header="Profiles"
Classes="GroupBox">
<DockPanel LastChildFill="True">

<Menu DockPanel.Dock="Top">
<MenuItem ToolTip.Tip="Create new profile"
Header="{local:VectorIconExtension Icon={StaticResource ResourceKey=IconCreate}}"
Expand Down Expand Up @@ -101,6 +100,19 @@
Icon="{local:VectorIconExtension Icon={StaticResource ResourceKey=IconStop}}"
IsEnabled="{Binding Path=#LstProfiles.SelectedItem.CanStop}"
Command="{Binding Path=#LstProfiles.SelectedItem.Command_Stop}" />
<Separator Classes="Horizontal" />

<MenuItem Header="Create profile"
Icon="{local:VectorIconExtension Icon={StaticResource ResourceKey=IconCreate}}"
Command="{Binding Path=Command_CreateProfile}" />
<MenuItem Header="Edit profile"
Icon="{local:VectorIconExtension Icon={StaticResource ResourceKey=IconEdit}}"
IsEnabled="{Binding Path=IsProfileSelected}"
Command="{Binding Path=Command_EditProfile}" />
<MenuItem Header="Remove profile"
Icon="{local:VectorIconExtension Icon={StaticResource ResourceKey=IconRemove}}"
IsEnabled="{Binding Path=IsProfileSelected}"
Command="{Binding Path=Command_DeleteProfile}" />
</ContextMenu>
</DataGrid.ContextMenu>

Expand Down
4 changes: 2 additions & 2 deletions MessageCommunicator.TestGui/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public ConnectionProfileViewModel? SelectedProfile
_selectedProfile = value;
this.SendMessageVM.CurrentConnectionProfile = _selectedProfile?.Model;
this.RaisePropertyChanged(nameof(this.SelectedProfile));
this.RaisePropertyChanged(nameof(this.IsProfileScreenEnabled));
this.RaisePropertyChanged(nameof(this.IsProfileSelected));
}
}
}
Expand All @@ -53,7 +53,7 @@ public MainWindowFrameStatus StatusBarState

public SendMessageViewModel SendMessageVM { get; }

public bool IsProfileScreenEnabled => _selectedProfile != null;
public bool IsProfileSelected => _selectedProfile != null;

public ReactiveCommand<object?, Unit> Command_ImportProfiles { get; }

Expand Down

0 comments on commit 6278bcf

Please sign in to comment.