Update unencrypted preview to O365 style, part 1 OUT-587
authorThomas
Thu, 08 Aug 2019 12:31:10 +0200
branchOUT-587
changeset 2696428b91e45c69
parent 2695 273816414b64
child 2698 1c6a41e15b8b
Update unencrypted preview to O365 style, part 1
UI/FormControlPreviewMessage.xaml
UI/FormControlPreviewMessage.xaml.cs
     1.1 --- a/UI/FormControlPreviewMessage.xaml	Wed Aug 07 09:47:17 2019 +0200
     1.2 +++ b/UI/FormControlPreviewMessage.xaml	Thu Aug 08 12:31:10 2019 +0200
     1.3 @@ -42,79 +42,10 @@
     1.4              </ResourceDictionary.MergedDictionaries>
     1.5          </ResourceDictionary>
     1.6      </UserControl.Resources>
     1.7 -    <Grid Name="GridLayoutRoot"
     1.8 -          Margin="5">
     1.9 -        <Grid.RowDefinitions>
    1.10 -            <RowDefinition Height="25" />
    1.11 -            <RowDefinition Height="5" />
    1.12 -            <RowDefinition Height="Auto" />
    1.13 -            <RowDefinition Height="Auto" />
    1.14 -            <RowDefinition Height="Auto" />
    1.15 -            <RowDefinition Height="Auto" />
    1.16 -            <RowDefinition Height="Auto" />
    1.17 -            <RowDefinition Height="*" />
    1.18 -        </Grid.RowDefinitions>
    1.19 +    <StackPanel Name="StackPanelLayoutRoot"
    1.20 +                Margin="5">
    1.21  
    1.22 -        <!-- Buttons & preview text -->
    1.23 -        <StackPanel Grid.Row="0"
    1.24 -                    Orientation="Horizontal"
    1.25 -                    HorizontalAlignment="Left"
    1.26 -                    VerticalAlignment="Stretch">
    1.27 -            <Button Name="ButtonReply"
    1.28 -                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
    1.29 -                    Padding="{StaticResource ButtonPaddingStandard}"
    1.30 -                    Margin="0"
    1.31 -                    HorizontalContentAlignment="Center"
    1.32 -                    VerticalContentAlignment="Center"
    1.33 -                    Click="ButtonReply_Click"
    1.34 -                    Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}">
    1.35 -                <StackPanel Orientation="Horizontal">
    1.36 -                    <Image Stretch="Uniform"
    1.37 -                           Source="pack://application:,,,/pEp;component/Resources/ImagePreviewReply.png"
    1.38 -                           Margin="0,0,4,0" />
    1.39 -                    <TextBlock VerticalAlignment="Center"
    1.40 -                               FontFamily="Segoe UI"
    1.41 -                               FontSize="12"
    1.42 -                               Text="{x:Static p:Resources.PreviewMessage_ReplyText}" />
    1.43 -                </StackPanel>
    1.44 -            </Button>
    1.45 -            <Button Name="ButtonReplyAll"
    1.46 -                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
    1.47 -                    Padding="{StaticResource ButtonPaddingStandard}"
    1.48 -                    Margin="5,0,0,0"
    1.49 -                    HorizontalContentAlignment="Center"
    1.50 -                    VerticalContentAlignment="Center"
    1.51 -                    Click="ButtonReplyAll_Click"
    1.52 -                    Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}">
    1.53 -                <StackPanel Orientation="Horizontal">
    1.54 -                    <Image Stretch="Uniform"
    1.55 -                           Source="pack://application:,,,/pEp;component/Resources/ImagePreviewReplyAll.png"
    1.56 -                           Margin="0,0,4,0" />
    1.57 -                    <TextBlock VerticalAlignment="Center"
    1.58 -                               FontFamily="Segoe UI"
    1.59 -                               FontSize="12"
    1.60 -                               Text="{x:Static p:Resources.PreviewMessage_ReplyAllText}" />
    1.61 -                </StackPanel>
    1.62 -            </Button>
    1.63 -            <Button Name="ButtonForward"
    1.64 -                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
    1.65 -                    Padding="{StaticResource ButtonPaddingStandard}"
    1.66 -                    Margin="5,0,0,0"
    1.67 -                    HorizontalContentAlignment="Center"
    1.68 -                    VerticalContentAlignment="Center"
    1.69 -                    Click="ButtonForward_Click"
    1.70 -                    Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}">
    1.71 -                <StackPanel Orientation="Horizontal">
    1.72 -                    <Image Stretch="Uniform"
    1.73 -                           Source="pack://application:,,,/pEp;component/Resources/ImagePreviewForward.png"
    1.74 -                           Margin="0,0,4,0" />
    1.75 -                    <TextBlock VerticalAlignment="Center"
    1.76 -                               FontFamily="Segoe UI"
    1.77 -                               FontSize="12"
    1.78 -                               Text="{x:Static p:Resources.PreviewMessage_ForwardText}" />
    1.79 -                </StackPanel>
    1.80 -            </Button>
    1.81 -        </StackPanel>
    1.82 +        <!--'Preview' text-->
    1.83          <TextBlock Text="{x:Static p:Resources.PreviewMessage_PreviewText}"
    1.84                     FontFamily="Segoe UI"
    1.85                     FontSize="12"
    1.86 @@ -122,31 +53,171 @@
    1.87                     HorizontalAlignment="Right"
    1.88                     VerticalAlignment="Top"
    1.89                     Margin="0"
    1.90 -                   Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
    1.91 +                   Visibility="{Binding IsNoteModeEnabled, Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
    1.92  
    1.93 -        <!-- Message info header -->
    1.94 -        <Grid Grid.Row="2">
    1.95 +        <!--Subject-->
    1.96 +        <TextBox Background="Transparent"
    1.97 +                 BorderThickness="0"
    1.98 +                 IsReadOnly="True"
    1.99 +                 IsTabStop="False"
   1.100 +                 FontFamily="Segoe UI Semibold"
   1.101 +                 FontSize="20"
   1.102 +                 Margin="0,5"
   1.103 +                 Text="{Binding Message.ShortMsg}"
   1.104 +                 TextWrapping="NoWrap"
   1.105 +                 HorizontalAlignment="Stretch"
   1.106 +                 VerticalAlignment="Center" />
   1.107 +
   1.108 +        <!--Contact image, recipients and reply buttons-->
   1.109 +        <Grid Name="GridContactRecipients"
   1.110 +              Visibility="{Binding IsNoteModeEnabled, Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" >
   1.111              <Grid.ColumnDefinitions>
   1.112                  <ColumnDefinition Width="Auto" />
   1.113 -                <ColumnDefinition Width="20" />
   1.114                  <ColumnDefinition Width="Auto" />
   1.115 +                <ColumnDefinition Width="*" />
   1.116              </Grid.ColumnDefinitions>
   1.117              <Grid.RowDefinitions>
   1.118 -                <RowDefinition Height="Auto" />
   1.119 -                <RowDefinition Height="Auto" />
   1.120 -                <RowDefinition Height="Auto" />
   1.121 +                <RowDefinition Height="Auto"/>
   1.122 +                <RowDefinition Height="Auto"/>
   1.123 +                <RowDefinition Height="Auto"/>
   1.124              </Grid.RowDefinitions>
   1.125  
   1.126 -            <!--Image-->
   1.127 -            <Image Grid.Row="0"
   1.128 -                   Grid.RowSpan="3"
   1.129 -                   Grid.Column="0"
   1.130 -                   Stretch="Uniform"
   1.131 -                   Source="pack://application:,,,/pEp;component/Resources/ImagePreviewContact.png"
   1.132 -                   Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
   1.133 +            <!--Contact image-->
   1.134 +            <Canvas Grid.Row="0"
   1.135 +                    Grid.RowSpan="3"
   1.136 +                    Grid.Column="0"
   1.137 +                    Height="60"
   1.138 +                    Width="60"
   1.139 +                    Margin="0,0,5,0">
   1.140 +                <Ellipse Name="EllipseContactImage"
   1.141 +                         Width="48"
   1.142 +                         Height="48"
   1.143 +                         Fill="{Binding ContactIconBackground}"
   1.144 +                         Canvas.Left="6"
   1.145 +                         Canvas.Top="6"/>
   1.146 +            </Canvas>
   1.147  
   1.148 -            <!-- Date -->
   1.149 +            <!-- From recipient -->
   1.150              <TextBox Grid.Row="0"
   1.151 +                     Grid.Column="1"
   1.152 +                     Background="Transparent"
   1.153 +                     FontFamily="Segoe UI"
   1.154 +                     FontSize="14"
   1.155 +                     Foreground="DarkSlateGray"
   1.156 +                     BorderThickness="0"
   1.157 +                     IsReadOnly="True"
   1.158 +                     IsTabStop="False"
   1.159 +                     Text="{Binding FromRecipient, Mode=OneWay}"
   1.160 +                     TextWrapping="NoWrap"
   1.161 +                     HorizontalAlignment="Stretch"
   1.162 +                     VerticalAlignment="Center" />
   1.163 +
   1.164 +            <!--Reply buttons-->
   1.165 +            <StackPanel Grid.Row="0"
   1.166 +                        Grid.Column="2"
   1.167 +                    Orientation="Horizontal"
   1.168 +                    HorizontalAlignment="Right"
   1.169 +                    VerticalAlignment="Stretch">
   1.170 +                <Button Name="ButtonReply"
   1.171 +                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
   1.172 +                    Padding="10,7"
   1.173 +                    Margin="0"
   1.174 +                    BorderBrush="DarkGray"
   1.175 +                    BorderThickness="1"
   1.176 +                    HorizontalContentAlignment="Center"
   1.177 +                    VerticalContentAlignment="Center"
   1.178 +                    Click="ButtonReply_Click">
   1.179 +                    <StackPanel Orientation="Horizontal">
   1.180 +                        <Image Stretch="Uniform"
   1.181 +                           Source="pack://application:,,,/pEp;component/Resources/ImagePreviewReply.png"
   1.182 +                           Margin="0,0,4,0" />
   1.183 +                        <TextBlock VerticalAlignment="Center"
   1.184 +                               FontFamily="Segoe UI"
   1.185 +                               FontSize="12"
   1.186 +                               Text="{x:Static p:Resources.PreviewMessage_ReplyText}" />
   1.187 +                    </StackPanel>
   1.188 +                </Button>
   1.189 +                <Button Name="ButtonReplyAll"
   1.190 +                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
   1.191 +                    Padding="10,7"
   1.192 +                    Margin="0"
   1.193 +                    BorderBrush="DarkGray"
   1.194 +                    BorderThickness="1"
   1.195 +                    HorizontalContentAlignment="Center"
   1.196 +                    VerticalContentAlignment="Center"
   1.197 +                    Click="ButtonReplyAll_Click">
   1.198 +                    <StackPanel Orientation="Horizontal">
   1.199 +                        <Image Stretch="Uniform"
   1.200 +                           Source="pack://application:,,,/pEp;component/Resources/ImagePreviewReplyAll.png"
   1.201 +                           Margin="0,0,4,0" />
   1.202 +                        <TextBlock VerticalAlignment="Center"
   1.203 +                               FontFamily="Segoe UI"
   1.204 +                               FontSize="12"
   1.205 +                               Text="{x:Static p:Resources.PreviewMessage_ReplyAllText}" />
   1.206 +                    </StackPanel>
   1.207 +                </Button>
   1.208 +                <Button Name="ButtonForward"
   1.209 +                    Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
   1.210 +                    Padding="10,7"
   1.211 +                    Margin="0"
   1.212 +                    BorderBrush="DarkGray"
   1.213 +                    BorderThickness="1"
   1.214 +                    HorizontalContentAlignment="Center"
   1.215 +                    VerticalContentAlignment="Center"
   1.216 +                    Click="ButtonForward_Click">
   1.217 +                    <StackPanel Orientation="Horizontal">
   1.218 +                        <Image Stretch="Uniform"
   1.219 +                           Source="pack://application:,,,/pEp;component/Resources/ImagePreviewForward.png"
   1.220 +                           Margin="0,0,4,0" />
   1.221 +                        <TextBlock VerticalAlignment="Center"
   1.222 +                               FontFamily="Segoe UI"
   1.223 +                               FontSize="12"
   1.224 +                               Text="{x:Static p:Resources.PreviewMessage_ForwardText}" />
   1.225 +                    </StackPanel>
   1.226 +                </Button>
   1.227 +            </StackPanel>
   1.228 +
   1.229 +            <!--'To' recipients-->
   1.230 +            <StackPanel Grid.Row="1" 
   1.231 +                        Grid.Column="1"
   1.232 +                        Orientation="Horizontal">
   1.233 +
   1.234 +                <!--Recipients "To" text-->
   1.235 +                <TextBlock Margin="0,0,10,0"
   1.236 +                           Background="Transparent"
   1.237 +                           FontFamily="Segoe UI"
   1.238 +                           FontSize="11"
   1.239 +                           Foreground="Gray"
   1.240 +                           Text="{x:Static p:Resources.PreviewMessage_ToText}"
   1.241 +                           TextWrapping="NoWrap"
   1.242 +                           HorizontalAlignment="Stretch"
   1.243 +                           VerticalAlignment="Center" />
   1.244 +
   1.245 +                <ItemsControl ItemsSource="{Binding Message.To}"
   1.246 +                              VerticalAlignment="Center">
   1.247 +                    <ItemsControl.ItemsPanel>
   1.248 +                        <ItemsPanelTemplate>
   1.249 +                            <WrapPanel />
   1.250 +                        </ItemsPanelTemplate>
   1.251 +                    </ItemsControl.ItemsPanel>
   1.252 +                    <ItemsControl.ItemTemplate>
   1.253 +                        <DataTemplate>
   1.254 +                            <TextBlock Margin="0,0,10,0"
   1.255 +                                       Background="Transparent"
   1.256 +                                       FontFamily="Segoe UI"
   1.257 +                                       FontSize="11"
   1.258 +                                       Foreground="DarkSlateGray"
   1.259 +                                       Text="{Binding Address}"
   1.260 +                                       TextWrapping="NoWrap"
   1.261 +                                       HorizontalAlignment="Stretch"
   1.262 +                                       VerticalAlignment="Center" />
   1.263 +                        </DataTemplate>
   1.264 +                    </ItemsControl.ItemTemplate>
   1.265 +                </ItemsControl>
   1.266 +            </StackPanel>
   1.267 +
   1.268 +            <!--Date-->
   1.269 +            <TextBox Grid.Row="1"
   1.270                       Grid.Column="2"
   1.271                       Background="Transparent"
   1.272                       BorderThickness="0"
   1.273 @@ -156,171 +227,98 @@
   1.274                       FontSize="11"
   1.275                       Foreground="DarkSlateGray"
   1.276                       TextWrapping="NoWrap"
   1.277 -                     HorizontalAlignment="Stretch"
   1.278 +                     HorizontalAlignment="Right"
   1.279                       VerticalAlignment="Center"
   1.280 -                     Text="{Binding Path='Date', Mode=OneWay}"
   1.281 -                     Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
   1.282 +                     Text="{Binding Path='Date', Mode=OneWay}" />
   1.283  
   1.284 -            <!-- From recipient -->
   1.285 -            <TextBox Grid.Row="1"
   1.286 -                     Grid.Column="2"
   1.287 -                     Background="Transparent"
   1.288 -                     Margin="0,5,0,5"
   1.289 -                     FontFamily="Segoe UI Light"
   1.290 -                     FontSize="22"
   1.291 -                     Foreground="DarkSlateGray"
   1.292 -                     BorderThickness="0"
   1.293 -                     IsReadOnly="True"
   1.294 -                     IsTabStop="False"
   1.295 -                     Text="{Binding Path='FromRecipient', Mode=OneWay}"
   1.296 -                     TextWrapping="NoWrap"
   1.297 -                     HorizontalAlignment="Stretch"
   1.298 -                     VerticalAlignment="Center"
   1.299 -                     Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
   1.300  
   1.301 -            <!-- Subject -->
   1.302 -            <TextBox Grid.Row="2"
   1.303 -                     Grid.Column="2"
   1.304 -                     Background="Transparent"
   1.305 -                     BorderThickness="0"
   1.306 -                     IsReadOnly="True"
   1.307 -                     IsTabStop="False"
   1.308 -                     FontFamily="Segoe UI Semibold"
   1.309 -                     FontSize="15"
   1.310 -                     Text="{Binding Path='Message.ShortMsg', Mode=OneWay}"
   1.311 -                     TextWrapping="NoWrap"
   1.312 -                     HorizontalAlignment="Stretch"
   1.313 -                     VerticalAlignment="Center"
   1.314 -                     Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
   1.315 +            <!--'Cc' recipients-->
   1.316 +            <StackPanel Grid.Row="2" 
   1.317 +                        Grid.Column="1"
   1.318 +                        Orientation="Horizontal"
   1.319 +                        Visibility="{Binding Message.Cc, Converter={StaticResource IsListEmptyToInvertBool}}">
   1.320  
   1.321 +                <!--Recipients "Cc" text-->
   1.322 +                <TextBlock Margin="0,0,10,0"
   1.323 +                           Background="Transparent"
   1.324 +                           FontFamily="Segoe UI"
   1.325 +                           FontSize="11"
   1.326 +                           Foreground="Gray"
   1.327 +                           Text="{x:Static p:Resources.PreviewMessage_CcText}"
   1.328 +                           TextWrapping="NoWrap"
   1.329 +                           HorizontalAlignment="Stretch"
   1.330 +                           VerticalAlignment="Center" />
   1.331 +
   1.332 +                <ItemsControl ItemsSource="{Binding Message.Cc}">
   1.333 +                    <ItemsControl.ItemsPanel>
   1.334 +                        <ItemsPanelTemplate>
   1.335 +                            <WrapPanel />
   1.336 +                        </ItemsPanelTemplate>
   1.337 +                    </ItemsControl.ItemsPanel>
   1.338 +                    <ItemsControl.ItemTemplate>
   1.339 +                        <DataTemplate>
   1.340 +                            <TextBlock Margin="0,0,10,0"
   1.341 +                           Background="Transparent"
   1.342 +                           FontFamily="Segoe UI"
   1.343 +                           FontSize="11"
   1.344 +                           Foreground="DarkSlateGray"
   1.345 +                           Text="{Binding Address}"
   1.346 +                           TextWrapping="NoWrap"
   1.347 +                           HorizontalAlignment="Stretch"
   1.348 +                           VerticalAlignment="Center" />
   1.349 +                        </DataTemplate>
   1.350 +                    </ItemsControl.ItemTemplate>
   1.351 +                </ItemsControl>
   1.352 +            </StackPanel>
   1.353          </Grid>
   1.354  
   1.355 -        <Grid Grid.Row="3"
   1.356 -              Grid.Column="0"
   1.357 -              Grid.ColumnSpan="3"
   1.358 -              Margin="0,5,0,5">
   1.359 -            <Grid.ColumnDefinitions>
   1.360 -                <ColumnDefinition Width="Auto" />
   1.361 -                <ColumnDefinition Width="Auto" />
   1.362 -            </Grid.ColumnDefinitions>
   1.363 -
   1.364 -            <!--Recipients "To" text-->
   1.365 -            <TextBlock Grid.Column="0"
   1.366 -                       Margin="0,0,10,0"
   1.367 -                       Background="Transparent"
   1.368 -                       FontFamily="Segoe UI"
   1.369 -                       FontSize="11"
   1.370 -                       Foreground="DarkSlateGray"
   1.371 -                       Text="{x:Static p:Resources.PreviewMessage_ToText}"
   1.372 -                       TextWrapping="NoWrap"
   1.373 -                       HorizontalAlignment="Stretch"
   1.374 -                       VerticalAlignment="Center"
   1.375 -                       Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
   1.376 -
   1.377 -            <!--To Recipients-->
   1.378 -            <TextBlock Grid.Column="1"
   1.379 -                       Background="Transparent"
   1.380 -                       FontFamily="Segoe UI"
   1.381 -                       FontSize="11"
   1.382 -                       Foreground="DarkSlateGray"
   1.383 -                       Text="{Binding Path='ToRecipients', Mode=OneWay}"
   1.384 -                       TextWrapping="NoWrap"
   1.385 -                       HorizontalAlignment="Stretch"
   1.386 -                       VerticalAlignment="Center" />
   1.387 -        </Grid>
   1.388 -
   1.389 -        <Grid Grid.Row="4"
   1.390 -              Grid.Column="0"
   1.391 -              Grid.ColumnSpan="3"
   1.392 -              Margin="0,5,0,5">
   1.393 -            <Grid.ColumnDefinitions>
   1.394 -                <ColumnDefinition Width="Auto" />
   1.395 -                <ColumnDefinition Width="Auto" />
   1.396 -            </Grid.ColumnDefinitions>
   1.397 -
   1.398 -            <!--Recipients "Cc" text-->
   1.399 -            <TextBlock Grid.Column="0"
   1.400 -                       Margin="0,0,10,0"
   1.401 -                       Background="Transparent"
   1.402 -                       FontFamily="Segoe UI"
   1.403 -                       FontSize="11"
   1.404 -                       Foreground="DarkSlateGray"
   1.405 -                       Text="{x:Static p:Resources.PreviewMessage_CcText}"
   1.406 -                       TextWrapping="NoWrap"
   1.407 -                       HorizontalAlignment="Stretch"
   1.408 -                       VerticalAlignment="Center"
   1.409 -                       Visibility="{Binding Path=CcRecipients, Mode=OneWay, Converter={StaticResource IsStringNotEmptyToVisibility}}" />
   1.410 -
   1.411 -            <!--Cc Recipients-->
   1.412 -            <TextBlock Grid.Column="1"
   1.413 -                       Background="Transparent"
   1.414 -                       FontFamily="Segoe UI"
   1.415 -                       FontSize="11"
   1.416 -                       Foreground="DarkSlateGray"
   1.417 -                       Text="{Binding Path='CcRecipients', Mode=OneWay}"
   1.418 -                       TextWrapping="NoWrap"
   1.419 -                       HorizontalAlignment="Stretch"
   1.420 -                       VerticalAlignment="Center"
   1.421 -                       Visibility="{Binding Path=CcRecipients, Mode=OneWay, Converter={StaticResource IsStringNotEmptyToVisibility}}" />
   1.422 -        </Grid>
   1.423 -
   1.424 -        <!-- Attachments -->
   1.425 -        <Grid Grid.Row="5">
   1.426 -            <Grid.RowDefinitions>
   1.427 -                <RowDefinition Height="Auto" />
   1.428 -                <RowDefinition Height="Auto" />
   1.429 -                <RowDefinition Height="Auto" />
   1.430 -            </Grid.RowDefinitions>
   1.431 -            <Separator Grid.Row="0"
   1.432 -                       Margin="0,3,0,3"
   1.433 -                       Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
   1.434 -            <ItemsControl Grid.Row="1"
   1.435 -                          HorizontalAlignment="Stretch"
   1.436 +        <!--Attachments-->
   1.437 +        <ItemsControl  HorizontalAlignment="Stretch"
   1.438                            VerticalAlignment="Top"
   1.439 -                          ItemsSource="{Binding Path='Message.Attachments', Mode=OneWay}">
   1.440 -                <ItemsControl.Visibility>
   1.441 -                    <MultiBinding Converter="{StaticResource MultiBooleanToVisibility}">
   1.442 -                        <Binding Path="Message.Attachments"
   1.443 +                          ItemsSource="{Binding Message.Attachments, Mode=OneWay}">
   1.444 +            <ItemsControl.Visibility>
   1.445 +                <MultiBinding Converter="{StaticResource MultiBooleanToVisibility}">
   1.446 +                    <Binding Path="Message.Attachments"
   1.447                                   Mode="OneWay"
   1.448                                   Converter="{StaticResource IsListEmptyToInvertBool}" />
   1.449 -                        <Binding Path="Message.Attachments"
   1.450 +                    <Binding Path="Message.Attachments"
   1.451                                   Mode="OneWay"
   1.452                                   Converter="{StaticResource HasNonInlineAttachments}" />
   1.453 -                        <Binding Path="IsNoteModeEnabled"
   1.454 +                    <Binding Path="IsNoteModeEnabled"
   1.455                                   Mode="OneWay"
   1.456                                   Converter="{StaticResource InvertBool}" />
   1.457 -                    </MultiBinding>
   1.458 -                </ItemsControl.Visibility>
   1.459 -                <ItemsControl.ItemTemplate>
   1.460 -                    <DataTemplate>
   1.461 -                        <StackPanel Visibility="{Binding Path=ContentId, Converter={StaticResource IsStringEmptyToVisibility}}">
   1.462 -                            <Border BorderBrush="DarkGray"
   1.463 +                </MultiBinding>
   1.464 +            </ItemsControl.Visibility>
   1.465 +            <ItemsControl.ItemTemplate>
   1.466 +                <DataTemplate>
   1.467 +                    <StackPanel Visibility="{Binding Path=ContentId, Converter={StaticResource IsStringEmptyToVisibility}}">
   1.468 +                        <Border BorderBrush="DarkGray"
   1.469                                      BorderThickness="1"
   1.470                                      Height="35"
   1.471                                      Width="180"
   1.472                                      Margin="2">
   1.473 -                                <Grid>
   1.474 -                                    <Grid.ColumnDefinitions>
   1.475 -                                        <ColumnDefinition Width="*" />
   1.476 -                                        <ColumnDefinition Width="20" />
   1.477 -                                    </Grid.ColumnDefinitions>
   1.478 -                                    <Grid.RowDefinitions>
   1.479 -                                        <RowDefinition Height="*" />
   1.480 -                                    </Grid.RowDefinitions>
   1.481 -                                    <ContentControl MouseDoubleClick="ButtonAttachment_DoubleClick">
   1.482 -                                        <Grid Grid.Column="0"
   1.483 +                            <Grid>
   1.484 +                                <Grid.ColumnDefinitions>
   1.485 +                                    <ColumnDefinition Width="*" />
   1.486 +                                    <ColumnDefinition Width="20" />
   1.487 +                                </Grid.ColumnDefinitions>
   1.488 +                                <Grid.RowDefinitions>
   1.489 +                                    <RowDefinition Height="*" />
   1.490 +                                </Grid.RowDefinitions>
   1.491 +                                <ContentControl MouseDoubleClick="ButtonAttachment_DoubleClick">
   1.492 +                                    <Grid Grid.Column="0"
   1.493                                                Grid.Row="0">
   1.494 -                                            <Grid.ColumnDefinitions>
   1.495 -                                                <ColumnDefinition Width="30" />
   1.496 -                                                <ColumnDefinition Width="*" />
   1.497 -                                            </Grid.ColumnDefinitions>
   1.498 -                                            <Grid.RowDefinitions>
   1.499 -                                                <RowDefinition Height="*" />
   1.500 -                                                <RowDefinition Height="*" />
   1.501 -                                            </Grid.RowDefinitions>
   1.502 +                                        <Grid.ColumnDefinitions>
   1.503 +                                            <ColumnDefinition Width="30" />
   1.504 +                                            <ColumnDefinition Width="*" />
   1.505 +                                        </Grid.ColumnDefinitions>
   1.506 +                                        <Grid.RowDefinitions>
   1.507 +                                            <RowDefinition Height="*" />
   1.508 +                                            <RowDefinition Height="*" />
   1.509 +                                        </Grid.RowDefinitions>
   1.510  
   1.511 -                                            <!-- File icon -->
   1.512 -                                            <Image Grid.Column="0"
   1.513 +                                        <!-- File icon -->
   1.514 +                                        <Image Grid.Column="0"
   1.515                                                     Grid.Row="0"
   1.516                                                     Grid.RowSpan="2"
   1.517                                                     Stretch="Uniform"
   1.518 @@ -329,27 +327,27 @@
   1.519                                                     VerticalAlignment="Stretch"
   1.520                                                     Margin="5" />
   1.521  
   1.522 -                                            <!-- File name and size -->
   1.523 -                                            <TextBlock Grid.Column="1"
   1.524 +                                        <!-- File name and size -->
   1.525 +                                        <TextBlock Grid.Column="1"
   1.526                                                         Grid.Row="0"
   1.527                                                         HorizontalAlignment="Stretch"
   1.528                                                         VerticalAlignment="Bottom"
   1.529                                                         Text="{Binding Path='FileName', Mode=OneWay}" />
   1.530 -                                            <TextBlock Grid.Column="1"
   1.531 +                                        <TextBlock Grid.Column="1"
   1.532                                                         Grid.Row="1"
   1.533                                                         HorizontalAlignment="Stretch"
   1.534                                                         VerticalAlignment="Center"
   1.535                                                         Text="{Binding Path='FileSizeString', Mode=OneWay}" />
   1.536 -                                        </Grid>
   1.537 -                                    </ContentControl>
   1.538 -                                    <Grid Grid.Column="1"
   1.539 +                                    </Grid>
   1.540 +                                </ContentControl>
   1.541 +                                <Grid Grid.Column="1"
   1.542                                            Grid.Row="0">
   1.543 -                                        <!-- Attachment actions -->
   1.544 -                                        <!-- The button needs to pass both the PEPAttachment and DataContext to the ContextMenu
   1.545 +                                    <!-- Attachment actions -->
   1.546 +                                    <!-- The button needs to pass both the PEPAttachment and DataContext to the ContextMenu
   1.547                                       This is a little tricky because the ContextMenu is outside of the visual tree. 
   1.548                                       In order to do this, the Button Tag is set to the DataContext and the Tag is the UserControl DataContext.
   1.549                                       You cannot Set the Button DataContext to the UserControl DataContext or the PEPAttachment is lost. -->
   1.550 -                                        <Button Name="ButtonAttachment"
   1.551 +                                    <Button Name="ButtonAttachment"
   1.552                                                  Grid.Column="0"
   1.553                                                  Grid.Row="0"
   1.554                                                  Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
   1.555 @@ -362,58 +360,39 @@
   1.556                                                  Tag="{Binding Path='DataContext', RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
   1.557                                                  DataContext="{Binding Path=.}"
   1.558                                                  Click="ButtonAttachment_Click">
   1.559 -                                            <Button.ContextMenu>
   1.560 -                                                <ContextMenu Name="ContextMenuAttachment"
   1.561 +                                        <Button.ContextMenu>
   1.562 +                                            <ContextMenu Name="ContextMenuAttachment"
   1.563                                                               Placement="Bottom"
   1.564                                                               DataContext="{Binding Path='PlacementTarget', RelativeSource={RelativeSource Self}}">
   1.565 -                                                    <MenuItem Header='{x:Static p:Resources.PreviewMessage_OpenText}'
   1.566 +                                                <MenuItem Header='{x:Static p:Resources.PreviewMessage_OpenText}'
   1.567                                                                Tag="{Binding Path='DataContext'}"
   1.568                                                                Click="MenuItemOpen_Click" />
   1.569 -                                                    <Separator />
   1.570 -                                                    <MenuItem Header='{x:Static p:Resources.PreviewMessage_SaveAsText}'
   1.571 +                                                <Separator />
   1.572 +                                                <MenuItem Header='{x:Static p:Resources.PreviewMessage_SaveAsText}'
   1.573                                                                Tag="{Binding Path='DataContext'}"
   1.574                                                                Click="MenuItemSaveAs_Click" />
   1.575 -                                                </ContextMenu>
   1.576 -                                            </Button.ContextMenu>
   1.577 -                                            <TextBlock Text="▼"
   1.578 +                                            </ContextMenu>
   1.579 +                                        </Button.ContextMenu>
   1.580 +                                        <TextBlock Text="▼"
   1.581                                                         TextAlignment="Center"
   1.582                                                         FontFamily="Arial"
   1.583                                                         FontSize="9"
   1.584                                                         Foreground="DarkGray" />
   1.585 -                                        </Button>
   1.586 -                                    </Grid>
   1.587 +                                    </Button>
   1.588                                  </Grid>
   1.589 -                            </Border>
   1.590 -                        </StackPanel>
   1.591 -                    </DataTemplate>
   1.592 -                </ItemsControl.ItemTemplate>
   1.593 -                <ItemsControl.ItemsPanel>
   1.594 -                    <ItemsPanelTemplate>
   1.595 -                        <WrapPanel Orientation="Horizontal" />
   1.596 -                    </ItemsPanelTemplate>
   1.597 -                </ItemsControl.ItemsPanel>
   1.598 -            </ItemsControl>
   1.599 -            <Separator Grid.Row="2"
   1.600 -                       Margin="0,3,0,3"
   1.601 -                       Foreground="DarkSlateGray">
   1.602 -                <Separator.Visibility>
   1.603 -                    <MultiBinding Converter="{StaticResource MultiBooleanToVisibility}">
   1.604 -                        <Binding Path="Message.Attachments"
   1.605 -                                 Mode="OneWay"
   1.606 -                                 Converter="{StaticResource IsListEmptyToInvertBool}" />
   1.607 -                        <Binding Path="Message.Attachments"
   1.608 -                                 Mode="OneWay"
   1.609 -                                 Converter="{StaticResource HasNonInlineAttachments}" />
   1.610 -                        <Binding Path="IsNoteModeEnabled"
   1.611 -                                 Mode="OneWay"
   1.612 -                                 Converter="{StaticResource InvertBool}" />
   1.613 -                    </MultiBinding>
   1.614 -                </Separator.Visibility>
   1.615 -            </Separator>
   1.616 -        </Grid>
   1.617 +                            </Grid>
   1.618 +                        </Border>
   1.619 +                    </StackPanel>
   1.620 +                </DataTemplate>
   1.621 +            </ItemsControl.ItemTemplate>
   1.622 +            <ItemsControl.ItemsPanel>
   1.623 +                <ItemsPanelTemplate>
   1.624 +                    <WrapPanel Orientation="Horizontal" />
   1.625 +                </ItemsPanelTemplate>
   1.626 +            </ItemsControl.ItemsPanel>
   1.627 +        </ItemsControl>
   1.628  
   1.629          <TextBlock x:Name="RemoteImagesWarning"
   1.630 -                   Grid.Row="6"
   1.631                     Visibility="Collapsed"
   1.632                     Padding="5"
   1.633                     Text="{x:Static p:Resources.PreviewMessage_RemoteImagesWarningText}"
   1.634 @@ -434,11 +413,11 @@
   1.635          </TextBlock>
   1.636  
   1.637          <WebBrowser x:Name="WebBrowser"
   1.638 -                    Grid.Row="7"
   1.639                      HorizontalAlignment="Stretch"
   1.640                      VerticalAlignment="Stretch"
   1.641                      Margin="0,10,0,0"
   1.642                      Navigating="WebBrowser_Navigating"
   1.643                      Visibility="{Binding Path='IsNoteModeEnabled', Mode=OneWay, Converter={StaticResource InvertBoolToVisibility}}" />
   1.644 -    </Grid>
   1.645 +
   1.646 +    </StackPanel>
   1.647  </UserControl>
   1.648 \ No newline at end of file
     2.1 --- a/UI/FormControlPreviewMessage.xaml.cs	Wed Aug 07 09:47:17 2019 +0200
     2.2 +++ b/UI/FormControlPreviewMessage.xaml.cs	Thu Aug 08 12:31:10 2019 +0200
     2.3 @@ -7,6 +7,7 @@
     2.4  using System.Text.RegularExpressions;
     2.5  using System.Windows;
     2.6  using System.Windows.Controls;
     2.7 +using System.Windows.Media;
     2.8  using Outlook = Microsoft.Office.Interop.Outlook;
     2.9  
    2.10  namespace pEp.UI
    2.11 @@ -116,8 +117,6 @@
    2.12                  this.ButtonReply = null;
    2.13                  this.ButtonReplyAll = null;
    2.14                  this.displayState = null;
    2.15 -                this.displayState = null;
    2.16 -                this.GridLayoutRoot = null;
    2.17                  this.RemoteImagesWarning = null;
    2.18  
    2.19                  this.DeleteTempHtmlFiles();
    2.20 @@ -414,7 +413,6 @@
    2.21              }
    2.22  
    2.23              this.PropertyChanged?.Invoke(this, e);
    2.24 -            return;
    2.25          }
    2.26  
    2.27          /// <summary>
    2.28 @@ -423,7 +421,6 @@
    2.29          private void ButtonForward_Click(object sender, RoutedEventArgs e)
    2.30          {
    2.31              this.Forward?.Invoke(this, new RoutedEventArgs());
    2.32 -            return;
    2.33          }
    2.34  
    2.35          /// <summary>
    2.36 @@ -432,7 +429,6 @@
    2.37          private void ButtonReply_Click(object sender, RoutedEventArgs e)
    2.38          {
    2.39              this.Reply?.Invoke(this, new RoutedEventArgs());
    2.40 -            return;
    2.41          }
    2.42  
    2.43          /// <summary>
    2.44 @@ -455,8 +451,6 @@
    2.45              menu.PlacementTarget = button;
    2.46              menu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
    2.47              menu.IsOpen = true;
    2.48 -
    2.49 -            return;
    2.50          }
    2.51  
    2.52          /// <summary>
    2.53 @@ -470,9 +464,8 @@
    2.54              {
    2.55                  ((PEPAttachment)contentControl.DataContext).Open();
    2.56              }
    2.57 -            return;
    2.58 +        }
    2.59  
    2.60 -        }
    2.61          /// <summary>
    2.62          /// Event handler for when the Open context menu item is clicked for an attachment.
    2.63          /// </summary>
    2.64 @@ -484,8 +477,6 @@
    2.65              {
    2.66                  ((PEPAttachment)menuItem.Tag).Open();
    2.67              }
    2.68 -
    2.69 -            return;
    2.70          }
    2.71  
    2.72          /// <summary>
    2.73 @@ -580,12 +571,11 @@
    2.74              /// </summary>
    2.75              public event PropertyChangedEventHandler PropertyChanged;
    2.76  
    2.77 -            private string     _CcRecipients;
    2.78 -            private string     _Date;
    2.79 -            private string     _FromRecipient;
    2.80 -            private bool       _IsNoteModeEnabled;
    2.81 +            private SolidColorBrush _ContactIconBackground;
    2.82 +            private string _Date;
    2.83 +            private string _FromRecipient;
    2.84 +            private bool _IsNoteModeEnabled;
    2.85              private PEPMessage _Message;
    2.86 -            private string     _ToRecipients;
    2.87  
    2.88              /**************************************************************
    2.89               * 
    2.90 @@ -608,12 +598,11 @@
    2.91               *************************************************************/
    2.92  
    2.93              /// <summary>
    2.94 -            /// Gets the formatted Cc recipients string of the message.
    2.95 -            /// This is a dependent property set through Message.
    2.96 +            /// Gets the background color of the Contact icon.
    2.97              /// </summary>
    2.98 -            public string CcRecipients
    2.99 +            public SolidColorBrush ContactIconBackground
   2.100              {
   2.101 -                get { return this._CcRecipients; }
   2.102 +                get { return this._ContactIconBackground; }
   2.103              }
   2.104  
   2.105              /// <summary>
   2.106 @@ -622,7 +611,7 @@
   2.107              /// </summary>
   2.108              public string Date
   2.109              {
   2.110 -                get { return (this._Date); }
   2.111 +                get { return this._Date; }
   2.112              }
   2.113  
   2.114              /// <summary>
   2.115 @@ -630,7 +619,10 @@
   2.116              /// </summary>
   2.117              public string FromRecipient
   2.118              {
   2.119 -                get { return (this._FromRecipient); }
   2.120 +                get
   2.121 +                {
   2.122 +                    return (this._FromRecipient);
   2.123 +                }
   2.124              }
   2.125  
   2.126              /// <summary>
   2.127 @@ -669,15 +661,6 @@
   2.128              /// </summary>
   2.129              public string OriginalEntryId { get; set; } = null;
   2.130  
   2.131 -            /// <summary>
   2.132 -            /// Gets the formatted To recipients string of the message.
   2.133 -            /// This is a dependent property set through Message.
   2.134 -            /// </summary>
   2.135 -            public string ToRecipients
   2.136 -            {
   2.137 -                get { return (this._ToRecipients); }
   2.138 -            }
   2.139 -
   2.140              /**************************************************************
   2.141               * 
   2.142               * Methods
   2.143 @@ -691,7 +674,6 @@
   2.144              private void RaisePropertyChangedEvent(string propertyName)
   2.145              {
   2.146                  this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
   2.147 -                return;
   2.148              }
   2.149  
   2.150              /// <summary>
   2.151 @@ -708,8 +690,6 @@
   2.152  
   2.153                  // Set dependent properties -- raises own events
   2.154                  this.CalcDependentProperties();
   2.155 -
   2.156 -                return;
   2.157              }
   2.158  
   2.159              /// <summary>
   2.160 @@ -718,59 +698,17 @@
   2.161              /// </summary>
   2.162              private void CalcDependentProperties()
   2.163              {
   2.164 -                string recipientText = string.Empty;
   2.165 -
   2.166                  // Date
   2.167                  this._Date = this._Message?.SentOn?.ToString("g", Globals.ThisAddIn.GetActiveUICulture());
   2.168                  this.RaisePropertyChangedEvent(nameof(this.Date));
   2.169  
   2.170 -                // Recipients
   2.171 -                this._ToRecipients = null;
   2.172 -                this._CcRecipients = null;
   2.173 +                // From recipient
   2.174 +                this._FromRecipient = this._Message?.From?.UserName ?? this.Message?.From?.Address;
   2.175 +                this.RaisePropertyChangedEvent(nameof(this.FromRecipient));
   2.176  
   2.177 -                // To recipients
   2.178 -                for (int i = 0; i < this._Message?.To?.Count; i++)
   2.179 -                {
   2.180 -                    if (i == (this._Message.To.Count - 1))
   2.181 -                    {
   2.182 -                        recipientText += this._Message.To[i].ToDisplayString();
   2.183 -                    }
   2.184 -                    else
   2.185 -                    {
   2.186 -                        recipientText += this._Message.To[i].ToDisplayString() + "; ";
   2.187 -                    }
   2.188 -                }
   2.189 -                this._ToRecipients = recipientText;
   2.190 -                this.RaisePropertyChangedEvent(nameof(this.ToRecipients));
   2.191 -
   2.192 -                // Add any Cc (skip Bcc)
   2.193 -                recipientText = string.Empty;
   2.194 -                for (int i = 0; i < this._Message?.Cc?.Count; i++)
   2.195 -                {
   2.196 -                    if (i == (this._Message.Cc.Count - 1))
   2.197 -                    {
   2.198 -                        recipientText += this._Message.Cc[i].ToDisplayString();
   2.199 -                    }
   2.200 -                    else
   2.201 -                    {
   2.202 -                        recipientText += this._Message.Cc[i].ToDisplayString() + "; ";
   2.203 -                    }
   2.204 -                }
   2.205 -
   2.206 -                this._CcRecipients = recipientText;
   2.207 -                this.RaisePropertyChangedEvent(nameof(this.CcRecipients));
   2.208 -
   2.209 -                // From recipient
   2.210 -                this._FromRecipient = this._Message?.From?.UserName;
   2.211 -                if (string.IsNullOrEmpty(this._FromRecipient))
   2.212 -                {
   2.213 -                    this._FromRecipient = this._Message?.From?.Address;
   2.214 -                }
   2.215 -                else
   2.216 -                {
   2.217 -                    this._FromRecipient += string.Concat(" <", this._Message?.From?.Address, ">");
   2.218 -                }
   2.219 -                this.RaisePropertyChangedEvent(nameof(this.FromRecipient));
   2.220 +                // Contact Image color
   2.221 +                this._ContactIconBackground = (SolidColorBrush)new BrushConverter().ConvertFromString("#03AA4B");
   2.222 +                this.RaisePropertyChangedEvent(nameof(this.ContactIconBackground));
   2.223              }
   2.224  
   2.225              /// <summary>
   2.226 @@ -779,26 +717,15 @@
   2.227              /// </summary>
   2.228              public void SetNote(string note = null)
   2.229              {
   2.230 -                /* Ignore the following which aren't needed
   2.231 -                 *  - ForwardText
   2.232 -                 *  - OpenText
   2.233 -                 *  - PreviewText
   2.234 -                 *  - ReplyAllText
   2.235 -                 *  - ReplyText
   2.236 -                 *  - SaveAsText
   2.237 -                 */
   2.238 -
   2.239                  this._Date = null;
   2.240                  this._IsNoteModeEnabled = true;
   2.241                  this._Message = null;
   2.242 -                this._ToRecipients = note;
   2.243 +                this._FromRecipient = note;
   2.244  
   2.245                  this.RaisePropertyChangedEvent(nameof(this.Date));
   2.246 +                this.RaisePropertyChangedEvent(nameof(this.FromRecipient));
   2.247                  this.RaisePropertyChangedEvent(nameof(this.IsNoteModeEnabled));
   2.248                  this.RaisePropertyChangedEvent(nameof(this.Message));
   2.249 -                this.RaisePropertyChangedEvent(nameof(this.ToRecipients));
   2.250 -
   2.251 -                return;
   2.252              }
   2.253  
   2.254              /// <summary>