Add click events and reset button OUT-592
authorThomas
Wed, 02 Oct 2019 19:29:07 +0200
branchOUT-592
changeset 2781dfa464a49ad6
parent 2780 ff102a016660
child 2782 3d6c5b2a88ab
Add click events and reset button
UI/RibbonCustomizations.cs
UI/ViewModels/HandshakeDialogViewModel.cs
UI/ViewModels/HandshakeViewModel.cs
UI/ViewModels/WizardGenericPageViewModel.cs
UI/Views/HandshakeDialogView.xaml
UI/Views/HandshakeDialogView.xaml.cs
UI/Views/HandshakeView.xaml
UI/Views/HandshakeView.xaml.cs
     1.1 --- a/UI/RibbonCustomizations.cs	Wed Oct 02 14:35:44 2019 +0200
     1.2 +++ b/UI/RibbonCustomizations.cs	Wed Oct 02 19:29:07 2019 +0200
     1.3 @@ -930,9 +930,9 @@
     1.4          {
     1.5              try
     1.6              {
     1.7 -                //Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
     1.8                  if (WatchedWindow.HandshakeDialog == null)
     1.9                  {
    1.10 +                    //Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
    1.11                      Globals.ThisAddIn.GetWatchedWindow(control.Context)?.BuildAndShowManager();
    1.12                  }
    1.13                  else
     2.1 --- a/UI/ViewModels/HandshakeDialogViewModel.cs	Wed Oct 02 14:35:44 2019 +0200
     2.2 +++ b/UI/ViewModels/HandshakeDialogViewModel.cs	Wed Oct 02 19:29:07 2019 +0200
     2.3 @@ -136,25 +136,18 @@
     2.4                  // Remove duplicates (by address)
     2.5                  partnerIdentities = partnerIdentities.GroupBy(x => x.Address).Select(x => x.First()).ToList();
     2.6  
     2.7 -                // Create handshake entries
     2.8 -                int i = 0;
     2.9 +                // Add primary partners
    2.10 +                int counter = 0;
    2.11                  partnerIdentities?.ForEach(identity =>
    2.12                  {
    2.13                      if (identity.IsAddressValid)
    2.14                      {
    2.15 -                        HandshakeViewModel handshakeViewModel = new HandshakeViewModel(this.Dialog.Myself, identity, this);
    2.16 -                        if (i++ == 0)
    2.17 +                        HandshakeViewModel handshakeViewModel = new HandshakeViewModel(this.Dialog.Myself, identity, this)
    2.18                          {
    2.19 -                            if (identity.Color == pEpColor.pEpColorYellow)
    2.20 -                            {
    2.21 -                                handshakeViewModel.IsExpanded = true;
    2.22 -                            }
    2.23 -                            else
    2.24 -                            {
    2.25 -                                i--;
    2.26 -                            }
    2.27 -                        }
    2.28 -                        
    2.29 +                            IsExpanded = (counter++ == 0),
    2.30 +                            IsSeparatorVisible = (counter < partnerIdentities.Count)
    2.31 +                        };
    2.32 +
    2.33                          this.PartnerIdentities.Add(handshakeViewModel);
    2.34                      }
    2.35                      else // Invalid identity
    2.36 @@ -176,11 +169,17 @@
    2.37                  secondaryPartners = secondaryPartners.GroupBy(x => x.Address).Select(x => x.First()).ToList();
    2.38  
    2.39                  // Create handshake entries
    2.40 +                int counter = 0;
    2.41                  secondaryPartners?.ForEach(identity =>
    2.42                  {
    2.43                      if (identity.IsAddressValid)
    2.44                      {
    2.45 -                        this.SecondaryPartnerIdentities.Add(new HandshakeViewModel(this.Dialog.Myself, identity, this));
    2.46 +                        HandshakeViewModel handshakeViewModel = new HandshakeViewModel(this.Dialog.Myself, identity, this)
    2.47 +                        {
    2.48 +                            IsSeparatorVisible = (++counter < SecondaryPartnerIdentities.Count)
    2.49 +                        };
    2.50 +
    2.51 +                        this.SecondaryPartnerIdentities.Add(handshakeViewModel);
    2.52                      }
    2.53                      else // Invalid identity
    2.54                      {
    2.55 @@ -307,6 +306,19 @@
    2.56              return result;
    2.57          }
    2.58  
    2.59 +        public void ChangeSelection(HandshakeViewModel newSelection)
    2.60 +        {
    2.61 +            this.PartnerIdentities?.ToList()?.ForEach(identity =>
    2.62 +            {
    2.63 +                identity.IsExpanded = identity.Equals(newSelection);
    2.64 +            });
    2.65 +
    2.66 +            this.SecondaryPartnerIdentities?.ToList()?.ForEach(identity =>
    2.67 +            {
    2.68 +                identity.IsExpanded = identity.Equals(newSelection);
    2.69 +            });
    2.70 +        }
    2.71 +
    2.72          #endregion
    2.73      }
    2.74  }
     3.1 --- a/UI/ViewModels/HandshakeViewModel.cs	Wed Oct 02 14:35:44 2019 +0200
     3.2 +++ b/UI/ViewModels/HandshakeViewModel.cs	Wed Oct 02 19:29:07 2019 +0200
     3.3 @@ -22,6 +22,7 @@
     3.4          private bool                                _AreTabControlsVisible      = false;
     3.5          private bool                                _AreTrustwordsExpanded      = false;
     3.6          private RelayCommand                        _ButtonConfirmOnClick       = null;
     3.7 +        private RelayCommand                        _ButtonResetOnClick         = null;
     3.8          private RelayCommand                        _ButtonWrongOnClick         = null;
     3.9          private string                              _ButtonConfirmText          = null;
    3.10          private string                              _ButtonWrongText            = null;
    3.11 @@ -29,8 +30,10 @@
    3.12          private string                              _FingerprintMyself          = null;
    3.13          private string                              _FingerprintPartner         = null;
    3.14          private bool                                _IsExpanded                 = false;
    3.15 +        private bool                                _IsSeparatorVisible         = false;
    3.16 +        private Thickness                           _Margin                     = new Thickness(0);
    3.17 +        private PEPIdentity                         _Partner                    = null;
    3.18          private string                              _PartnerDisplayName         = null;
    3.19 -        private Thickness                           _Margin                     = new Thickness(0);
    3.20          private ImageSource                         _PEPColorIcon               = null;
    3.21          private CultureInfo                         _TrustwordsCulture          = null;
    3.22          private string                              _TrustwordsFull             = null;
    3.23 @@ -161,6 +164,19 @@
    3.24          }
    3.25  
    3.26          /// <summary>
    3.27 +        /// Gets or sets whether the separator is visible.
    3.28 +        /// </summary>
    3.29 +        public bool IsSeparatorVisible
    3.30 +        {
    3.31 +            get => this._IsSeparatorVisible;
    3.32 +            set
    3.33 +            {
    3.34 +                this._IsSeparatorVisible = value;
    3.35 +                this.OnPropertyChanged();
    3.36 +            }
    3.37 +        }
    3.38 +
    3.39 +        /// <summary>
    3.40          /// Gets or sets the margin of the handshake view.
    3.41          /// </summary>
    3.42          public Thickness Margin
    3.43 @@ -210,9 +226,17 @@
    3.44          public PEPIdentity Myself { get; } = null;
    3.45  
    3.46          /// <summary>
    3.47 -        /// Gets the partner identity.
    3.48 +        /// Gets or sets the partner identity.
    3.49          /// </summary>
    3.50 -        public PEPIdentity Partner { get; } = null;
    3.51 +        public PEPIdentity Partner
    3.52 +        {
    3.53 +            get => this._Partner;
    3.54 +            set
    3.55 +            {
    3.56 +                this._Partner = value;
    3.57 +                this.OnPropertyChanged();
    3.58 +            }
    3.59 +        }
    3.60  
    3.61          /// <summary>
    3.62          /// Gets or sets the current trustwords culture/language.
    3.63 @@ -329,6 +353,22 @@
    3.64          }
    3.65  
    3.66          /// <summary>
    3.67 +        /// Command to execute when the Reset button is clicked.
    3.68 +        /// </summary>
    3.69 +        public RelayCommand ButtonResetOnClick
    3.70 +        {
    3.71 +            get
    3.72 +            {
    3.73 +                if (this._ButtonResetOnClick == null)
    3.74 +                {
    3.75 +                    this._ButtonResetOnClick = new RelayCommand(p => this.ResetIdentity());
    3.76 +                }
    3.77 +
    3.78 +                return this._ButtonResetOnClick;
    3.79 +            }
    3.80 +        }
    3.81 +
    3.82 +        /// <summary>
    3.83          /// Command to execute when the Wrong button is clicked.
    3.84          /// </summary>
    3.85          public RelayCommand ButtonWrongOnClick
    3.86 @@ -454,6 +494,30 @@
    3.87          }
    3.88  
    3.89          /// <summary>
    3.90 +        /// Resets the Partner identity.
    3.91 +        /// </summary>
    3.92 +        private void ResetIdentity()
    3.93 +        {
    3.94 +            try
    3.95 +            {
    3.96 +                pEpIdentity identity = this.Partner.ToCOMType();
    3.97 +                ThisAddIn.PEPEngine.KeyResetIdentity(identity, null);
    3.98 +
    3.99 +                identity = ThisAddIn.PEPEngine.UpdateIdentity(identity);
   3.100 +                this.Partner = new PEPIdentity(identity);
   3.101 +
   3.102 +                pEpColor newColor = ThisAddIn.PEPEngine.IdentityRating(identity).ToColor();
   3.103 +                this.PEPColorIcon = HandshakeDialogViewModel.GetColorIcon(newColor);
   3.104 +
   3.105 +                Notification.Show(Properties.Resources.Options_Reset, Properties.Resources.Notifications_CommunicationPartnerReset);
   3.106 +            }
   3.107 +            catch (Exception ex)
   3.108 +            {
   3.109 +                Log.Error("ResetIdentity: Error occured. " + ex.ToString());
   3.110 +            }
   3.111 +        }
   3.112 +
   3.113 +        /// <summary>
   3.114          /// Sets the text of the Confirm/Wrong buttons depending on the active tab.
   3.115          /// </summary>
   3.116          private void SetButtonsText()
     4.1 --- a/UI/ViewModels/WizardGenericPageViewModel.cs	Wed Oct 02 14:35:44 2019 +0200
     4.2 +++ b/UI/ViewModels/WizardGenericPageViewModel.cs	Wed Oct 02 19:29:07 2019 +0200
     4.3 @@ -4,23 +4,9 @@
     4.4  {
     4.5      public class WizardGenericPageViewModel : WizardPageViewModelBase
     4.6      {
     4.7 -        private string          _ExplanationText    = null;
     4.8          private ImageSource     _Image              = null;
     4.9  
    4.10          /// <summary>
    4.11 -        /// Gets or sets the text that explains the current wizard step.
    4.12 -        /// </summary>
    4.13 -        public string ExplanationText
    4.14 -        {
    4.15 -            get => this._ExplanationText;
    4.16 -            set
    4.17 -            {
    4.18 -                this._ExplanationText = value;
    4.19 -                this.OnPropertyChanged();
    4.20 -            }
    4.21 -        }
    4.22 -
    4.23 -        /// <summary>
    4.24          /// Gets or sets the image/icon to display in the current wizard step.
    4.25          /// </summary>
    4.26          public ImageSource Image
     5.1 --- a/UI/Views/HandshakeDialogView.xaml	Wed Oct 02 14:35:44 2019 +0200
     5.2 +++ b/UI/Views/HandshakeDialogView.xaml	Wed Oct 02 19:29:07 2019 +0200
     5.3 @@ -25,6 +25,27 @@
     5.4          
     5.5          <!--Handshake items-->
     5.6          <ItemsControl ItemsSource="{Binding PartnerIdentities}" />
     5.7 -        
     5.8 +
     5.9 +        <!--Expander for identities without color-->
    5.10 +        <StackPanel Visibility="{Binding Path=IsExpanderVisible, Converter={StaticResource BoolToVisibility}}">
    5.11 +            <StackPanel Orientation="Horizontal"
    5.12 +                        HorizontalAlignment="Center"
    5.13 +                        VerticalAlignment="Center">
    5.14 +                <Expander ExpandDirection="Down"
    5.15 +                          Margin="10"
    5.16 +                          Collapsed="SecondaryPartnerExpander_Toggled"
    5.17 +                          Expanded="SecondaryPartnerExpander_Toggled" />
    5.18 +                <TextBlock Text="{x:Static p:Resources.Handshake_ShowAllRecipientsText}"
    5.19 +                           TextWrapping="Wrap"
    5.20 +                           VerticalAlignment="Center"
    5.21 +                           Margin="10" />
    5.22 +            </StackPanel>
    5.23 +
    5.24 +            <!--Identities section-->
    5.25 +            <ItemsControl ItemsSource="{Binding SecondaryPartnerIdentities}" 
    5.26 +                          Visibility="{Binding Path=IsExpanderExpanded, Converter={StaticResource BoolToVisibility}}" />
    5.27 +
    5.28 +        </StackPanel>
    5.29 +
    5.30      </StackPanel>
    5.31  </UserControl>
     6.1 --- a/UI/Views/HandshakeDialogView.xaml.cs	Wed Oct 02 14:35:44 2019 +0200
     6.2 +++ b/UI/Views/HandshakeDialogView.xaml.cs	Wed Oct 02 19:29:07 2019 +0200
     6.3 @@ -1,4 +1,6 @@
     6.4 -´╗┐using System.Windows.Controls;
     6.5 +´╗┐using pEp.UI.ViewModels;
     6.6 +using System.Windows;
     6.7 +using System.Windows.Controls;
     6.8  
     6.9  namespace pEp.UI.Views
    6.10  {
    6.11 @@ -11,5 +13,14 @@
    6.12          {
    6.13              InitializeComponent();
    6.14          }
    6.15 +
    6.16 +        #region Event handlers
    6.17 +
    6.18 +        private void SecondaryPartnerExpander_Toggled(object sender, RoutedEventArgs e)
    6.19 +        {
    6.20 +            (this.DataContext as HandshakeDialogViewModel).IsExpanderExpanded = ((sender as Expander)?.IsExpanded == true);
    6.21 +        }
    6.22 +
    6.23 +        #endregion
    6.24      }
    6.25  }
     7.1 --- a/UI/Views/HandshakeView.xaml	Wed Oct 02 14:35:44 2019 +0200
     7.2 +++ b/UI/Views/HandshakeView.xaml	Wed Oct 02 19:29:07 2019 +0200
     7.3 @@ -37,17 +37,37 @@
     7.4                  <ui:DialogTypeToBooleanConverter />
     7.5                  <BooleanToVisibilityConverter />
     7.6              </ui:ValueConverterGroup>
     7.7 -            
     7.8 +
     7.9              <!-- Dictionary -->
    7.10              <ResourceDictionary.MergedDictionaries>
    7.11                  <ResourceDictionary Source="pack://application:,,,/pEp;component/Resources/Dictionary.xaml" />
    7.12              </ResourceDictionary.MergedDictionaries>
    7.13          </ResourceDictionary>
    7.14      </UserControl.Resources>
    7.15 -    
    7.16 +
    7.17      <!--The window content-->
    7.18      <StackPanel Width="480"
    7.19 -                Margin="{Binding Margin}">
    7.20 +                Margin="{Binding Margin}"
    7.21 +                MouseLeftButtonUp="HandshakeItem_MouseLeftButtonUp">
    7.22 +
    7.23 +        <StackPanel.Style>
    7.24 +            <Style TargetType="StackPanel">
    7.25 +                <Setter Property="Background"
    7.26 +                                Value="Transparent" />
    7.27 +                <Style.Triggers>
    7.28 +                    <MultiDataTrigger>
    7.29 +                        <MultiDataTrigger.Conditions>
    7.30 +                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
    7.31 +                                               Value="True" />
    7.32 +                            <Condition Binding="{Binding Path=IsExpanded}"
    7.33 +                                               Value="False" />
    7.34 +                        </MultiDataTrigger.Conditions>
    7.35 +                        <Setter Property="Background"
    7.36 +                                        Value="{x:Static SystemColors.ControlLightBrush}" />
    7.37 +                    </MultiDataTrigger>
    7.38 +                </Style.Triggers>
    7.39 +            </Style>
    7.40 +        </StackPanel.Style>
    7.41  
    7.42          <!-- The User name and icon -->
    7.43          <StackPanel Orientation="Horizontal"
    7.44 @@ -71,74 +91,75 @@
    7.45          <!--Interaction area-->
    7.46          <StackPanel Visibility="{Binding IsExpanded, Converter={StaticResource BoolToVisibility}}">
    7.47  
    7.48 -            <!--Tabs-->
    7.49 -            <StackPanel Orientation="Horizontal"
    7.50 +            <StackPanel Visibility="{Binding Partner.Color, Converter={StaticResource ColorToVisibility}, ConverterParameter=pEpColorYellow}">
    7.51 +                <!--Tabs-->
    7.52 +                <StackPanel Orientation="Horizontal"
    7.53                      HorizontalAlignment="Right">
    7.54 -                <Label Name="TabControlTrustwords"
    7.55 +                    <Label Name="TabControlTrustwords"
    7.56                     MouseLeftButtonUp="TabControlTrustwords_MouseLeftButtonUp"
    7.57                     Content="{x:Static p:Resources.Handshake_TrustwordsText}"
    7.58                     Visibility="{Binding Path=AreTabControlsVisible, Converter={StaticResource BoolToVisibility}}">
    7.59 -                    <Label.Style>
    7.60 -                        <Style TargetType="Label">
    7.61 -                            <Setter Property="BorderBrush"
    7.62 +                        <Label.Style>
    7.63 +                            <Style TargetType="Label">
    7.64 +                                <Setter Property="BorderBrush"
    7.65                                  Value="LightGray" />
    7.66 -                            <Setter Property="Background"
    7.67 +                                <Setter Property="Background"
    7.68                                  Value="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBackground}, ConverterParameter=Trustwords}" />
    7.69 -                            <Setter Property="BorderThickness"
    7.70 +                                <Setter Property="BorderThickness"
    7.71                                  Value="1" />
    7.72 -                            <Setter Property="Padding"
    7.73 +                                <Setter Property="Padding"
    7.74                                  Value="10,5" />
    7.75 -                            <Style.Triggers>
    7.76 -                                <MultiDataTrigger>
    7.77 -                                    <MultiDataTrigger.Conditions>
    7.78 -                                        <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
    7.79 +                                <Style.Triggers>
    7.80 +                                    <MultiDataTrigger>
    7.81 +                                        <MultiDataTrigger.Conditions>
    7.82 +                                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
    7.83                                                 Value="True" />
    7.84 -                                        <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Trustwords}"
    7.85 +                                            <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Trustwords}"
    7.86                                                 Value="False" />
    7.87 -                                    </MultiDataTrigger.Conditions>
    7.88 -                                    <Setter Property="Background"
    7.89 +                                        </MultiDataTrigger.Conditions>
    7.90 +                                        <Setter Property="Background"
    7.91                                          Value="AliceBlue" />
    7.92 -                                    <Setter Property="BorderBrush"
    7.93 +                                        <Setter Property="BorderBrush"
    7.94                                          Value="LightSkyBlue" />
    7.95 -                                </MultiDataTrigger>
    7.96 -                            </Style.Triggers>
    7.97 -                        </Style>
    7.98 -                    </Label.Style>
    7.99 -                </Label>
   7.100 -                <Label Name="TabControlFingerprint"
   7.101 +                                    </MultiDataTrigger>
   7.102 +                                </Style.Triggers>
   7.103 +                            </Style>
   7.104 +                        </Label.Style>
   7.105 +                    </Label>
   7.106 +                    <Label Name="TabControlFingerprint"
   7.107                     MouseLeftButtonUp="TabControlFingerprint_MouseLeftButtonUp"
   7.108                     Content="{x:Static p:Resources.Handshake_FingerprintText}"
   7.109                     Visibility="{Binding Path=AreTabControlsVisible, Converter={StaticResource BoolToVisibility}}">
   7.110 -                    <Label.Style>
   7.111 -                        <Style TargetType="Label">
   7.112 -                            <Setter Property="BorderBrush"
   7.113 +                        <Label.Style>
   7.114 +                            <Style TargetType="Label">
   7.115 +                                <Setter Property="BorderBrush"
   7.116                                  Value="LightGray" />
   7.117 -                            <Setter Property="Background"
   7.118 +                                <Setter Property="Background"
   7.119                                  Value="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBackground}, ConverterParameter=Fingerprint}" />
   7.120 -                            <Setter Property="BorderThickness"
   7.121 +                                <Setter Property="BorderThickness"
   7.122                                  Value="1" />
   7.123 -                            <Setter Property="Padding"
   7.124 +                                <Setter Property="Padding"
   7.125                                  Value="10,5" />
   7.126 -                            <Style.Triggers>
   7.127 -                                <MultiDataTrigger>
   7.128 -                                    <MultiDataTrigger.Conditions>
   7.129 -                                        <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
   7.130 +                                <Style.Triggers>
   7.131 +                                    <MultiDataTrigger>
   7.132 +                                        <MultiDataTrigger.Conditions>
   7.133 +                                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
   7.134                                                 Value="True" />
   7.135 -                                        <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Fingerprint}"
   7.136 +                                            <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Fingerprint}"
   7.137                                                 Value="False" />
   7.138 -                                    </MultiDataTrigger.Conditions>
   7.139 -                                    <Setter Property="Background"
   7.140 +                                        </MultiDataTrigger.Conditions>
   7.141 +                                        <Setter Property="Background"
   7.142                                          Value="AliceBlue" />
   7.143 -                                    <Setter Property="BorderBrush"
   7.144 +                                        <Setter Property="BorderBrush"
   7.145                                          Value="LightSkyBlue" />
   7.146 -                                </MultiDataTrigger>
   7.147 -                            </Style.Triggers>
   7.148 -                        </Style>
   7.149 -                    </Label.Style>
   7.150 -                </Label>
   7.151 +                                    </MultiDataTrigger>
   7.152 +                                </Style.Triggers>
   7.153 +                            </Style>
   7.154 +                        </Label.Style>
   7.155 +                    </Label>
   7.156  
   7.157 -                <!--Language selector-->
   7.158 -                <ComboBox Padding="10,2"
   7.159 +                    <!--Language selector-->
   7.160 +                    <ComboBox Padding="10,2"
   7.161                        VerticalContentAlignment="Center"
   7.162                        ItemsSource="{Binding Path=TrustwordsCultureList, Mode=OneWay}"
   7.163                        DisplayMemberPath="Value"
   7.164 @@ -146,65 +167,84 @@
   7.165                        SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}"
   7.166                        IsEnabled="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Trustwords}"
   7.167                        Foreground="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled, Converter={StaticResource IsEnabledToColor}}" />
   7.168 -            </StackPanel>
   7.169 +                </StackPanel>
   7.170  
   7.171 -            <!-- Trustwords -->
   7.172 -            <StackPanel Background="White"
   7.173 +                <!-- Trustwords -->
   7.174 +                <StackPanel Background="White"
   7.175                      Visibility="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToVisibility}, ConverterParameter=Trustwords}">
   7.176 -                <TextBox Background="Transparent"
   7.177 +                    <TextBox Background="Transparent"
   7.178                       BorderThickness="0"
   7.179                       Text="{Binding Path=TrustwordsShort}"
   7.180                       Visibility="{Binding Path=AreTrustwordsExpanded, Converter={StaticResource InvertBoolToVisibility}}"
   7.181                       IsReadOnly="True"
   7.182                       TextWrapping="Wrap" 
   7.183                       Padding="10"/>
   7.184 -                <TextBox Background="Transparent"
   7.185 +                    <TextBox Background="Transparent"
   7.186                       BorderThickness="0"
   7.187                       Text="{Binding Path=TrustwordsFull}"
   7.188                       Visibility="{Binding Path=AreTrustwordsExpanded, Converter={StaticResource BoolToVisibility}}"
   7.189                       IsReadOnly="True"
   7.190                       TextWrapping="Wrap"
   7.191                       Padding="10" />
   7.192 -                <Expander ExpandDirection="Down"
   7.193 +                    <Expander ExpandDirection="Down"
   7.194                        Margin="10,10,5,5"
   7.195                        ToolTip="{Binding Path=ExpanderToolTip, Mode=OneWay}"                     
   7.196                        Collapsed="ExpanderTrustwords_Toggled"
   7.197                        Expanded="ExpanderTrustwords_Toggled" />
   7.198 +                </StackPanel>
   7.199 +
   7.200 +                <!--Fingerprints-->
   7.201 +                <StackPanel Background="White"
   7.202 +                    Visibility="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToVisibility}, ConverterParameter=Fingerprint}">
   7.203 +                    <TextBlock Text="{Binding Path=UIDPartner}"
   7.204 +                       Margin="10,10,10,2" />
   7.205 +                    <TextBlock Text="{Binding Path=FingerprintPartner}"
   7.206 +                       Margin="10,2,10,22" />
   7.207 +                    <TextBlock Text="{Binding Path=UIDMyself}"
   7.208 +                       Margin="10,10,10,2" />
   7.209 +                    <TextBlock Text="{Binding Path=FingerprintMyself}"
   7.210 +                       Margin="10,2,10,10" />
   7.211 +                </StackPanel>
   7.212 +
   7.213 +                <!-- Buttons -->
   7.214 +                <StackPanel Orientation="Horizontal"
   7.215 +                        HorizontalAlignment="Right"
   7.216 +                        Margin="0,5,0,0"
   7.217 +                        Visibility="{Binding DialogType, Converter={StaticResource IsNotWizardModeToVisibility}}">
   7.218 +                    <Button Style="{StaticResource StyleButtonConfirm}"
   7.219 +                        HorizontalAlignment="Center"
   7.220 +                        Margin="0,5,5,5"
   7.221 +                        Content="{Binding Path=ButtonConfirmText, FallbackValue=Confirm}"
   7.222 +                        Command="{Binding ButtonConfirmOnClick}"
   7.223 +                        IsDefault="True"/>
   7.224 +                    <Button Style="{StaticResource StyleButtonWrong}"
   7.225 +                        HorizontalAlignment="Center"
   7.226 +                        Margin="5,5,0,5"
   7.227 +                        Content="{Binding Path=ButtonWrongText, FallbackValue=Wrong}"
   7.228 +                        Command="{Binding ButtonWrongOnClick}"/>
   7.229 +                </StackPanel>
   7.230              </StackPanel>
   7.231  
   7.232 -            <!--Fingerprints-->
   7.233 -            <StackPanel Background="White"
   7.234 -                    Visibility="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToVisibility}, ConverterParameter=Fingerprint}">
   7.235 -                <TextBlock Text="{Binding Path=UIDPartner}"
   7.236 -                       Margin="10,10,10,2" />
   7.237 -                <TextBlock Text="{Binding Path=FingerprintPartner}"
   7.238 -                       Margin="10,2,10,22" />
   7.239 -                <TextBlock Text="{Binding Path=UIDMyself}"
   7.240 -                       Margin="10,10,10,2" />
   7.241 -                <TextBlock Text="{Binding Path=FingerprintMyself}"
   7.242 -                       Margin="10,2,10,10" />
   7.243 -            </StackPanel>
   7.244 -
   7.245 -            <!-- Buttons -->
   7.246 -            <StackPanel Grid.Row="5"
   7.247 -                    Orientation="Horizontal"
   7.248 -                    HorizontalAlignment="Right"
   7.249 -                    Margin="0,5,0,0"
   7.250 -                    Visibility="{Binding DialogType, Converter={StaticResource IsNotWizardModeToVisibility}}">
   7.251 +            <!--Reset section-->
   7.252 +            <StackPanel Orientation="Horizontal"
   7.253 +                        HorizontalAlignment="Right"
   7.254 +                        Margin="0,5,0,0">
   7.255 +                <TextBlock Text="{x:Static p:Resources.Options_Reset}" 
   7.256 +                           Margin="5"/>
   7.257                  <Button Style="{StaticResource StyleButtonWrong}"
   7.258 -                    HorizontalAlignment="Center"
   7.259 -                    Margin="0,5,5,5"
   7.260 -                    Content="{Binding Path=ButtonWrongText, FallbackValue=Wrong}"
   7.261 -                    Command="{Binding ButtonWrongOnClick}"/>
   7.262 -                <Button Style="{StaticResource StyleButtonConfirm}"
   7.263 -                    HorizontalAlignment="Center"
   7.264 -                    Margin="5,5,0,5"
   7.265 -                    Content="{Binding Path=ButtonConfirmText, FallbackValue=Confirm}"
   7.266 -                    Command="{Binding ButtonConfirmOnClick}"
   7.267 -                    IsDefault="True"/>
   7.268 +                        HorizontalAlignment="Center"
   7.269 +                        Margin="5,5,0,5"
   7.270 +                        Content="{x:Static p:Resources.Options_Reset}"
   7.271 +                        Command="{Binding ButtonResetOnClick}"/>
   7.272              </StackPanel>
   7.273  
   7.274          </StackPanel>
   7.275 +
   7.276 +        <!--Separator between items-->
   7.277 +        <Separator Margin="5,5,5,0"
   7.278 +                   Background="LightGray"
   7.279 +                   Visibility="{Binding IsSeparatorVisible, Converter={StaticResource BoolToVisibility}}" />
   7.280 +
   7.281      </StackPanel>
   7.282  
   7.283  </UserControl>
     8.1 --- a/UI/Views/HandshakeView.xaml.cs	Wed Oct 02 14:35:44 2019 +0200
     8.2 +++ b/UI/Views/HandshakeView.xaml.cs	Wed Oct 02 19:29:07 2019 +0200
     8.3 @@ -51,6 +51,14 @@
     8.4              }
     8.5          }
     8.6  
     8.7 -        #endregion        
     8.8 +        #endregion
     8.9 +
    8.10 +        private void HandshakeItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    8.11 +        {
    8.12 +            if (this.DataContext is HandshakeViewModel handshakeViewModel)
    8.13 +            {
    8.14 +                (handshakeViewModel.Parent as HandshakeDialogViewModel)?.ChangeSelection(handshakeViewModel);
    8.15 +            }
    8.16 +        }
    8.17      }
    8.18  }