OUT-590: Further implementation of the sync wizard refactor_dialogs
authorThomas
Thu, 22 Aug 2019 10:08:25 +0200
branchrefactor_dialogs
changeset 271189ea77c3b521
parent 2710 c88cebe389d7
child 2712 74ada4e88d29
OUT-590: Further implementation of the sync wizard
UI/ViewModels/DialogWindowViewModel.cs
UI/ViewModels/HandshakeViewModel.cs
UI/ViewModels/SyncWizardViewModel.cs
UI/ViewModels/WizardGenericPageViewModel.cs
UI/ViewModels/WizardHandshakePageViewModel.cs
UI/ViewModels/WizardPageViewModelBase.cs
UI/ViewModels/WizardViewModelBase.cs
UI/Views/DialogWindow.xaml
UI/Views/DialogWindow.xaml.cs
UI/Views/HandshakeDialog.xaml
UI/Views/HandshakeDialog.xaml.cs
UI/Views/HandshakeView.xaml
UI/Views/HandshakeView.xaml.cs
UI/Views/WizardGenericPageView.xaml
UI/Views/WizardGenericPageView.xaml.cs
UI/Views/WizardPageView.xaml
UI/Views/WizardView.xaml
UI/Views/WizardView.xaml.cs
Wrappers/WatchedWindow.cs
pEpForOutlook.csproj
     1.1 --- a/UI/ViewModels/DialogWindowViewModel.cs	Thu Aug 22 09:41:47 2019 +0200
     1.2 +++ b/UI/ViewModels/DialogWindowViewModel.cs	Thu Aug 22 10:08:25 2019 +0200
     1.3 @@ -1,28 +1,14 @@
     1.4  using pEp.UI.Models;
     1.5 -using pEp.UI.Views;
     1.6 -using System.Windows;
     1.7 -using System.Windows.Controls;
     1.8 +using System;
     1.9  
    1.10  namespace pEp.UI.ViewModels
    1.11  {
    1.12      internal class DialogWindowViewModel : ViewModelBase
    1.13      {
    1.14 -        private RelayCommand<Interfaces.ICloseable>     _CloseWindowCommand = null;
    1.15 -        private ViewModelBase                           _Content = null;
    1.16 -        private string                                  _WindowTitle = null;
    1.17 +        private             ViewModelBase                   _Content            = null;
    1.18 +        private             string                          _WindowTitle        = null;
    1.19  
    1.20 -        public RelayCommand<Interfaces.ICloseable> CloseWindowCommand
    1.21 -        {
    1.22 -            get
    1.23 -            {
    1.24 -                if (this._CloseWindowCommand == null)
    1.25 -                {
    1.26 -                    this._CloseWindowCommand = new RelayCommand<Interfaces.ICloseable>(this.CloseWindow);
    1.27 -                }
    1.28 -
    1.29 -                return this._CloseWindowCommand;
    1.30 -            }
    1.31 -        }
    1.32 +        public Action CloseWindowAction { get; protected set; } = null;
    1.33  
    1.34          public ViewModelBase Content
    1.35          {
    1.36 @@ -34,6 +20,14 @@
    1.37              }
    1.38          }
    1.39  
    1.40 +        /// <summary>
    1.41 +        /// Gets or sets the dialog result.
    1.42 +        /// Note: Needed to be able to return null as DialogResult.
    1.43 +        /// </summary>
    1.44 +        public bool? DialogResult { get; protected set; } = null;
    1.45 +
    1.46 +        public Handshake Handshake { get; protected set; } = null;
    1.47 +
    1.48          public string WindowTitle
    1.49          {
    1.50              get => this._WindowTitle;
    1.51 @@ -44,28 +38,10 @@
    1.52              }
    1.53          }
    1.54  
    1.55 -        public DialogWindowViewModel(Dialog.Type type, Handshake handshake, Window window)
    1.56 +        public DialogWindowViewModel(Handshake handshake, Action closeWindow)
    1.57          {
    1.58 -            switch (type)
    1.59 -            {
    1.60 -                case Dialog.Type.Handshake:
    1.61 -                    break;
    1.62 -                case Dialog.Type.KeySync:
    1.63 -                    this.WindowTitle = Properties.Resources.Handshake_SyncFormText;
    1.64 -                    this.Content = new SyncWizardViewModel(handshake, window);
    1.65 -                    break;
    1.66 -                case Dialog.Type.KeyImportPEP:
    1.67 -                    break;
    1.68 -                case Dialog.Type.KeyImportPGP:
    1.69 -                    break;
    1.70 -                default:
    1.71 -                    break;
    1.72 -            }
    1.73 -        }
    1.74 -
    1.75 -        private void CloseWindow(Interfaces.ICloseable window)
    1.76 -        {
    1.77 -            window?.Close();
    1.78 +            this.Handshake = handshake;
    1.79 +            this.CloseWindowAction = closeWindow;
    1.80          }
    1.81      }
    1.82  }
     2.1 --- a/UI/ViewModels/HandshakeViewModel.cs	Thu Aug 22 09:41:47 2019 +0200
     2.2 +++ b/UI/ViewModels/HandshakeViewModel.cs	Thu Aug 22 10:08:25 2019 +0200
     2.3 @@ -4,16 +4,13 @@
     2.4  using System.Collections.Generic;
     2.5  using System.Collections.ObjectModel;
     2.6  using System.Globalization;
     2.7 -using System.Windows;
     2.8  using System.Windows.Media;
     2.9  using System.Windows.Media.Imaging;
    2.10  
    2.11  namespace pEp.UI.ViewModels
    2.12  {
    2.13 -    class HandshakeViewModel : ViewModelBase
    2.14 +    class HandshakeViewModel : DialogWindowViewModel
    2.15      {
    2.16 -        private readonly Handshake handshake = null;
    2.17 -
    2.18          public enum Tabs
    2.19          {
    2.20              Trustwords,
    2.21 @@ -25,8 +22,8 @@
    2.22          private Tabs                                _ActiveTab                  = Tabs.Trustwords;
    2.23          private bool                                _AreTabControlsVisible      = false;
    2.24          private bool                                _AreTrustwordsExpanded      = false;
    2.25 -        private RelayCommand<Window>                _ButtonConfirmOnClick       = null;
    2.26 -        private RelayCommand<Window>                _ButtonWrongOnClick         = null;
    2.27 +        private RelayCommand                        _ButtonConfirmOnClick       = null;
    2.28 +        private RelayCommand                        _ButtonWrongOnClick         = null;
    2.29          private string                              _ButtonConfirmText          = null;
    2.30          private string                              _ButtonWrongText            = null;
    2.31          private string                              _ExpanderToolTip            = null;
    2.32 @@ -86,12 +83,6 @@
    2.33          }
    2.34  
    2.35          /// <summary>
    2.36 -        /// Gets or sets the dialog result.
    2.37 -        /// Note: Needed to be able to return null as DialogResult.
    2.38 -        /// </summary>
    2.39 -        public bool? DialogResult { get; private set; } = null;
    2.40 -
    2.41 -        /// <summary>
    2.42          /// Gets or sets the text to display on the Confirm button.
    2.43          /// </summary>
    2.44          public string ButtonConfirmText
    2.45 @@ -200,7 +191,7 @@
    2.46          /// </summary>
    2.47          public Handshake.HandshakeMode Mode
    2.48          {
    2.49 -            get => this.handshake.Mode;
    2.50 +            get => this.Handshake.Mode;
    2.51          }
    2.52  
    2.53          /// <summary>
    2.54 @@ -310,9 +301,11 @@
    2.55          /// Primary constructor.
    2.56          /// </summary>
    2.57          /// <param name="handshake">The handshake object for this dialog.</param>
    2.58 -        public HandshakeViewModel(Handshake handshake)
    2.59 +        public HandshakeViewModel(Handshake handshake, Action closeWindow) : base(handshake, closeWindow)
    2.60          {
    2.61 -            this.handshake = handshake;
    2.62 +            this.Content = this;
    2.63 +            this.Handshake = handshake;
    2.64 +            this.CloseWindowAction = closeWindow;
    2.65  
    2.66              // Update myself and partner identities
    2.67              try
    2.68 @@ -418,7 +411,7 @@
    2.69          /// <summary>
    2.70          /// Command to execute when the Confirm button is clicked.
    2.71          /// </summary>
    2.72 -        public RelayCommand<Window> ButtonConfirmOnClick
    2.73 +        public RelayCommand ButtonConfirmOnClick
    2.74          {
    2.75              get
    2.76              {
    2.77 @@ -430,19 +423,19 @@
    2.78                          case Handshake.HandshakeMode.SyncTypeB:
    2.79                          case Handshake.HandshakeMode.SyncTypeC:
    2.80                              {
    2.81 -                                this._ButtonConfirmOnClick = new RelayCommand<Window>(this.ConfirmSyncHandshakeAndCloseDialog);
    2.82 +                                this._ButtonConfirmOnClick = new RelayCommand(p => this.ConfirmSyncHandshakeAndCloseDialog());
    2.83                              }
    2.84                              break;
    2.85                          case Handshake.HandshakeMode.ForceProtectionSendKey:
    2.86                          case Handshake.HandshakeMode.ForceProtectionImportKey:
    2.87                              {
    2.88 -                                this._ButtonConfirmOnClick = new RelayCommand<Window>(this.TrustKeyAndCloseDialog);
    2.89 +                                this._ButtonConfirmOnClick = new RelayCommand(p => this.TrustKeyAndCloseDialog());
    2.90                              }
    2.91                              break;
    2.92                          case Handshake.HandshakeMode.Standard:
    2.93                          default:
    2.94                              {
    2.95 -                                this._ButtonConfirmOnClick = new RelayCommand<Window>(this.TrustKeyAndCloseDialog);
    2.96 +                                this._ButtonConfirmOnClick = new RelayCommand(p => this.TrustKeyAndCloseDialog());
    2.97                              }
    2.98                              break;
    2.99                      }
   2.100 @@ -455,7 +448,7 @@
   2.101          /// <summary>
   2.102          /// Command to execute when the Wrong button is clicked.
   2.103          /// </summary>
   2.104 -        public RelayCommand<Window> ButtonWrongOnClick
   2.105 +        public RelayCommand ButtonWrongOnClick
   2.106          {
   2.107              get
   2.108              {
   2.109 @@ -467,19 +460,19 @@
   2.110                          case Handshake.HandshakeMode.SyncTypeB:
   2.111                          case Handshake.HandshakeMode.SyncTypeC:
   2.112                              {
   2.113 -                                this._ButtonWrongOnClick = new RelayCommand<Window>(this.DenySyncHandshakeAndCloseDialog);
   2.114 +                                this._ButtonWrongOnClick = new RelayCommand(p => this.DenySyncHandshakeAndCloseDialog());
   2.115                              }
   2.116                              break;
   2.117                          case Handshake.HandshakeMode.ForceProtectionSendKey:
   2.118                          case Handshake.HandshakeMode.ForceProtectionImportKey:
   2.119                              {
   2.120 -                                this._ButtonWrongOnClick = new RelayCommand<Window>(this.MistrustKeyAndCloseDialog);
   2.121 +                                this._ButtonWrongOnClick = new RelayCommand(p => this.MistrustKeyAndCloseDialog());
   2.122                              }
   2.123                              break;
   2.124                          case Handshake.HandshakeMode.Standard:
   2.125                          default:
   2.126                              {
   2.127 -                                this._ButtonWrongOnClick = new RelayCommand<Window>(this.MistrustKeyAndCloseDialog);
   2.128 +                                this._ButtonWrongOnClick = new RelayCommand(p => this.MistrustKeyAndCloseDialog());
   2.129                              }
   2.130                              break;
   2.131                      }
   2.132 @@ -496,28 +489,25 @@
   2.133          /// <summary>
   2.134          /// Confirms the sync handshake and closes the dialog.
   2.135          /// </summary>
   2.136 -        /// <param name="window">The window to close.</param>
   2.137 -        private void ConfirmSyncHandshakeAndCloseDialog(Window window)
   2.138 +        private void ConfirmSyncHandshakeAndCloseDialog()
   2.139          {
   2.140              this.DialogResult = true;
   2.141 -            window?.Close();
   2.142 +            this.CloseWindowAction?.Invoke();
   2.143          }
   2.144  
   2.145          /// <summary>
   2.146          /// Denies the sync handshake and closes the dialog.
   2.147          /// </summary>
   2.148 -        /// <param name="window">The window to close.</param>
   2.149 -        private void DenySyncHandshakeAndCloseDialog(Window window)
   2.150 +        private void DenySyncHandshakeAndCloseDialog()
   2.151          {
   2.152              this.DialogResult = false;
   2.153 -            window?.Close();
   2.154 +            this.CloseWindowAction?.Invoke();
   2.155          }
   2.156  
   2.157          /// <summary>
   2.158          /// Mistrusts the partner's identity key and closes the dialog.
   2.159          /// </summary>
   2.160 -        /// <param name="window">The window to close.</param>
   2.161 -        private void MistrustKeyAndCloseDialog(Window window)
   2.162 +        private void MistrustKeyAndCloseDialog()
   2.163          {
   2.164              if (string.IsNullOrEmpty(this.Partner?.Fingerprint) == false)
   2.165              {
   2.166 @@ -538,14 +528,13 @@
   2.167              }
   2.168  
   2.169              this.DialogResult = false;
   2.170 -            window?.Close();
   2.171 +            this.CloseWindowAction?.Invoke();
   2.172          }
   2.173  
   2.174          /// <summary>
   2.175          /// Trusts the partner's identity key and closes the dialog.
   2.176          /// </summary>
   2.177 -        /// <param name="window">The window to close.</param>
   2.178 -        private void TrustKeyAndCloseDialog(Window window)
   2.179 +        private void TrustKeyAndCloseDialog()
   2.180          {
   2.181              if (string.IsNullOrEmpty(this.Partner?.Fingerprint) == false)
   2.182              {
   2.183 @@ -566,7 +555,7 @@
   2.184              }
   2.185  
   2.186              this.DialogResult = true;
   2.187 -            window?.Close();
   2.188 +            this.CloseWindowAction?.Invoke();
   2.189          }
   2.190  
   2.191          /// <summary>
     3.1 --- a/UI/ViewModels/SyncWizardViewModel.cs	Thu Aug 22 09:41:47 2019 +0200
     3.2 +++ b/UI/ViewModels/SyncWizardViewModel.cs	Thu Aug 22 10:08:25 2019 +0200
     3.3 @@ -1,48 +1,55 @@
     3.4  using pEp.UI.Models;
     3.5 +using System;
     3.6  using System.Collections.Generic;
     3.7  using System.Collections.ObjectModel;
     3.8 -using System.Windows;
     3.9 +using System.Windows.Media.Imaging;
    3.10  
    3.11  namespace pEp.UI.ViewModels
    3.12  {
    3.13      internal class SyncWizardViewModel : WizardViewModelBase
    3.14      {
    3.15 -        public SyncWizardViewModel(Handshake handshake, Window window) : base(handshake, window)
    3.16 +        public SyncWizardViewModel(Handshake handshake, Action closeWindow) : base(handshake, closeWindow)
    3.17          {
    3.18 -
    3.19 +            this.Handshake = handshake;
    3.20 +            this.CloseWindowAction = closeWindow;
    3.21          }
    3.22  
    3.23          public override void CreatePages()
    3.24          {
    3.25              // Create Sync Wizard Pages
    3.26 -            this._Pages = new ReadOnlyCollection<WizardPageViewModelBase>(new List<WizardPageViewModelBase>
    3.27 +            this._Pages = new ReadOnlyCollection<ViewModelBase>(new List<ViewModelBase>
    3.28              {
    3.29                  // Welcome page
    3.30                  new WizardGenericPageViewModel
    3.31                  {
    3.32 -                    ExplanationText = "Welcome"
    3.33 +                    ExplanationText = "Welcome",
    3.34 +                    Image = new BitmapImage(new Uri("pack://application:,,,/pEp;component/Resources/ImageIconDeviceGroup.png", UriKind.RelativeOrAbsolute))
    3.35                  },
    3.36                  
    3.37                  // Step 1 
    3.38                  new WizardGenericPageViewModel
    3.39                  {
    3.40 -                    ExplanationText = "Step 1"
    3.41 +                    ExplanationText = "Step 1",
    3.42 +                    Image = new BitmapImage(new Uri("pack://application:,,,/pEp;component/Resources/ImageIconDeviceGroup.png", UriKind.RelativeOrAbsolute))
    3.43                  },
    3.44  
    3.45                  // Step 2 
    3.46                  new WizardGenericPageViewModel
    3.47                  {
    3.48 -                    ExplanationText = "Step 2"
    3.49 +                    ExplanationText = "Step 2",
    3.50 +                    Image = new BitmapImage(new Uri("pack://application:,,,/pEp;component/Resources/ImageIconDeviceGroup.png", UriKind.RelativeOrAbsolute))
    3.51                  },
    3.52  
    3.53                  // Step 3 
    3.54                  new WizardGenericPageViewModel
    3.55                  {
    3.56 -                    ExplanationText = "Step 3"
    3.57 +                    ExplanationText = "Step 3",
    3.58 +                    Image = new BitmapImage(new Uri("pack://application:,,,/pEp;component/Resources/ImageIconDeviceGroup.png", UriKind.RelativeOrAbsolute))
    3.59                  },
    3.60  
    3.61                  // Handshake
    3.62 -                new WizardHandshakePageViewModel()
    3.63 +                new WizardHandshakePageViewModel(this.Handshake, this.CloseWindowAction),
    3.64 +                new HandshakeViewModel(this.Handshake, this.CloseWindowAction)
    3.65  
    3.66              });
    3.67          }
     4.1 --- a/UI/ViewModels/WizardGenericPageViewModel.cs	Thu Aug 22 09:41:47 2019 +0200
     4.2 +++ b/UI/ViewModels/WizardGenericPageViewModel.cs	Thu Aug 22 10:08:25 2019 +0200
     4.3 @@ -1,14 +1,12 @@
     4.4 -using System;
     4.5 -using System.Collections.Generic;
     4.6 -using System.Linq;
     4.7 -using System.Text;
     4.8 -using System.Threading.Tasks;
     4.9 +using System.Windows.Media;
    4.10  
    4.11  namespace pEp.UI.ViewModels
    4.12  {
    4.13      public class WizardGenericPageViewModel : WizardPageViewModelBase
    4.14      {
    4.15 -        private string _ExplanationText;
    4.16 +        private string          _ExplanationText    = null;
    4.17 +        private ImageSource     _Image              = null;
    4.18 +
    4.19  
    4.20          public string ExplanationText
    4.21          {
    4.22 @@ -20,8 +18,19 @@
    4.23              }
    4.24          }
    4.25  
    4.26 +        public ImageSource Image
    4.27 +        {
    4.28 +            get => this._Image;
    4.29 +            set
    4.30 +            {
    4.31 +                this._Image = value;
    4.32 +                this.OnPropertyChanged();
    4.33 +            }
    4.34 +        }
    4.35 +
    4.36          public WizardGenericPageViewModel()
    4.37          {
    4.38 +            this.Content = this;
    4.39          }
    4.40      }
    4.41  }
     5.1 --- a/UI/ViewModels/WizardHandshakePageViewModel.cs	Thu Aug 22 09:41:47 2019 +0200
     5.2 +++ b/UI/ViewModels/WizardHandshakePageViewModel.cs	Thu Aug 22 10:08:25 2019 +0200
     5.3 @@ -1,4 +1,5 @@
     5.4 -using System;
     5.5 +using pEp.UI.Models;
     5.6 +using System;
     5.7  using System.Collections.Generic;
     5.8  using System.Linq;
     5.9  using System.Text;
    5.10 @@ -6,11 +7,18 @@
    5.11  
    5.12  namespace pEp.UI.ViewModels
    5.13  {
    5.14 -    public class WizardHandshakePageViewModel : WizardPageViewModelBase
    5.15 +    internal class WizardHandshakePageViewModel : WizardPageViewModelBase
    5.16      {
    5.17          public WizardHandshakePageViewModel()
    5.18          {
    5.19 +            this.IsButtonBackVisible = false;
    5.20              this.IsButtonCancelVisible = false;
    5.21 +            this.IsButtonNextVisible = false;
    5.22 +        }
    5.23 +
    5.24 +        public WizardHandshakePageViewModel(Handshake handshake, Action closeWindow) : this()
    5.25 +        {
    5.26 +            this.Content = new HandshakeViewModel(handshake, closeWindow);
    5.27          }
    5.28      }
    5.29  }
     6.1 --- a/UI/ViewModels/WizardPageViewModelBase.cs	Thu Aug 22 09:41:47 2019 +0200
     6.2 +++ b/UI/ViewModels/WizardPageViewModelBase.cs	Thu Aug 22 10:08:25 2019 +0200
     6.3 @@ -10,40 +10,17 @@
     6.4  {
     6.5      public abstract class WizardPageViewModelBase : ViewModelBase
     6.6      {
     6.7 -        private string      _ButtonAcceptHandshakeText          = Properties.Resources.Handshake_ConfirmTrustwords;
     6.8 -        private string      _ButtonDenyHandshakeText            = Properties.Resources.Handshake_WrongTrustwords;
     6.9 -        private bool        _IsButtonAcceptHandshakeVisible     = false;
    6.10 -        private bool        _IsButtonBackVisible                = true;
    6.11 -        private bool        _IsButtonCancelVisible              = true;
    6.12 -        private bool        _IsButtonDenyHandshakeVisible       = false;
    6.13 -        private bool        _IsButtonNextVisible                = true;
    6.14 +        private ViewModelBase   _Content                            = null;
    6.15 +        private bool            _IsButtonBackVisible                = true;
    6.16 +        private bool            _IsButtonCancelVisible              = true;
    6.17 +        private bool            _IsButtonNextVisible                = true;
    6.18  
    6.19 -        public string ButtonAcceptHandshakeText
    6.20 +        public ViewModelBase Content
    6.21          {
    6.22 -            get => this._ButtonAcceptHandshakeText;
    6.23 +            get => this._Content;
    6.24              set
    6.25              {
    6.26 -                this._ButtonAcceptHandshakeText = value;
    6.27 -                this.OnPropertyChanged();
    6.28 -            }
    6.29 -        }
    6.30 -
    6.31 -        public string ButtonDenyHandshakeText
    6.32 -        {
    6.33 -            get => this._ButtonDenyHandshakeText;
    6.34 -            set
    6.35 -            {
    6.36 -                this._ButtonDenyHandshakeText = value;
    6.37 -                this.OnPropertyChanged();
    6.38 -            }
    6.39 -        }
    6.40 -
    6.41 -        public bool IsButtonAcceptHandshakeVisible
    6.42 -        {
    6.43 -            get => this._IsButtonAcceptHandshakeVisible;
    6.44 -            set
    6.45 -            {
    6.46 -                this._IsButtonAcceptHandshakeVisible = value;
    6.47 +                this._Content = value;
    6.48                  this.OnPropertyChanged();
    6.49              }
    6.50          }
    6.51 @@ -68,16 +45,6 @@
    6.52              }
    6.53          }
    6.54  
    6.55 -        public bool IsButtonDenyHandshakeVisible
    6.56 -        {
    6.57 -            get => this._IsButtonDenyHandshakeVisible;
    6.58 -            set
    6.59 -            {
    6.60 -                this._IsButtonDenyHandshakeVisible = value;
    6.61 -                this.OnPropertyChanged();
    6.62 -            }
    6.63 -        }
    6.64 -
    6.65          public bool IsButtonNextVisible
    6.66          {
    6.67              get => this._IsButtonNextVisible;
    6.68 @@ -88,7 +55,6 @@
    6.69              }
    6.70          }
    6.71  
    6.72 -
    6.73          public WizardPageViewModelBase()
    6.74          {
    6.75  
     7.1 --- a/UI/ViewModels/WizardViewModelBase.cs	Thu Aug 22 09:41:47 2019 +0200
     7.2 +++ b/UI/ViewModels/WizardViewModelBase.cs	Thu Aug 22 10:08:25 2019 +0200
     7.3 @@ -1,22 +1,20 @@
     7.4  using pEp.UI.Models;
     7.5 -using pEp.UI.Views;
     7.6  using pEpCOMServerAdapterLib;
     7.7  using System;
     7.8  using System.Collections.ObjectModel;
     7.9 -using System.Windows;
    7.10  
    7.11  namespace pEp.UI.ViewModels
    7.12  {
    7.13 -    internal abstract class WizardViewModelBase : ViewModelBase
    7.14 +    internal abstract class WizardViewModelBase : DialogWindowViewModel
    7.15      {
    7.16          #region Fields
    7.17  
    7.18          protected           RelayCommand                                    _AcceptHandshakeCommand;
    7.19 -        private             WizardPageViewModelBase                         _CurrentPage;
    7.20 +        private             ViewModelBase                                   _CurrentPage;
    7.21          protected           RelayCommand                                    _DenyHandshakeCommand;
    7.22          protected           RelayCommand                                    _MoveBackCommand;
    7.23          protected           RelayCommand                                    _MoveNextCommand;
    7.24 -        protected           ReadOnlyCollection<WizardPageViewModelBase>     _Pages;
    7.25 +        protected           ReadOnlyCollection<ViewModelBase>               _Pages;
    7.26          protected           string                                          _WindowTitle;
    7.27  
    7.28          #endregion
    7.29 @@ -46,7 +44,7 @@
    7.30              get => (this.CurrentPage != null);
    7.31          }
    7.32  
    7.33 -        public WizardPageViewModelBase CurrentPage
    7.34 +        public ViewModelBase CurrentPage
    7.35          {
    7.36              get => this._CurrentPage;
    7.37              set
    7.38 @@ -78,8 +76,6 @@
    7.39              }
    7.40          }
    7.41  
    7.42 -        public Handshake Handshake { get; }
    7.43 -
    7.44          private bool IsLastPage
    7.45          {
    7.46              get => (this.CurrentPageIndex >= (this.Pages.Count - 1));
    7.47 @@ -112,7 +108,7 @@
    7.48              }
    7.49          }
    7.50  
    7.51 -        public ReadOnlyCollection<WizardPageViewModelBase> Pages
    7.52 +        public ReadOnlyCollection<ViewModelBase> Pages
    7.53          {
    7.54              get
    7.55              {
    7.56 @@ -125,26 +121,12 @@
    7.57              }
    7.58          }
    7.59  
    7.60 -        public Window ParentWindow { get; private set; }
    7.61 -
    7.62 -        public string WindowTitle
    7.63 -        {
    7.64 -            get => this._WindowTitle;
    7.65 -            set
    7.66 -            {
    7.67 -                this._WindowTitle = value;
    7.68 -                this.OnPropertyChanged();
    7.69 -            }
    7.70 -        }
    7.71 -
    7.72          #endregion
    7.73  
    7.74          #region Constructors
    7.75  
    7.76 -        public WizardViewModelBase(Handshake handshake, Window parentWindow)
    7.77 +        public WizardViewModelBase(Handshake handshake, Action closeWindow) : base(handshake, closeWindow)
    7.78          {
    7.79 -            this.Handshake = handshake;
    7.80 -            this.ParentWindow = parentWindow;
    7.81              this.CreatePages();
    7.82              this.CurrentPage = this.Pages[0];
    7.83          }
    7.84 @@ -169,11 +151,6 @@
    7.85              this.MoveToNextPage();
    7.86          }
    7.87  
    7.88 -        public void CloseWizard()
    7.89 -        {
    7.90 -            this.ParentWindow.Close();
    7.91 -        }
    7.92 -
    7.93          public abstract void CreatePages();
    7.94  
    7.95          private void DenyHandshakeAndMoveToNextPage()
    7.96 @@ -201,7 +178,7 @@
    7.97          {
    7.98              if (this.IsLastPage)
    7.99              {
   7.100 -                this.CloseWizard();
   7.101 +                this.CloseWindowAction?.Invoke();
   7.102              }
   7.103              else
   7.104              {
     8.1 --- a/UI/Views/DialogWindow.xaml	Thu Aug 22 09:41:47 2019 +0200
     8.2 +++ b/UI/Views/DialogWindow.xaml	Thu Aug 22 10:08:25 2019 +0200
     8.3 @@ -23,6 +23,9 @@
     8.4          <DataTemplate DataType="{x:Type vm:SyncWizardViewModel}">
     8.5              <v:WizardView />
     8.6          </DataTemplate>
     8.7 +        <DataTemplate DataType="{x:Type vm:HandshakeViewModel}">
     8.8 +            <v:HandshakeView />
     8.9 +        </DataTemplate>
    8.10      </Window.Resources>
    8.11  
    8.12      <ContentControl x:Name="DialogWindowContent"                    
     9.1 --- a/UI/Views/DialogWindow.xaml.cs	Thu Aug 22 09:41:47 2019 +0200
     9.2 +++ b/UI/Views/DialogWindow.xaml.cs	Thu Aug 22 10:08:25 2019 +0200
     9.3 @@ -1,5 +1,6 @@
     9.4  using pEp.UI.Models;
     9.5  using pEp.UI.ViewModels;
     9.6 +using System;
     9.7  using System.ComponentModel;
     9.8  using System.Windows;
     9.9  
    9.10 @@ -8,16 +9,40 @@
    9.11      /// <summary>
    9.12      /// Interaction logic for DialogWindow.xaml
    9.13      /// </summary>
    9.14 -    internal partial class DialogWindow : Window, Interfaces.ICloseable
    9.15 +    internal partial class DialogWindow : Window
    9.16      {
    9.17 +        private bool isShownDialog = false;
    9.18 +
    9.19 +        /// <summary>
    9.20 +        /// Primary constructor.
    9.21 +        /// </summary>
    9.22          public DialogWindow()
    9.23          {
    9.24              InitializeComponent();
    9.25          }
    9.26  
    9.27 +        /// <summary>
    9.28 +        /// Constructor to build a dialog with a handshake.
    9.29 +        /// </summary>
    9.30 +        /// <param name="type">The type of the dialog.</param>
    9.31 +        /// <param name="handshake">The handshake to perform.</param>
    9.32          public DialogWindow(Dialog.Type type, Handshake handshake) : this()
    9.33          {
    9.34 -            this.DataContext = new DialogWindowViewModel(type, handshake, this);
    9.35 +            // Assign the necessary ViewModel according to the dialog type.
    9.36 +            switch (type)
    9.37 +            {
    9.38 +                case Dialog.Type.Handshake:
    9.39 +                    this.DataContext = new HandshakeViewModel(handshake, this.Close);
    9.40 +                    break;
    9.41 +                case Dialog.Type.KeySync:
    9.42 +                    this.Content = new SyncWizardViewModel(handshake, this.Close);
    9.43 +                    break;
    9.44 +                case Dialog.Type.KeyImportPEP:
    9.45 +                case Dialog.Type.KeyImportPGP:
    9.46 +                case Dialog.Type.ForceProtection:
    9.47 +                default:
    9.48 +                    throw new NotImplementedException();
    9.49 +            }
    9.50          }
    9.51  
    9.52          /// <summary>
    9.53 @@ -25,11 +50,25 @@
    9.54          /// </summary>
    9.55          private void DialogWindow_Closing(object sender, CancelEventArgs e)
    9.56          {
    9.57 -            //if (this.isShownDialog &&
    9.58 -            //    (this.DataContext is HandshakeViewModel handshakeViewModel))
    9.59 -            //{
    9.60 -            //    this.DialogResult = handshakeViewModel.DialogResult;
    9.61 -            //}
    9.62 +            if (this.isShownDialog &&
    9.63 +                (this.DataContext is DialogWindowViewModel viewModel))
    9.64 +            {
    9.65 +                this.DialogResult = viewModel.DialogResult;
    9.66 +            }
    9.67          }
    9.68 +
    9.69 +        #region Methods
    9.70 +
    9.71 +        /// <summary>
    9.72 +        /// Overloads the ShowDialog method and sets a flag to signal that this dialog is modal.
    9.73 +        /// </summary>
    9.74 +        /// <returns>The DialogResult of the base's ShowDialog method.</returns>
    9.75 +        public new bool? ShowDialog()
    9.76 +        {
    9.77 +            this.isShownDialog = true;
    9.78 +            return base.ShowDialog();
    9.79 +        }
    9.80 +
    9.81 +        #endregion
    9.82      }
    9.83  }
    10.1 --- a/UI/Views/HandshakeDialog.xaml	Thu Aug 22 09:41:47 2019 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,254 +0,0 @@
    10.4 -<Window x:Class="pEp.UI.Views.HandshakeDialog"
    10.5 -        x:Name="WindowHandshakeDialog"
    10.6 -        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    10.7 -        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    10.8 -        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    10.9 -        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
   10.10 -        xmlns:p="clr-namespace:pEp.Properties"
   10.11 -        xmlns:local="clr-namespace:pEp.UI"
   10.12 -        x:ClassModifier="internal"
   10.13 -        mc:Ignorable="d"
   10.14 -        MinHeight="5"
   10.15 -        Height="Auto"
   10.16 -        Width="Auto"
   10.17 -        ResizeMode="NoResize"
   10.18 -        SizeToContent="WidthAndHeight"
   10.19 -        Topmost="True"
   10.20 -        Background="{x:Static SystemColors.MenuBarBrush}"
   10.21 -        Icon="pack://application:,,,/pEp;component/Resources/ImageLogoIcon.png"
   10.22 -        WindowStartupLocation="CenterScreen"
   10.23 -        Closing="HandshakeDialog_Closing">
   10.24 -    <Window.Resources>
   10.25 -        <ResourceDictionary>
   10.26 -            <!-- Converters -->
   10.27 -            <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
   10.28 -            <local:ValueConverterGroup x:Key="IsSyncModeToVisibility">
   10.29 -                <local:IsSyncModeToBoolConverter />
   10.30 -                <BooleanToVisibilityConverter />
   10.31 -            </local:ValueConverterGroup>
   10.32 -            <local:IsEnabledToColorConverter x:Key="IsEnabledToColor" />
   10.33 -            <local:IsActiveTabToBoolConverter x:Key="IsActiveTabToBool" />
   10.34 -            <local:ValueConverterGroup x:Key="IsActiveTabToVisibility">
   10.35 -                <local:IsActiveTabToBoolConverter />
   10.36 -                <BooleanToVisibilityConverter />
   10.37 -            </local:ValueConverterGroup>
   10.38 -            <local:ValueConverterGroup x:Key="IsActiveTabToBackground">
   10.39 -                <local:IsActiveTabToBoolConverter />
   10.40 -                <local:BooleanToBackgroundConverter />
   10.41 -            </local:ValueConverterGroup>
   10.42 -            <local:InvertBoolConverter x:Key="InvertBool" />
   10.43 -            <local:MultiBooleanToVisibilityConverter x:Key="MultiBooleanToVisibility" />
   10.44 -            <local:ValueConverterGroup x:Key="InvertBoolToVisibility">
   10.45 -                <local:InvertBoolConverter />
   10.46 -                <BooleanToVisibilityConverter />
   10.47 -            </local:ValueConverterGroup>
   10.48 -            <local:ValueConverterGroup x:Key="IsStandardModeToVisibility">
   10.49 -                <local:IsStandardModeToBoolConverter />
   10.50 -                <BooleanToVisibilityConverter />
   10.51 -            </local:ValueConverterGroup>
   10.52 -            <local:ValueConverterGroup x:Key="IsNotStandardModeToVisibility">
   10.53 -                <local:IsStandardModeToBoolConverter />
   10.54 -                <local:InvertBoolConverter />
   10.55 -                <BooleanToVisibilityConverter />
   10.56 -            </local:ValueConverterGroup>
   10.57 -            <local:ValueConverterGroup x:Key="IsStringEmptyToVisibility">
   10.58 -                <local:IsStringEmptyConverter />
   10.59 -                <local:InvertBoolConverter />
   10.60 -                <BooleanToVisibilityConverter />
   10.61 -            </local:ValueConverterGroup>
   10.62 -            <local:ValueConverterGroup x:Key="IsNotSyncModeToVisibility">
   10.63 -                <local:IsSyncModeToBoolConverter />
   10.64 -                <local:InvertBoolConverter />
   10.65 -                <BooleanToVisibilityConverter />
   10.66 -            </local:ValueConverterGroup>
   10.67 -
   10.68 -            <!-- Dictionary -->
   10.69 -            <ResourceDictionary.MergedDictionaries>
   10.70 -                <ResourceDictionary Source="pack://application:,,,/pEp;component/Resources/Dictionary.xaml" />
   10.71 -            </ResourceDictionary.MergedDictionaries>
   10.72 -        </ResourceDictionary>
   10.73 -    </Window.Resources>
   10.74 -
   10.75 -    <!--The window content-->
   10.76 -    <StackPanel Margin="10"
   10.77 -                Width="470">
   10.78 -
   10.79 -        <!--Information section-->
   10.80 -        <TextBlock Text="{Binding Path=ExplanationText, Mode=OneWay}"
   10.81 -                   TextWrapping="Wrap"
   10.82 -                   Margin="5,5,5,15" />
   10.83 -
   10.84 -        <!--Sync identities-->
   10.85 -        <ComboBox ItemsSource="{Binding SyncIdentities}"
   10.86 -                  Text="{x:Static p:Resources.Handshake_SelectSyncIdentities}"
   10.87 -                  IsEditable="True"
   10.88 -                  IsReadOnly="True"
   10.89 -                  Focusable="False"
   10.90 -                  Visibility="{Binding Mode, Converter={StaticResource IsSyncModeToVisibility}}">
   10.91 -            <ComboBox.ItemTemplate>
   10.92 -                <DataTemplate>
   10.93 -                    <StackPanel Orientation="Horizontal">
   10.94 -                        <CheckBox Width="20"                                                                     
   10.95 -                                  IsThreeState="false"
   10.96 -                                  IsChecked="{Binding Synchronize, Mode=TwoWay}"/>
   10.97 -                        <TextBlock Text="{Binding DisplayName, Mode=OneWay}"/>
   10.98 -                    </StackPanel>
   10.99 -                </DataTemplate>
  10.100 -            </ComboBox.ItemTemplate>
  10.101 -        </ComboBox>
  10.102 -
  10.103 -        <!-- The User name and icon -->
  10.104 -        <StackPanel Orientation="Horizontal"
  10.105 -                    Margin="10,20">
  10.106 -
  10.107 -            <!--The identity rating-->
  10.108 -            <Image Height="15"
  10.109 -                   Stretch="Uniform"
  10.110 -                   VerticalAlignment="Stretch"
  10.111 -                   HorizontalAlignment="Center"
  10.112 -                   Margin="0,0,5,0"
  10.113 -                   Source="{Binding Path=PEPColorIcon, Mode=OneWay}" />
  10.114 -
  10.115 -
  10.116 -            <!--The identity name-->
  10.117 -            <TextBlock HorizontalAlignment="Left"
  10.118 -                       VerticalAlignment="Center"
  10.119 -                       Margin="5,0"
  10.120 -                       Text="{Binding Path=PartnerDisplayName, Mode=OneWay}" />
  10.121 -        </StackPanel>
  10.122 -
  10.123 -        <!--Tabs-->
  10.124 -        <StackPanel Orientation="Horizontal"
  10.125 -                    HorizontalAlignment="Right">
  10.126 -            <Label Name="TabControlTrustwords"
  10.127 -                   MouseLeftButtonUp="TabControlTrustwords_MouseLeftButtonUp"
  10.128 -                   Content="{x:Static p:Resources.Handshake_TrustwordsText}"
  10.129 -                   Visibility="{Binding Path=AreTabControlsVisible, Converter={StaticResource BoolToVisibility}}">
  10.130 -                <Label.Style>
  10.131 -                    <Style TargetType="Label">
  10.132 -                        <Setter Property="BorderBrush"
  10.133 -                                Value="LightGray" />
  10.134 -                        <Setter Property="Background"
  10.135 -                                Value="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBackground}, ConverterParameter=Trustwords}" />
  10.136 -                        <Setter Property="BorderThickness"
  10.137 -                                Value="1" />
  10.138 -                        <Setter Property="Padding"
  10.139 -                                Value="10,5" />
  10.140 -                        <Style.Triggers>
  10.141 -                            <MultiDataTrigger>
  10.142 -                                <MultiDataTrigger.Conditions>
  10.143 -                                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
  10.144 -                                               Value="True" />
  10.145 -                                    <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Trustwords}"
  10.146 -                                               Value="False" />
  10.147 -                                </MultiDataTrigger.Conditions>
  10.148 -                                <Setter Property="Background"
  10.149 -                                        Value="AliceBlue" />
  10.150 -                                <Setter Property="BorderBrush"
  10.151 -                                        Value="LightSkyBlue" />
  10.152 -                            </MultiDataTrigger>
  10.153 -                        </Style.Triggers>
  10.154 -                    </Style>
  10.155 -                </Label.Style>
  10.156 -            </Label>
  10.157 -            <Label Name="TabControlFingerprint"
  10.158 -                   MouseLeftButtonUp="TabControlFingerprint_MouseLeftButtonUp"
  10.159 -                   Content="{x:Static p:Resources.Handshake_FingerprintText}"
  10.160 -                   Visibility="{Binding Path=AreTabControlsVisible, Converter={StaticResource BoolToVisibility}}">
  10.161 -                <Label.Style>
  10.162 -                    <Style TargetType="Label">
  10.163 -                        <Setter Property="BorderBrush"
  10.164 -                                Value="LightGray" />
  10.165 -                        <Setter Property="Background"
  10.166 -                                Value="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBackground}, ConverterParameter=Fingerprint}" />
  10.167 -                        <Setter Property="BorderThickness"
  10.168 -                                Value="1" />
  10.169 -                        <Setter Property="Padding"
  10.170 -                                Value="10,5" />
  10.171 -                        <Style.Triggers>
  10.172 -                            <MultiDataTrigger>
  10.173 -                                <MultiDataTrigger.Conditions>
  10.174 -                                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
  10.175 -                                               Value="True" />
  10.176 -                                    <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Fingerprint}"
  10.177 -                                               Value="False" />
  10.178 -                                </MultiDataTrigger.Conditions>
  10.179 -                                <Setter Property="Background"
  10.180 -                                        Value="AliceBlue" />
  10.181 -                                <Setter Property="BorderBrush"
  10.182 -                                        Value="LightSkyBlue" />
  10.183 -                            </MultiDataTrigger>
  10.184 -                        </Style.Triggers>
  10.185 -                    </Style>
  10.186 -                </Label.Style>
  10.187 -            </Label>
  10.188 -
  10.189 -            <!--Language selector-->
  10.190 -            <ComboBox Padding="10,2"
  10.191 -                      VerticalContentAlignment="Center"
  10.192 -                      ItemsSource="{Binding Path=TrustwordsCultureList, Mode=OneWay}"
  10.193 -                      DisplayMemberPath="Value"
  10.194 -                      SelectedValuePath="Key"
  10.195 -                      SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}"
  10.196 -                      IsEnabled="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Trustwords}"
  10.197 -                      Foreground="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled, Converter={StaticResource IsEnabledToColor}}" />
  10.198 -        </StackPanel>
  10.199 -
  10.200 -        <!-- Trustwords -->
  10.201 -        <StackPanel Background="White"
  10.202 -                    Visibility="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToVisibility}, ConverterParameter=Trustwords}">
  10.203 -            <TextBox Background="Transparent"
  10.204 -                     BorderThickness="0"
  10.205 -                     Text="{Binding Path=TrustwordsShort}"
  10.206 -                     Visibility="{Binding Path=AreTrustwordsExpanded, Converter={StaticResource InvertBoolToVisibility}}"
  10.207 -                     IsReadOnly="True"
  10.208 -                     TextWrapping="Wrap" 
  10.209 -                     Padding="10"/>
  10.210 -            <TextBox Background="Transparent"
  10.211 -                     BorderThickness="0"
  10.212 -                     Text="{Binding Path=TrustwordsFull}"
  10.213 -                     Visibility="{Binding Path=AreTrustwordsExpanded, Converter={StaticResource BoolToVisibility}}"
  10.214 -                     IsReadOnly="True"
  10.215 -                     TextWrapping="Wrap"
  10.216 -                     Padding="10" />
  10.217 -            <Expander ExpandDirection="Down"
  10.218 -                      Margin="10,10,5,5"
  10.219 -                      ToolTip="{Binding Path=ExpanderToolTip, Mode=OneWay}"                     
  10.220 -                      Collapsed="ExpanderTrustwords_Toggled"
  10.221 -                      Expanded="ExpanderTrustwords_Toggled" />
  10.222 -        </StackPanel>
  10.223 -
  10.224 -        <!--Fingerprints-->
  10.225 -        <StackPanel Background="White"
  10.226 -                    Visibility="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToVisibility}, ConverterParameter=Fingerprint}">
  10.227 -            <TextBlock Text="{Binding Path=UIDPartner}"
  10.228 -                       Margin="10,10,10,2" />
  10.229 -            <TextBlock Text="{Binding Path=FingerprintPartner}"
  10.230 -                       Margin="10,2,10,22" />
  10.231 -            <TextBlock Text="{Binding Path=UIDMyself}"
  10.232 -                       Margin="10,10,10,2" />
  10.233 -            <TextBlock Text="{Binding Path=FingerprintMyself}"
  10.234 -                       Margin="10,2,10,10" />
  10.235 -        </StackPanel>
  10.236 -
  10.237 -        <!-- Buttons -->
  10.238 -        <StackPanel Grid.Row="5"
  10.239 -                    Orientation="Horizontal"
  10.240 -                    HorizontalAlignment="Right"
  10.241 -                    Margin="0,5,0,0">
  10.242 -            <Button Style="{StaticResource StyleButtonWrong}"
  10.243 -                    HorizontalAlignment="Center"
  10.244 -                    Margin="0,5,5,5"
  10.245 -                    Content="{Binding Path=ButtonWrongText, FallbackValue=Wrong}"
  10.246 -                    Command="{Binding ButtonWrongOnClick}"
  10.247 -                    CommandParameter="{Binding ElementName=WindowHandshakeDialog}"/>
  10.248 -            <Button Style="{StaticResource StyleButtonConfirm}"
  10.249 -                    HorizontalAlignment="Center"
  10.250 -                    Margin="5,5,0,5"
  10.251 -                    Content="{Binding Path=ButtonConfirmText, FallbackValue=Confirm}"
  10.252 -                    Command="{Binding ButtonConfirmOnClick}"
  10.253 -                    CommandParameter="{Binding ElementName=WindowHandshakeDialog}"
  10.254 -                    IsDefault="True"/>
  10.255 -        </StackPanel>
  10.256 -    </StackPanel>
  10.257 -</Window>
    11.1 --- a/UI/Views/HandshakeDialog.xaml.cs	Thu Aug 22 09:41:47 2019 +0200
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,118 +0,0 @@
    11.4 -using pEp.UI.Models;
    11.5 -using pEp.UI.ViewModels;
    11.6 -using System.ComponentModel;
    11.7 -using System.Windows;
    11.8 -using System.Windows.Input;
    11.9 -
   11.10 -namespace pEp.UI.Views
   11.11 -{
   11.12 -    /// <summary>
   11.13 -    /// Interaction logic for HandshakeDialog.xaml
   11.14 -    /// </summary>
   11.15 -    internal partial class HandshakeDialog : Window
   11.16 -    {
   11.17 -        private bool isShownDialog = false;
   11.18 -
   11.19 -        #region Constructors
   11.20 -
   11.21 -        /// <summary>
   11.22 -        /// Primary Constructor.
   11.23 -        /// </summary>
   11.24 -        public HandshakeDialog()
   11.25 -        {
   11.26 -            InitializeComponent();
   11.27 -        }
   11.28 -
   11.29 -        /// Constructor that sets the ViewModel of the dialog.
   11.30 -        /// </summary>
   11.31 -        /// <param name="viewModel">The ViewModel of this dialog.</param>
   11.32 -        public HandshakeDialog(HandshakeViewModel viewModel) : this()
   11.33 -        {
   11.34 -            this.DataContext = viewModel;
   11.35 -        }
   11.36 -
   11.37 -        /// <summary>
   11.38 -        /// Constructor using a Handshake object.
   11.39 -        /// </summary>
   11.40 -        /// <param name="handshake">The Handshake object to create the dialog for.</param>
   11.41 -        public HandshakeDialog(Handshake handshake) : this(new HandshakeViewModel(handshake))
   11.42 -        {
   11.43 -        }
   11.44 -
   11.45 -        /// <summary>
   11.46 -        /// Constructor using the identities for this Handshake. 
   11.47 -        /// </summary>
   11.48 -        /// <param name="myself">The Myself identity.</param>
   11.49 -        /// <param name="partner">The handshake partner identity.</param>
   11.50 -        /// <param name="mode">The mode of this dialog.</param>
   11.51 -        public HandshakeDialog(PEPIdentity myself, PEPIdentity partner, Handshake.HandshakeMode mode) : this(new Handshake(myself, partner, mode))
   11.52 -        {
   11.53 -        }
   11.54 -
   11.55 -        #endregion
   11.56 -
   11.57 -        #region Event handlers
   11.58 -
   11.59 -        /// <summary>
   11.60 -        /// Event handler for when the Handshake dialog is being closed.
   11.61 -        /// </summary>
   11.62 -        private void HandshakeDialog_Closing(object sender, CancelEventArgs e)
   11.63 -        {
   11.64 -            if (this.isShownDialog &&
   11.65 -                (this.DataContext is HandshakeViewModel handshakeViewModel))
   11.66 -            {
   11.67 -                this.DialogResult = handshakeViewModel.DialogResult;
   11.68 -            }
   11.69 -        }
   11.70 -
   11.71 -        /// <summary>
   11.72 -        /// Event handler for when the Trustwords tab control is clicked.
   11.73 -        /// </summary>
   11.74 -        private void TabControlTrustwords_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
   11.75 -        {
   11.76 -            if (this.DataContext is HandshakeViewModel handshakeViewModel)
   11.77 -            {
   11.78 -                handshakeViewModel.ActiveTab = HandshakeViewModel.Tabs.Trustwords;
   11.79 -            }
   11.80 -        }
   11.81 -
   11.82 -        /// <summary>
   11.83 -        /// Event handler for when the fingerprint tab control is clicked.
   11.84 -        /// </summary>
   11.85 -        private void TabControlFingerprint_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
   11.86 -        {
   11.87 -            if (this.DataContext is HandshakeViewModel handshakeViewModel)
   11.88 -            {
   11.89 -                handshakeViewModel.ActiveTab = HandshakeViewModel.Tabs.Fingerprint;
   11.90 -            }
   11.91 -        }
   11.92 -
   11.93 -        /// <summary>
   11.94 -        /// Event handler for when the expander is toggled.
   11.95 -        /// </summary>
   11.96 -        private void ExpanderTrustwords_Toggled(object sender, RoutedEventArgs e)
   11.97 -        {
   11.98 -            // Toggle the AreTrustwordsExpanded property
   11.99 -            if (this.DataContext is HandshakeViewModel handshakeViewModel)
  11.100 -            {
  11.101 -                handshakeViewModel.AreTrustwordsExpanded = !handshakeViewModel.AreTrustwordsExpanded;
  11.102 -            }
  11.103 -        }
  11.104 -
  11.105 -        #endregion
  11.106 -
  11.107 -        #region Methods
  11.108 -
  11.109 -        /// <summary>
  11.110 -        /// Overloads the ShowDialog method and sets a flag to signal that this dialog is modal.
  11.111 -        /// </summary>
  11.112 -        /// <returns>The DialogResult of the base's ShowDialog method.</returns>
  11.113 -        public new bool? ShowDialog()
  11.114 -        {
  11.115 -            this.isShownDialog = true;
  11.116 -            return base.ShowDialog();
  11.117 -        }
  11.118 -
  11.119 -        #endregion
  11.120 -    }
  11.121 -}
  11.122 \ No newline at end of file
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/UI/Views/HandshakeView.xaml	Thu Aug 22 10:08:25 2019 +0200
    12.3 @@ -0,0 +1,223 @@
    12.4 +<UserControl x:Class="pEp.UI.Views.HandshakeView"
    12.5 +             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    12.6 +             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    12.7 +             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    12.8 +             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    12.9 +             xmlns:p="clr-namespace:pEp.Properties"
   12.10 +             xmlns:local="clr-namespace:pEp.UI.Views"
   12.11 +             xmlns:ui="clr-namespace:pEp.UI"
   12.12 +             mc:Ignorable="d" 
   12.13 +             d:DesignHeight="450" d:DesignWidth="800">
   12.14 +    <UserControl.Resources>
   12.15 +        <ResourceDictionary>
   12.16 +            <!-- Converters -->
   12.17 +            <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
   12.18 +            <ui:IsActiveTabToBoolConverter x:Key="IsActiveTabToBool" />
   12.19 +            <ui:IsEnabledToColorConverter x:Key="IsEnabledToColor" />
   12.20 +            <ui:ValueConverterGroup x:Key="InvertBoolToVisibility">
   12.21 +                <ui:InvertBoolConverter />
   12.22 +                <BooleanToVisibilityConverter />
   12.23 +            </ui:ValueConverterGroup>
   12.24 +            <ui:ValueConverterGroup x:Key="IsActiveTabToBackground">
   12.25 +                <ui:IsActiveTabToBoolConverter />
   12.26 +                <ui:BooleanToBackgroundConverter />
   12.27 +            </ui:ValueConverterGroup>
   12.28 +            <ui:ValueConverterGroup x:Key="IsActiveTabToVisibility">
   12.29 +                <ui:IsActiveTabToBoolConverter />
   12.30 +                <BooleanToVisibilityConverter />
   12.31 +            </ui:ValueConverterGroup>
   12.32 +            <ui:ValueConverterGroup x:Key="IsSyncModeToVisibility">
   12.33 +                <ui:IsSyncModeToBoolConverter />
   12.34 +                <BooleanToVisibilityConverter />
   12.35 +            </ui:ValueConverterGroup>
   12.36 +            
   12.37 +            <!-- Dictionary -->
   12.38 +            <ResourceDictionary.MergedDictionaries>
   12.39 +                <ResourceDictionary Source="pack://application:,,,/pEp;component/Resources/Dictionary.xaml" />
   12.40 +            </ResourceDictionary.MergedDictionaries>
   12.41 +        </ResourceDictionary>
   12.42 +    </UserControl.Resources>
   12.43 +    <!--The window content-->
   12.44 +    <StackPanel Margin="10"
   12.45 +                Width="470">
   12.46 +
   12.47 +        <!--Information section-->
   12.48 +        <TextBlock Text="{Binding Path=ExplanationText, Mode=OneWay}"
   12.49 +                   TextWrapping="Wrap"
   12.50 +                   Margin="5,5,5,15" />
   12.51 +
   12.52 +        <!--Sync identities-->
   12.53 +        <ComboBox ItemsSource="{Binding SyncIdentities}"
   12.54 +                  Text="{x:Static p:Resources.Handshake_SelectSyncIdentities}"
   12.55 +                  IsEditable="True"
   12.56 +                  IsReadOnly="True"
   12.57 +                  Focusable="False"
   12.58 +                  Visibility="{Binding Mode, Converter={StaticResource IsSyncModeToVisibility}}">
   12.59 +            <ComboBox.ItemTemplate>
   12.60 +                <DataTemplate>
   12.61 +                    <StackPanel Orientation="Horizontal">
   12.62 +                        <CheckBox Width="20"                                                                     
   12.63 +                                  IsThreeState="false"
   12.64 +                                  IsChecked="{Binding Synchronize, Mode=TwoWay}"/>
   12.65 +                        <TextBlock Text="{Binding DisplayName, Mode=OneWay}"/>
   12.66 +                    </StackPanel>
   12.67 +                </DataTemplate>
   12.68 +            </ComboBox.ItemTemplate>
   12.69 +        </ComboBox>
   12.70 +
   12.71 +        <!-- The User name and icon -->
   12.72 +        <StackPanel Orientation="Horizontal"
   12.73 +                    Margin="10,20">
   12.74 +
   12.75 +            <!--The identity rating-->
   12.76 +            <Image Height="15"
   12.77 +                   Stretch="Uniform"
   12.78 +                   VerticalAlignment="Stretch"
   12.79 +                   HorizontalAlignment="Center"
   12.80 +                   Margin="0,0,5,0"
   12.81 +                   Source="{Binding Path=PEPColorIcon, Mode=OneWay}" />
   12.82 +
   12.83 +
   12.84 +            <!--The identity name-->
   12.85 +            <TextBlock HorizontalAlignment="Left"
   12.86 +                       VerticalAlignment="Center"
   12.87 +                       Margin="5,0"
   12.88 +                       Text="{Binding Path=PartnerDisplayName, Mode=OneWay}" />
   12.89 +        </StackPanel>
   12.90 +
   12.91 +        <!--Tabs-->
   12.92 +        <StackPanel Orientation="Horizontal"
   12.93 +                    HorizontalAlignment="Right">
   12.94 +            <Label Name="TabControlTrustwords"
   12.95 +                   MouseLeftButtonUp="TabControlTrustwords_MouseLeftButtonUp"
   12.96 +                   Content="{x:Static p:Resources.Handshake_TrustwordsText}"
   12.97 +                   Visibility="{Binding Path=AreTabControlsVisible, Converter={StaticResource BoolToVisibility}}">
   12.98 +                <Label.Style>
   12.99 +                    <Style TargetType="Label">
  12.100 +                        <Setter Property="BorderBrush"
  12.101 +                                Value="LightGray" />
  12.102 +                        <Setter Property="Background"
  12.103 +                                Value="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBackground}, ConverterParameter=Trustwords}" />
  12.104 +                        <Setter Property="BorderThickness"
  12.105 +                                Value="1" />
  12.106 +                        <Setter Property="Padding"
  12.107 +                                Value="10,5" />
  12.108 +                        <Style.Triggers>
  12.109 +                            <MultiDataTrigger>
  12.110 +                                <MultiDataTrigger.Conditions>
  12.111 +                                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
  12.112 +                                               Value="True" />
  12.113 +                                    <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Trustwords}"
  12.114 +                                               Value="False" />
  12.115 +                                </MultiDataTrigger.Conditions>
  12.116 +                                <Setter Property="Background"
  12.117 +                                        Value="AliceBlue" />
  12.118 +                                <Setter Property="BorderBrush"
  12.119 +                                        Value="LightSkyBlue" />
  12.120 +                            </MultiDataTrigger>
  12.121 +                        </Style.Triggers>
  12.122 +                    </Style>
  12.123 +                </Label.Style>
  12.124 +            </Label>
  12.125 +            <Label Name="TabControlFingerprint"
  12.126 +                   MouseLeftButtonUp="TabControlFingerprint_MouseLeftButtonUp"
  12.127 +                   Content="{x:Static p:Resources.Handshake_FingerprintText}"
  12.128 +                   Visibility="{Binding Path=AreTabControlsVisible, Converter={StaticResource BoolToVisibility}}">
  12.129 +                <Label.Style>
  12.130 +                    <Style TargetType="Label">
  12.131 +                        <Setter Property="BorderBrush"
  12.132 +                                Value="LightGray" />
  12.133 +                        <Setter Property="Background"
  12.134 +                                Value="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBackground}, ConverterParameter=Fingerprint}" />
  12.135 +                        <Setter Property="BorderThickness"
  12.136 +                                Value="1" />
  12.137 +                        <Setter Property="Padding"
  12.138 +                                Value="10,5" />
  12.139 +                        <Style.Triggers>
  12.140 +                            <MultiDataTrigger>
  12.141 +                                <MultiDataTrigger.Conditions>
  12.142 +                                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
  12.143 +                                               Value="True" />
  12.144 +                                    <Condition Binding="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Fingerprint}"
  12.145 +                                               Value="False" />
  12.146 +                                </MultiDataTrigger.Conditions>
  12.147 +                                <Setter Property="Background"
  12.148 +                                        Value="AliceBlue" />
  12.149 +                                <Setter Property="BorderBrush"
  12.150 +                                        Value="LightSkyBlue" />
  12.151 +                            </MultiDataTrigger>
  12.152 +                        </Style.Triggers>
  12.153 +                    </Style>
  12.154 +                </Label.Style>
  12.155 +            </Label>
  12.156 +
  12.157 +            <!--Language selector-->
  12.158 +            <ComboBox Padding="10,2"
  12.159 +                      VerticalContentAlignment="Center"
  12.160 +                      ItemsSource="{Binding Path=TrustwordsCultureList, Mode=OneWay}"
  12.161 +                      DisplayMemberPath="Value"
  12.162 +                      SelectedValuePath="Key"
  12.163 +                      SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}"
  12.164 +                      IsEnabled="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToBool}, ConverterParameter=Trustwords}"
  12.165 +                      Foreground="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled, Converter={StaticResource IsEnabledToColor}}" />
  12.166 +        </StackPanel>
  12.167 +
  12.168 +        <!-- Trustwords -->
  12.169 +        <StackPanel Background="White"
  12.170 +                    Visibility="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToVisibility}, ConverterParameter=Trustwords}">
  12.171 +            <TextBox Background="Transparent"
  12.172 +                     BorderThickness="0"
  12.173 +                     Text="{Binding Path=TrustwordsShort}"
  12.174 +                     Visibility="{Binding Path=AreTrustwordsExpanded, Converter={StaticResource InvertBoolToVisibility}}"
  12.175 +                     IsReadOnly="True"
  12.176 +                     TextWrapping="Wrap" 
  12.177 +                     Padding="10"/>
  12.178 +            <TextBox Background="Transparent"
  12.179 +                     BorderThickness="0"
  12.180 +                     Text="{Binding Path=TrustwordsFull}"
  12.181 +                     Visibility="{Binding Path=AreTrustwordsExpanded, Converter={StaticResource BoolToVisibility}}"
  12.182 +                     IsReadOnly="True"
  12.183 +                     TextWrapping="Wrap"
  12.184 +                     Padding="10" />
  12.185 +            <Expander ExpandDirection="Down"
  12.186 +                      Margin="10,10,5,5"
  12.187 +                      ToolTip="{Binding Path=ExpanderToolTip, Mode=OneWay}"                     
  12.188 +                      Collapsed="ExpanderTrustwords_Toggled"
  12.189 +                      Expanded="ExpanderTrustwords_Toggled" />
  12.190 +        </StackPanel>
  12.191 +
  12.192 +        <!--Fingerprints-->
  12.193 +        <StackPanel Background="White"
  12.194 +                    Visibility="{Binding Path=ActiveTab, Converter={StaticResource IsActiveTabToVisibility}, ConverterParameter=Fingerprint}">
  12.195 +            <TextBlock Text="{Binding Path=UIDPartner}"
  12.196 +                       Margin="10,10,10,2" />
  12.197 +            <TextBlock Text="{Binding Path=FingerprintPartner}"
  12.198 +                       Margin="10,2,10,22" />
  12.199 +            <TextBlock Text="{Binding Path=UIDMyself}"
  12.200 +                       Margin="10,10,10,2" />
  12.201 +            <TextBlock Text="{Binding Path=FingerprintMyself}"
  12.202 +                       Margin="10,2,10,10" />
  12.203 +        </StackPanel>
  12.204 +
  12.205 +        <!-- Buttons -->
  12.206 +        <StackPanel Grid.Row="5"
  12.207 +                    Orientation="Horizontal"
  12.208 +                    HorizontalAlignment="Right"
  12.209 +                    Margin="0,5,0,0">
  12.210 +            <Button Style="{StaticResource StyleButtonWrong}"
  12.211 +                    HorizontalAlignment="Center"
  12.212 +                    Margin="0,5,5,5"
  12.213 +                    Content="{Binding Path=ButtonWrongText, FallbackValue=Wrong}"
  12.214 +                    Command="{Binding ButtonWrongOnClick}"
  12.215 +                    CommandParameter="{Binding ElementName=WindowHandshakeDialog}"/>
  12.216 +            <Button Style="{StaticResource StyleButtonConfirm}"
  12.217 +                    HorizontalAlignment="Center"
  12.218 +                    Margin="5,5,0,5"
  12.219 +                    Content="{Binding Path=ButtonConfirmText, FallbackValue=Confirm}"
  12.220 +                    Command="{Binding ButtonConfirmOnClick}"
  12.221 +                    CommandParameter="{Binding ElementName=WindowHandshakeDialog}"
  12.222 +                    IsDefault="True"/>
  12.223 +        </StackPanel>
  12.224 +    </StackPanel>
  12.225 +
  12.226 +</UserControl>
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/UI/Views/HandshakeView.xaml.cs	Thu Aug 22 10:08:25 2019 +0200
    13.3 @@ -0,0 +1,56 @@
    13.4 +using pEp.UI.ViewModels;
    13.5 +using System.Windows;
    13.6 +using System.Windows.Controls;
    13.7 +using System.Windows.Input;
    13.8 +
    13.9 +namespace pEp.UI.Views
   13.10 +{
   13.11 +    /// <summary>
   13.12 +    /// Interaction logic for HandshakeView.xaml
   13.13 +    /// </summary>
   13.14 +    public partial class HandshakeView : UserControl
   13.15 +    {
   13.16 +        public HandshakeView()
   13.17 +        {
   13.18 +            InitializeComponent();
   13.19 +        }
   13.20 +
   13.21 +        #region Event handlers
   13.22 +
   13.23 +        /// <summary>
   13.24 +        /// Event handler for when the Trustwords tab control is clicked.
   13.25 +        /// </summary>
   13.26 +        private void TabControlTrustwords_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
   13.27 +        {
   13.28 +            if (this.DataContext is HandshakeViewModel handshakeViewModel)
   13.29 +            {
   13.30 +                handshakeViewModel.ActiveTab = HandshakeViewModel.Tabs.Trustwords;
   13.31 +            }
   13.32 +        }
   13.33 +
   13.34 +        /// <summary>
   13.35 +        /// Event handler for when the fingerprint tab control is clicked.
   13.36 +        /// </summary>
   13.37 +        private void TabControlFingerprint_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
   13.38 +        {
   13.39 +            if (this.DataContext is HandshakeViewModel handshakeViewModel)
   13.40 +            {
   13.41 +                handshakeViewModel.ActiveTab = HandshakeViewModel.Tabs.Fingerprint;
   13.42 +            }
   13.43 +        }
   13.44 +
   13.45 +        /// <summary>
   13.46 +        /// Event handler for when the expander is toggled.
   13.47 +        /// </summary>
   13.48 +        private void ExpanderTrustwords_Toggled(object sender, RoutedEventArgs e)
   13.49 +        {
   13.50 +            // Toggle the AreTrustwordsExpanded property
   13.51 +            if (this.DataContext is HandshakeViewModel handshakeViewModel)
   13.52 +            {
   13.53 +                handshakeViewModel.AreTrustwordsExpanded = !handshakeViewModel.AreTrustwordsExpanded;
   13.54 +            }
   13.55 +        }
   13.56 +
   13.57 +        #endregion        
   13.58 +    }
   13.59 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/UI/Views/WizardGenericPageView.xaml	Thu Aug 22 10:08:25 2019 +0200
    14.3 @@ -0,0 +1,22 @@
    14.4 +<UserControl x:Class="pEp.UI.Views.WizardGenericPageView"
    14.5 +             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    14.6 +             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    14.7 +             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    14.8 +             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    14.9 +             mc:Ignorable="d">
   14.10 +    <StackPanel>
   14.11 +
   14.12 +        <!--Information section-->
   14.13 +        <TextBlock Text="{Binding ExplanationText}"
   14.14 +                   TextWrapping="Wrap"
   14.15 +                   Margin="5,5,5,15" />
   14.16 +
   14.17 +        <Image Height="80"
   14.18 +               Stretch="Uniform"
   14.19 +               VerticalAlignment="Stretch"
   14.20 +               HorizontalAlignment="Center"
   14.21 +               Margin="0,0,15,0"
   14.22 +               Source="{Binding Image}" />
   14.23 +
   14.24 +    </StackPanel>
   14.25 +</UserControl>
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/UI/Views/WizardGenericPageView.xaml.cs	Thu Aug 22 10:08:25 2019 +0200
    15.3 @@ -0,0 +1,28 @@
    15.4 +using System;
    15.5 +using System.Collections.Generic;
    15.6 +using System.Linq;
    15.7 +using System.Text;
    15.8 +using System.Threading.Tasks;
    15.9 +using System.Windows;
   15.10 +using System.Windows.Controls;
   15.11 +using System.Windows.Data;
   15.12 +using System.Windows.Documents;
   15.13 +using System.Windows.Input;
   15.14 +using System.Windows.Media;
   15.15 +using System.Windows.Media.Imaging;
   15.16 +using System.Windows.Navigation;
   15.17 +using System.Windows.Shapes;
   15.18 +
   15.19 +namespace pEp.UI.Views
   15.20 +{
   15.21 +    /// <summary>
   15.22 +    /// Interaction logic for WizardGenericPageView.xaml
   15.23 +    /// </summary>
   15.24 +    public partial class WizardGenericPageView : UserControl
   15.25 +    {
   15.26 +        public WizardGenericPageView()
   15.27 +        {
   15.28 +            InitializeComponent();
   15.29 +        }
   15.30 +    }
   15.31 +}
    16.1 --- a/UI/Views/WizardPageView.xaml	Thu Aug 22 09:41:47 2019 +0200
    16.2 +++ b/UI/Views/WizardPageView.xaml	Thu Aug 22 10:08:25 2019 +0200
    16.3 @@ -9,43 +9,16 @@
    16.4               xmlns:p="clr-namespace:pEp.Properties"
    16.5               mc:Ignorable="d">
    16.6      <UserControl.Resources>
    16.7 -        <ResourceDictionary>
    16.8 -            <!-- Converters -->
    16.9 -            <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
   16.10 -            <local:ValueConverterGroup x:Key="InvertBoolToVisibility">
   16.11 -                <local:InvertBoolConverter />
   16.12 -                <BooleanToVisibilityConverter />
   16.13 -            </local:ValueConverterGroup>
   16.14 -            <local:MultiBooleanToVisibilityConverter x:Key="MultiBooleanToVisibility" />
   16.15 -            <local:ValueConverterGroup x:Key="IsStringNotNullOrEmptyToVisibility">
   16.16 -                <local:IsStringEmptyConverter />
   16.17 -                <local:InvertBoolConverter />
   16.18 -                <BooleanToVisibilityConverter />
   16.19 -            </local:ValueConverterGroup>
   16.20 -            <local:IsWizardTypeConverter x:Key="IsWizardType" />
   16.21 +        <DataTemplate DataType="{x:Type vm:WizardGenericPageViewModel}">
   16.22 +            <v:WizardGenericPageView />
   16.23 +        </DataTemplate>
   16.24 +        <DataTemplate DataType="{x:Type vm:HandshakeViewModel}">
   16.25 +            <v:HandshakeView />
   16.26 +        </DataTemplate>
   16.27 +    </UserControl.Resources>
   16.28  
   16.29 -            <!--Dictionary-->
   16.30 -            <ResourceDictionary.MergedDictionaries>
   16.31 -                <ResourceDictionary Source="pack://application:,,,/pEp;component/Resources/Dictionary.xaml" />
   16.32 -            </ResourceDictionary.MergedDictionaries>
   16.33 -        </ResourceDictionary>
   16.34 -    </UserControl.Resources>
   16.35 -    <StackPanel Margin="10"
   16.36 -                Width="470">
   16.37 -
   16.38 -        <!--Information section-->
   16.39 -        <TextBlock Text="{Binding ExplanationText}"
   16.40 -                   TextWrapping="Wrap"
   16.41 -                   Margin="5,5,5,15" />
   16.42 -
   16.43 -        <Image Height="80"
   16.44 -                       Stretch="Uniform"
   16.45 -                       VerticalAlignment="Stretch"
   16.46 -                       HorizontalAlignment="Center"
   16.47 -                       Margin="0,0,15,0"
   16.48 -                       Source="pack://application:,,,/pEp;component/Resources/ImageIconDeviceGroup.png">
   16.49 -        </Image>
   16.50 -
   16.51 -
   16.52 -    </StackPanel>
   16.53 +    <ContentControl x:Name="WizardPageContent"                    
   16.54 +                    Content="{Binding Content}">
   16.55 +    </ContentControl>
   16.56 +    
   16.57  </UserControl>
    17.1 --- a/UI/Views/WizardView.xaml	Thu Aug 22 09:41:47 2019 +0200
    17.2 +++ b/UI/Views/WizardView.xaml	Thu Aug 22 10:08:25 2019 +0200
    17.3 @@ -21,7 +21,8 @@
    17.4          </DataTemplate>
    17.5      </UserControl.Resources>
    17.6  
    17.7 -    <StackPanel>
    17.8 +    <StackPanel Margin="10"
    17.9 +                Width="470">
   17.10          
   17.11      <!--Content section-->
   17.12      <UserControl x:Name="WizardContent"
    18.1 --- a/UI/Views/WizardView.xaml.cs	Thu Aug 22 09:41:47 2019 +0200
    18.2 +++ b/UI/Views/WizardView.xaml.cs	Thu Aug 22 10:08:25 2019 +0200
    18.3 @@ -15,28 +15,5 @@
    18.4          {
    18.5              InitializeComponent();
    18.6          }
    18.7 -
    18.8 -        public WizardView(Handshake handshake, Window parentWindow) : this()
    18.9 -        {
   18.10 -            switch (handshake.Mode)
   18.11 -            {
   18.12 -                case Handshake.HandshakeMode.SyncTypeA:
   18.13 -                case Handshake.HandshakeMode.SyncTypeB:
   18.14 -                case Handshake.HandshakeMode.SyncTypeC:
   18.15 -                    {
   18.16 -                        this.DataContext = new SyncWizardViewModel(handshake, parentWindow);
   18.17 -                    }
   18.18 -                    break;
   18.19 -                case Handshake.HandshakeMode.ForceProtectionSendKey:
   18.20 -                case Handshake.HandshakeMode.ForceProtectionImportKey:
   18.21 -                    {
   18.22 -                        //this.DataContext = new ForceProtectionWizardViewModel(handshake);
   18.23 -                    }
   18.24 -                    break;
   18.25 -                case Handshake.HandshakeMode.Standard:
   18.26 -                default:
   18.27 -                    throw new Exception();
   18.28 -            }
   18.29 -        }
   18.30      }
   18.31  }
    19.1 --- a/Wrappers/WatchedWindow.cs	Thu Aug 22 09:41:47 2019 +0200
    19.2 +++ b/Wrappers/WatchedWindow.cs	Thu Aug 22 10:08:25 2019 +0200
    19.3 @@ -17,7 +17,7 @@
    19.4      {
    19.5          private CryptableMailItem               cryptableMailItem           = null;
    19.6          private bool                            displayMirrorRequested      = false;
    19.7 -        private HandshakeDialog                 handshakeDialog             = null;
    19.8 +        private DialogWindow                    handshakeDialog             = null;
    19.9          private bool                            isEnabled                   = true;
   19.10          private bool                            isStarted                   = false;
   19.11          private bool                            processingOngoing           = false;
   19.12 @@ -331,7 +331,7 @@
   19.13                      {
   19.14                          partner = message.To[0];
   19.15                      }
   19.16 -                    handshakeDialog = new HandshakeDialog(myself, partner, Handshake.HandshakeMode.Standard);
   19.17 +                    handshakeDialog = new DialogWindow(Dialog.Type.Handshake, new Handshake(myself, partner, Handshake.HandshakeMode.Standard));
   19.18                      handshakeDialog.Closed += HandshakeDialog_Closed;
   19.19                      handshakeDialog.Show();
   19.20                  }
    20.1 --- a/pEpForOutlook.csproj	Thu Aug 22 09:41:47 2019 +0200
    20.2 +++ b/pEpForOutlook.csproj	Thu Aug 22 10:08:25 2019 +0200
    20.3 @@ -411,7 +411,6 @@
    20.4      </Compile>
    20.5      <Compile Include="SyncQueue.cs" />
    20.6      <Compile Include="UI\Dialog.cs" />
    20.7 -    <Compile Include="UI\DialogCloser.cs" />
    20.8      <Compile Include="UI\FormControlCrashReport.xaml.cs">
    20.9        <DependentUpon>FormControlCrashReport.xaml</DependentUpon>
   20.10      </Compile>
   20.11 @@ -451,9 +450,6 @@
   20.12      <Compile Include="UI\Views\DialogWindow.xaml.cs">
   20.13        <DependentUpon>DialogWindow.xaml</DependentUpon>
   20.14      </Compile>
   20.15 -    <Compile Include="UI\Views\HandshakeDialog.xaml.cs">
   20.16 -      <DependentUpon>HandshakeDialog.xaml</DependentUpon>
   20.17 -    </Compile>
   20.18      <Compile Include="UI\KeySyncWizard.xaml.cs">
   20.19        <DependentUpon>KeySyncWizard.xaml</DependentUpon>
   20.20      </Compile>
   20.21 @@ -491,6 +487,12 @@
   20.22      </Compile>
   20.23      <Compile Include="UI\ValueConverters.cs" />
   20.24      <Compile Include="UI\ViewModels\ViewModelBase.cs" />
   20.25 +    <Compile Include="UI\Views\HandshakeView.xaml.cs">
   20.26 +      <DependentUpon>HandshakeView.xaml</DependentUpon>
   20.27 +    </Compile>
   20.28 +    <Compile Include="UI\Views\WizardGenericPageView.xaml.cs">
   20.29 +      <DependentUpon>WizardGenericPageView.xaml</DependentUpon>
   20.30 +    </Compile>
   20.31      <Compile Include="UI\Views\WizardPageView.xaml.cs">
   20.32        <DependentUpon>WizardPageView.xaml</DependentUpon>
   20.33      </Compile>
   20.34 @@ -653,6 +655,14 @@
   20.35        <SubType>Designer</SubType>
   20.36        <Generator>MSBuild:Compile</Generator>
   20.37      </Page>
   20.38 +    <Page Include="UI\Views\HandshakeView.xaml">
   20.39 +      <SubType>Designer</SubType>
   20.40 +      <Generator>MSBuild:Compile</Generator>
   20.41 +    </Page>
   20.42 +    <Page Include="UI\Views\WizardGenericPageView.xaml">
   20.43 +      <SubType>Designer</SubType>
   20.44 +      <Generator>MSBuild:Compile</Generator>
   20.45 +    </Page>
   20.46      <Page Include="UI\Views\WizardPageView.xaml">
   20.47        <SubType>Designer</SubType>
   20.48        <Generator>MSBuild:Compile</Generator>
   20.49 @@ -677,10 +687,6 @@
   20.50        <SubType>Designer</SubType>
   20.51        <Generator>MSBuild:Compile</Generator>
   20.52      </Page>
   20.53 -    <Page Include="UI\Views\HandshakeDialog.xaml">
   20.54 -      <SubType>Designer</SubType>
   20.55 -      <Generator>MSBuild:Compile</Generator>
   20.56 -    </Page>
   20.57      <Page Include="UI\KeySyncWizard.xaml">
   20.58        <SubType>Designer</SubType>
   20.59        <Generator>MSBuild:Compile</Generator>