SmartPanel.xaml 47.1 KB
Newer Older
Nicolas Jager's avatar
Nicolas Jager committed
1 2 3
<!-- **********************************************************************
* Copyright (C) 2016 by Savoir-faire Linux                                *
* Author: Jäger Nicolas<nicolas.jager@savoirfairelinux.com>               *
4
* Author: Traczyk Andreas<andreas.traczyk@savoirfairelinux.com>           *
Nicolas Jager's avatar
Nicolas Jager committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
*                                                                         *
* This program is free software; you can redistribute it and/or modify    *
* it under the terms of the GNU General Public License as published by    *
* the Free Software Foundation; either version 3 of the License, or       *
* (at your option) any later version.                                     *
*                                                                         *
* This program is distributed in the hope that it will be useful,         *
* but WITHOUT ANY WARRANTY; without even the implied warranty of          *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
* GNU General Public License for more details.                            *
*                                                                         *
* You should have received a copy of the GNU General Public License       *
* along with this program.  If not, see <http://www.gnu.org/licenses/> .  *
*********************************************************************** -->
<Page x:Class="RingClientUWP.Views.SmartPanel"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:RingClientUWP"
23
      xmlns:controls="using:RingClientUWP.Controls"
Nicolas Jager's avatar
Nicolas Jager committed
24
      xmlns:views="using:RingClientUWP.Views"
Nicolas Jager's avatar
Nicolas Jager committed
25 26
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
27
      NavigationCacheMode="Enabled"
Nicolas Jager's avatar
Nicolas Jager committed
28 29
      mc:Ignorable="d">

Nicolas Jager's avatar
Nicolas Jager committed
30
    <Page.Resources>
Nicolas Jager's avatar
Nicolas Jager committed
31 32 33 34 35
        <!-- converters -->
        <views:NewMessageBubleNotification x:Key="_NewMessageBubleNotification_" />
        <views:IncomingVisibility x:Key="_IncomingVisibility_" />
        <views:OutGoingVisibility x:Key="_OutGoingVisibility_" />
        <views:HasAnActiveCall x:Key="_HasAnActiveCall_" />
36 37
        <views:AccountTypeToSourceImage x:Key="_AccountTypeToSourceImage_" />
        <views:AccountSelectedToVisibility x:Key="_AccountSelectedToVisibility_" />
38
        <views:CollapseEmptyString x:Key="_CollapseEmptyString_" />
Nicolas Jager's avatar
Nicolas Jager committed
39

40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
        <Style x:Key="addContactTextBoxStyle"
           TargetType="TextBox">
            <Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}"/>
            <Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="Background" Value="white"/>
            <Setter Property="BorderBrush" Value="Red"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
            <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
            <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden"/>
            <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
            <Setter Property="Padding" Value="4,4"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Grid>
                            <Grid.Resources>
                                <Style x:Name="DeleteButtonStyle" TargetType="Button">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Button">
                                                <Grid x:Name="ButtonLayoutGrid"
                                                  BorderThickness="5"
                                                  Background="Yellow">
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Grid.Resources>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border x:Name="BackgroundElement"
                                    Grid.Row="1"
                                    Background="{TemplateBinding Background}"
                                    Margin="5"
                                    Opacity="1"
                                    Grid.ColumnSpan="2"
                                    Grid.RowSpan="1"/>
                            <ScrollViewer x:Name="ContentElement"
                      Grid.Row="1"
                      HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
                      HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                      VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
                      VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                      IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
                      IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
                      IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
                      Margin="5"
                      Padding="{TemplateBinding Padding}"
                      IsTabStop="False"
                      AutomationProperties.AccessibilityView="Raw"
                      ZoomMode="Disabled"/>

                            <Button x:Name="DeleteButton"
                                    Background="Transparent"
                                    Grid.Row="1"
                                    FontFamily="Segoe MDL2 Assets"
                                    Foreground="LightBlue"
                                    Content="&#xE1E2;"
                                    Click="_ringTxtBx__Click"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Margin="{ThemeResource HelperButtonThemePadding}"
                                    IsTabStop="False"
                                    Grid.Column="1"
                                    Visibility="Visible"
                                    FontSize="20"
                                    MinWidth="34"
                                    VerticalAlignment="Stretch"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
Nicolas Jager's avatar
Nicolas Jager committed
124 125 126 127
        <!-- template for contacts. -->
        <DataTemplate x:Key="ContactTemplate"
                      x:DataType="local:Contact">
            <Grid>
128 129 130
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="310"/>
                </Grid.ColumnDefinitions>
Nicolas Jager's avatar
Nicolas Jager committed
131 132 133 134
                <Grid.RowDefinitions>
                    <RowDefinition Height="60"/>
                    <!-- use the height of _contactBar_ to make it visible or collapsed. -->
                    <RowDefinition x:Name="_contactBar_"
135
                                   Height="{x:Bind _contactBarHeight, Mode=OneWay}"/>
Nicolas Jager's avatar
Nicolas Jager committed
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"/>
                        <ColumnDefinition Width="*"
                                          MinWidth="200"/>
                    </Grid.ColumnDefinitions>
                    <Image x:Name="_contactAvatar_"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           Grid.Column="0"
                           Width="55"
                           Height="55"
                           Source="Assets\TESTS\contactAvatar.png"/>
                    <!-- visual notifications. -->
                    <Border x:Name="_visualNotificationVideoChat_"
                            Visibility="Collapsed"
                            Style="{StaticResource BorderStyle1}">
                        <TextBlock Text="&#xE8AA;"
                                   Style="{StaticResource TextSegoeStyle1}"/>
                        <Border.RenderTransform>
                            <TranslateTransform X="17" Y="-14"/>
                        </Border.RenderTransform>
                    </Border>
160 161 162 163 164 165
                    <Grid Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="30"/>
                            <RowDefinition Height="30"/>
                        </Grid.RowDefinitions>
                        <!-- name of the contact. -->
166 167 168 169
                        <TextBlock  x:Name="_contactName_"
                                    Grid.Row="0"
                                    Text="{x:Bind name_}"
                                    TextTrimming="CharacterEllipsis">
170 171
                        </TextBlock>
                    </Grid>
Nicolas Jager's avatar
Nicolas Jager committed
172 173 174
                </Grid>
            </Grid>
        </DataTemplate>
Nicolas Jager's avatar
Nicolas Jager committed
175 176 177
        <!-- template for AccountListItems. -->
        <DataTemplate x:Key="AccountListItemsTemplate"
                      x:DataType="controls:AccountListItem">
178
            <Grid Margin="0,10">
Nicolas Jager's avatar
Nicolas Jager committed
179
                <Grid.ColumnDefinitions>
180 181
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="290"/>
Nicolas Jager's avatar
Nicolas Jager committed
182
                </Grid.ColumnDefinitions>
183 184 185 186 187 188
                <Border Grid.Column="0"
                        Margin="5,0"
                        Style="{StaticResource BorderStyle3}">
                    <Image x:Name="_AccountTypeIcon_"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center"
Nicolas Jager's avatar
Nicolas Jager committed
189
                           Source="{x:Bind  _account.accountType_, Converter={StaticResource _AccountTypeToSourceImage_}, Mode=OneWay}"/>
190 191 192 193 194 195
                </Border>
                <Button x:Name="_editAccountMenuButton_"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Top"
                        Content="&#xE104;"
                        FontFamily="Segoe MDL2 Assets"
196
                        Click="_editAccountMenuButton__Click"
197 198 199 200 201 202 203 204 205 206 207 208
                        FontSize="20"
                        Foreground="White"
                        Background="Transparent"
                        Visibility="{x:Bind _isSelected, Converter={StaticResource _AccountSelectedToVisibility_}, Mode=OneWay}"
                        Grid.Column="1">
                    <Button.RenderTransform>
                        <TranslateTransform X="-5" Y="-5"/>
                    </Button.RenderTransform>
                </Button>
                <StackPanel Grid.Column="1">
                    <TextBlock x:Name="_accountName_"
                           Style="{StaticResource TextStyle5}"
209
                           Text="{x:Bind  _account.name_, Mode=OneWay}"/>
210
                    <TextBlock x:Name="_ringID_"
211 212 213 214 215 216 217 218 219
                               Grid.ColumnSpan="2"
                               Style="{StaticResource TextStyle6}"
                               Visibility="{x:Bind  _account.ringID_, Converter={StaticResource _CollapseEmptyString_}, Mode=OneWay}"
                               Text="{x:Bind  _account.ringID_, Mode=OneWay}"/>
                    <TextBlock x:Name="_sipUsername_"
                               Grid.ColumnSpan="2"
                               Visibility="{x:Bind  _account._sipUsername, Converter={StaticResource _CollapseEmptyString_}, Mode=OneWay}"
                               Style="{StaticResource TextStyle6}"
                               Text="{x:Bind  _account._sipUsername, Mode=OneWay}"/>
220
                </StackPanel>
Nicolas Jager's avatar
Nicolas Jager committed
221 222
            </Grid>
        </DataTemplate>
223 224 225
        <!-- template for smartpanelitems. -->
        <DataTemplate x:Key="SmartPanelItemsTemplate"
                      x:DataType="controls:SmartPanelItem">
226
            <Grid PointerEntered="Grid_PointerEntered" PointerExited="Grid_PointerExited" PointerMoved="Grid_PointerMoved">
227
                <Grid.RowDefinitions>
Nicolas Jager's avatar
Nicolas Jager committed
228 229 230
                    <!-- row definition for the contact. -->
                    <RowDefinition Height="auto"/>
                    <!-- row definition for the incoming call bar. -->
231
                    <RowDefinition Height="auto"/>
Nicolas Jager's avatar
Nicolas Jager committed
232
                    <!-- row definition for the outgoing call bar. -->
233 234
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
Nicolas Jager's avatar
Nicolas Jager committed
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
                <!--helper to detect mouse overing-->
                <Rectangle Fill="Transparent" Grid.Row="0"/>
                <!-- contact. -->
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="310"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="60"/>
                        <!-- use the height of _contactBar_ to make it visible or collapsed. -->
                        <RowDefinition x:Name="_contactBar_"
                                       Height="{x:Bind _contact._contactBarHeight, Mode=OneWay}"/>
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60"/>
                            <ColumnDefinition Width="*"
                                              MinWidth="200"/>
                        </Grid.ColumnDefinitions>
                        <Image x:Name="_contactAvatar_"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Center"
                               Grid.Column="0"
                               Width="55"
                               Height="55"
                               Source="Assets\TESTS\contactAvatar.png"/>
                        <!-- visual notifications. -->
                        <Border x:Name="_visualNotificationVideoChat_"
                            Visibility="Collapsed"
                            Style="{StaticResource BorderStyle1}">
                            <TextBlock Text="&#xE8AA;"
                                   Style="{StaticResource TextSegoeStyle1}"/>
                            <Border.RenderTransform>
                                <TranslateTransform X="17" Y="-14"/>
                            </Border.RenderTransform>
                        </Border>
                        <Border x:Name="_visualNotificationNewMessage_"
                            Visibility="{x:Bind _contact._unreadMessages, Converter={StaticResource _NewMessageBubleNotification_}, Mode=OneWay}"
                            Style="{StaticResource BorderStyle2}">
                            <TextBlock Text="{x:Bind _contact._unreadMessages, Mode=OneWay}"
                                   Style="{StaticResource TextStyle3}"/>
                            <Border.RenderTransform>
                                <TranslateTransform X="-17" Y="-14"/>
                            </Border.RenderTransform>
                        </Border>

                        <Grid Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="30"/>
                            </Grid.RowDefinitions>
                            <!-- name of the contact. -->
                            <TextBlock  x:Name="_contactName_"
                                    Grid.Row="0"
                                    Text="{x:Bind _contact.name_}"
                                    TextTrimming="CharacterEllipsis">
                            </TextBlock>
                            <!-- call button. -->
                            <Button Grid.Row="0"
                                    Visibility="{x:Bind _hovered, Mode=OneWay}"
                                    Click="_callContact__Click"
                                    VerticalAlignment="Bottom"
                                    HorizontalAlignment="Left"
                                    Margin="10,0"
                                    Style="{StaticResource roundButtonTemplate}"
                                    FontFamily="Segoe MDL2 Assets"
                                    Content="&#xE116;">
                                <Button.RenderTransform>
                                    <TranslateTransform X="90" Y="25"/>
                                </Button.RenderTransform>
                            </Button>
                        </Grid>
                    </Grid>
                </Grid>
309
                <!-- call bar. -->
Nicolas Jager's avatar
Nicolas Jager committed
310 311 312 313 314 315 316 317
                <Grid Width="320"
                      Grid.Row="1"
                      HorizontalAlignment="Left"
                      Background="DarkGray">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
318
                    <TextBlock x:Name="_CallStatus_"
Nicolas Jager's avatar
Nicolas Jager committed
319 320
                           Grid.Row="0"
                           Foreground="White"
321 322
                           Text="{x:Bind _callStatus, Mode=OneWay}"
                           Visibility="{x:Bind _callStatus, Converter={StaticResource _HasAnActiveCall_}, Mode=OneWay}"
Nicolas Jager's avatar
Nicolas Jager committed
323 324 325 326 327 328 329 330
                           HorizontalAlignment="Center">
                    </TextBlock>
                    <StackPanel Orientation="Horizontal"
                                Visibility="Visible"
                                Grid.Row="1"
                                HorizontalAlignment="Center">
                        <Button x:Name="_acceptIncomingCallBtn_"
                            Click="_acceptIncomingCallBtn__Click"
331
                            Visibility="{x:Bind _callStatus, Converter={StaticResource _IncomingVisibility_}, Mode=OneWay}"
Nicolas Jager's avatar
Nicolas Jager committed
332 333 334 335 336
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            Content="Accept"/>
                        <Button x:Name="_rejectIncomingCallBtn_"
                            Click="_rejectIncomingCallBtn__Click"
337
                            Visibility="{x:Bind _callStatus, Converter={StaticResource _IncomingVisibility_}, Mode=OneWay}"
Nicolas Jager's avatar
Nicolas Jager committed
338 339 340 341 342
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            Content="Reject"/>
                        <Button x:Name="_cancelCallBtn_"
                            Click="_cancelCallBtn__Click"
343
                            Visibility="{x:Bind _callStatus, Converter={StaticResource _OutGoingVisibility_}, Mode=OneWay}"
Nicolas Jager's avatar
Nicolas Jager committed
344 345 346 347 348
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            Content="Cancel"/>
                    </StackPanel>
                </Grid>
349 350
            </Grid>
        </DataTemplate>
Nicolas Jager's avatar
Nicolas Jager committed
351 352
    </Page.Resources>

Nicolas Jager's avatar
Nicolas Jager committed
353
    <Grid>
Nicolas Jager's avatar
Nicolas Jager committed
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
        <Grid.RowDefinitions>
            <!-- where accounts and share menu drop down are. -->
            <RowDefinition Height="auto"/>
            <!-- where contacts and settings are. -->
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!-- drop down menus. -->
        <Grid Background="LightBlue">
            <Grid.RowDefinitions>
                <!-- where the selected account is shown. -->
                <RowDefinition x:Name="_selectedAccountRow_"
                               Height="90"/>
                <!-- where the drop down menus are shown. -->
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <!-- selected account. -->
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition x:Name="_selectedAccountAvatarColumn_"
                                      Width="90"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="50"/>
                </Grid.ColumnDefinitions>
377 378 379 380 381
                <Ellipse
                    x:Name="_selectedAccountAvatarContainer_"
                    Height="80"
                    Width="80"
                    Grid.Column="0"
382 383 384 385 386
                    Stroke="White"
                    StrokeThickness="3"
                    PointerEntered="_selectedAccountAvatarContainer__PointerEntered"
                    PointerExited="_selectedAccountAvatarContainer__PointerExited"
                    PointerReleased="_selectedAccountAvatarContainer__PointerReleased"
387 388 389 390 391 392 393
                    Margin="5">
                    <Ellipse.Fill>
                        <ImageBrush
                            x:Name="_selectedAccountAvatar_"
                            ImageSource="Assets\TESTS\contactAvatar.png"/>
                    </Ellipse.Fill>
                </Ellipse>
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411
                <Ellipse
                    x:Name="_shaderPhotoboothIcon_"
                    Visibility="Collapsed"
                    Height="80"
                    Width="80"
                    Grid.Column="0"
                    IsHitTestVisible="False"
                    Fill="Black"
                    Opacity="0.3"
                    Margin="5">
                </Ellipse>
                <TextBlock x:Name="_photoboothIcon_"
                           Grid.Column="0"
                           Visibility="Collapsed"
                           IsHitTestVisible="False"
                           Style="{StaticResource TextSegoeStyle-Centered-40pt-white}"
                           Text="&#xE722;">
                </TextBlock>
Nicolas Jager's avatar
Nicolas Jager committed
412 413
                <StackPanel Grid.Column="1"
                            VerticalAlignment="Bottom">
414
                    <TextBlock x:Name="_selectedAccountName_"
415
                               Text="[TEXT MISSING]"
Nicolas Jager's avatar
Nicolas Jager committed
416 417 418 419 420 421 422 423 424 425
                               Margin="10"
                               Style="{StaticResource TextStyle2}"/>
                    <StackPanel Orientation="Horizontal">
                        <!--Content="&#xE0A1;-->
                        <ToggleButton x:Name="_accountsMenuButton_"
                                      VerticalAlignment="Bottom"
                                      Content="&#xE168;"
                                      Checked="_accountsMenuButton__Checked"
                                      Unchecked="_accountsMenuButton__Unchecked"
                                      Style="{StaticResource ToggleButtonStyle1}"/>
426
                        <!-- _shareMenuButton_ -->
Nicolas Jager's avatar
Nicolas Jager committed
427 428 429 430
                        <ToggleButton x:Name="_shareMenuButton_"
                                      VerticalAlignment="Bottom"
                                      Checked="_shareMenuButton__Checked"
                                      Unchecked="_shareMenuButton__Unchecked"
431 432 433 434 435
                                      Style="{StaticResource ToggleButtonStyle1}">
                            <Image Source="Assets/qrCodeIcon.png"
                                   Stretch="Uniform"/>
                        </ToggleButton>
                        <!-- _devicesMenuButton_ -->
436 437
                        <ToggleButton x:Name="_devicesMenuButton_"
                                      VerticalAlignment="Bottom"
438
                                      Content="&#xE836;"
439
                                      Checked="_devicesMenuButton__Checked"
440 441
                                      Unchecked="_devicesMenuButton__Unchecked"
                                      Style="{StaticResource ToggleButtonStyle1}"/>
Nicolas Jager's avatar
Nicolas Jager committed
442 443 444 445 446 447 448 449 450 451 452 453
                    </StackPanel>
                </StackPanel>
                <ToggleButton x:Name="_settingsTBtn_"
                              Grid.Column="2"
                              VerticalAlignment="Bottom"
                              Content="&#xE115;"
                              Checked="_settings__Checked"
                              Unchecked="_settings__Unchecked"
                              Style="{StaticResource ToggleButtonStyle1}"/>
            </Grid>

            <!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the
Nicolas Jager's avatar
Nicolas Jager committed
454
            same row. To summon them we use the visibility of their own grid, by linking it to a toggle button-->
Nicolas Jager's avatar
Nicolas Jager committed
455 456 457 458 459 460 461 462 463 464 465

            <!-- accounts menu. -->
            <Grid x:Name="_accountsMenuGrid_"
                  MaxHeight="350"
                  Grid.Row="1"
                  Visibility="Collapsed"
                  Background="LightBlue">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
466 467 468 469
                <ScrollViewer x:Name="_accountsListScrollView_"
                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollMode="Enabled">
                    <ListBox x:Name="_accountsList_"
Nicolas Jager's avatar
Nicolas Jager committed
470
                         Grid.Row="0"
471
                         SelectionChanged="_accountList__SelectionChanged"
Nicolas Jager's avatar
Nicolas Jager committed
472 473 474
                         Width="320"
                         ItemContainerStyle="{StaticResource contactsListBoxStyle}"
                         Background="#FFE4F1F9"
Nicolas Jager's avatar
Nicolas Jager committed
475
                         ItemTemplate="{StaticResource AccountListItemsTemplate}"/>
476
                </ScrollViewer>
Nicolas Jager's avatar
Nicolas Jager committed
477 478 479 480 481 482
                <Button x:Name="_addAccountBtn_"
                        Grid.Row="1"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center"
                        Content="&#xE948;"
                        Click="_addAccountBtn__Click"
483
                        Style="{StaticResource ButtonStyle6}"/>
Nicolas Jager's avatar
Nicolas Jager committed
484 485 486 487 488 489 490 491 492 493 494 495 496
            </Grid>
            <!-- account creation menu. -->
            <Grid x:Name="_accountCreationMenuGrid_"
                  Grid.Row="2"
                  Visibility="Collapsed"
                  Background="LightBlue">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Vertical"
                            Grid.Row="0"
                            Background="#FFE4F1F9">
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
                    <!-- alias sub menu. -->
                    <StackPanel Orientation="Horizontal" Margin="10">
                        <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                   Text="&#xE8EC;"/>
                        <TextBlock Text="Alias" Margin="10"/>
                    </StackPanel>
                    <TextBox  x:Name="_ringAliasTextBox_"
                              TextChanged="_ringAliasTextBox__TextChanged"
                              Margin="10"
                              PlaceholderText="Enter alias"/>
                    <!-- account type chooser -->
                    <StackPanel Orientation="Horizontal" Margin="10">
                        <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                   Text="&#xE168;"/>
                        <TextBlock Text="Account type" Margin="10"/>
                    </StackPanel>
                    <ComboBox x:Name="_accountTypeComboBox_"
514
                                  SelectedIndex="0"
Nicolas Jager's avatar
Nicolas Jager committed
515
                                  Margin="10"
516
                                  SelectionChanged="_accountTypeComboBox__SelectionChanged"
Nicolas Jager's avatar
Nicolas Jager committed
517 518
                                  VerticalAlignment="Center"
                                  Width="195">
519 520 521
                        <ComboBoxItem Content="Ring"/>
                        <ComboBoxItem Content="Sip"/>
                    </ComboBox>
Nicolas Jager's avatar
Nicolas Jager committed
522 523 524
                    <!-- RING account. -->
                    <StackPanel x:Name="_ringAccountCreationStack_"
                                Visibility="Visible">
525 526 527 528 529 530 531
                        <!-- password sub menu. -->
                        <StackPanel Orientation="Horizontal" Margin="10">
                            <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                   Text="&#xE8D7;"/>
                            <TextBlock Text="Archive password" Margin="10"/>
                        </StackPanel>
                        <PasswordBox x:Name="_ringPasswordBoxAccountCreation_"
532 533
                                     Margin="10"
                                     PasswordChanged="_passwordBoxAccountCreationCheck__PasswordChanged"
534 535
                                     PlaceholderText="Enter archive password"/>
                        <PasswordBox  x:Name="_ringPasswordBoxAccountCreationCheck_"
536 537
                                      Margin="10"
                                      PasswordChanged="_passwordBoxAccountCreationCheck__PasswordChanged"
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
                                      PlaceholderText="Repeat archive Password"/>
                        <!-- upnp sub menu. -->
                        <StackPanel Orientation="Horizontal" Margin="10">
                            <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                   Text="&#xE15E;"/>
                            <TextBlock Text="UPnP" Margin="10"/>
                        </StackPanel>
                        <ToggleSwitch x:Name="_upnpStateAccountCreation_"
                                      IsOn="True"
                                      Margin="20,10"/>
                    </StackPanel>
                    <!-- SIP account. -->
                    <StackPanel x:Name="_sipAccountCreationStack_"
                                Visibility="Collapsed">
                        <StackPanel Orientation="Horizontal"
                                    Margin="10">
                            <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                       Text="&#xE717;"/>
                            <TextBlock Text="SIP account parameters"
                                       Margin="10"/>
                        </StackPanel>
                        <TextBox  x:Name="_sipHostnameTextBox_"
                                  Margin="10"
                                  PlaceholderText="Enter hostname"/>
                        <TextBox  x:Name="_sipUsernameTextBox_"
                                  Margin="10"
                                  PlaceholderText="Enter username"/>
                        <PasswordBox x:Name="_sipPasswordBoxAccountCreation_"
                                     Margin="10"
                                     PlaceholderText="Enter password"/>
Nicolas Jager's avatar
Nicolas Jager committed
568 569 570 571 572 573 574 575 576 577 578 579
                    </StackPanel>
                </StackPanel>
                <!-- buttons yes/no to create the new account. -->
                <Grid Grid.Row="1">
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Center">
                        <Button x:Name="_createAccountYes_"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="&#xE081;"
                                Click="_createAccountYes__Click"
580
                                Style="{StaticResource ButtonStyle5}"/>
Nicolas Jager's avatar
Nicolas Jager committed
581 582 583 584 585 586
                        <Button x:Name="_createAccountNo_"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="&#xE106;"
                                Click="_createAccountNo__Click"
587
                                Style="{StaticResource ButtonStyle5}"/>
Nicolas Jager's avatar
Nicolas Jager committed
588 589 590
                    </StackPanel>
                </Grid>
            </Grid>
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611
            <!-- account edition menu. -->
            <Grid x:Name="_accountEditionMenuGrid_"
                  Grid.Row="2"
                  Visibility="Collapsed"
                  Background="LightBlue">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Vertical"
                            Grid.Row="0"
                            Background="#FFE4F1F9">
                    <!-- alias sub menu. -->
                    <StackPanel Orientation="Horizontal" Margin="10">
                        <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                   Text="&#xE1CB;"/>
                        <TextBlock Text="Alias" Margin="10"/>
                    </StackPanel>
                    <TextBox  x:Name="_aliasTextBoxEditionMenu_"
                              FontSize="20"
                              Margin="20,10"
612
                              PlaceholderText="Enter alias"/>
613
                    <!-- upnp sub menu. -->
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641
                    <StackPanel x:Name="_upnpStackEditionMenu_">
                        <StackPanel Orientation="Horizontal" Margin="10">
                            <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                       Text="&#xE15E;"/>
                            <TextBlock Text="UPnP" Margin="10"/>
                        </StackPanel>
                        <ToggleSwitch x:Name="_upnpState_"
                                      Margin="20,10"/>
                    </StackPanel>
                    <!-- SIP parameters. -->
                    <StackPanel x:Name="_sipAccountStackEditionMenu_"
                                Visibility="Collapsed">
                        <StackPanel Orientation="Horizontal"
                                    Margin="10">
                            <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                       Text="&#xE717;"/>
                            <TextBlock Text="SIP account parameters"
                                       Margin="10"/>
                        </StackPanel>
                        <TextBox  x:Name="_sipHostnameEditionMenu_"
                                  Margin="10"
                                  PlaceholderText="Enter hostname"/>
                        <TextBox  x:Name="_sipUsernameEditionTextBox_"
                                  Margin="10"
                                  PlaceholderText="Enter username"/>
                        <PasswordBox x:Name="_sipPasswordEditionMenu_"
                                     Margin="10"
                                     PlaceholderText="Enter password"/>
642 643
                    </StackPanel>
                    <!-- delete account sub menu. -->
644
                    <StackPanel Orientation="Horizontal" Margin="10">
645 646 647 648 649 650
                        <TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
                                   Text="&#xE74D;"/>
                        <TextBlock Text="Delete account" Margin="10"/>
                    </StackPanel>
                    <ToggleButton x:Name="_deleteAccountBtnEditionMenu_"
                            Margin="20,10"
651
                            Content="Delete"/>
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673
                </StackPanel>
                <!-- buttons yes/no to accept the modification. -->
                <Grid Grid.Row="1">
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Center">
                        <Button x:Name="_acceptAccountModification_"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="&#xE081;"
                                Click="_acceptAccountModification__Click"
                                Style="{StaticResource ButtonStyle5}"/>
                        <Button x:Name="_cancelAccountModification_"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="&#xE106;"
                                Click="_cancelAccountModification__Click"
                                Style="{StaticResource ButtonStyle5}"/>
                    </StackPanel>
                </Grid>
            </Grid>
Nicolas Jager's avatar
Nicolas Jager committed
674 675 676 677 678 679 680 681 682 683 684 685 686 687 688
            <!-- share menu. -->
            <Grid x:Name="_shareMenuGrid_"
                  Grid.Row="2"
                  Visibility="Collapsed"
                  Background="LightBlue">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Grid Background="#FFE4F1F9">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
689 690 691 692 693 694
                    <Grid Background="white"
                          Margin="10"
                          MaxHeight="150"
                          MaxWidth="140"
                          Padding="5">
                        <Image x:Name="_selectedAccountQrCode_"
Nicolas Jager's avatar
Nicolas Jager committed
695 696 697
                           Width="200"
                           Margin="5"
                           Grid.Row="0"
698
                           Stretch="None"
Nicolas Jager's avatar
Nicolas Jager committed
699
                           Height="200"/>
700 701 702 703 704
                    </Grid>
                    <TextBlock x:Name="_ringId_"
                               Padding="5"
                               Style="{StaticResource TextStyle4}"
                               Text=""
Nicolas Jager's avatar
Nicolas Jager committed
705
                               Grid.Row="1"
706
                               IsTextSelectionEnabled="True"
Nicolas Jager's avatar
Nicolas Jager committed
707 708
                               HorizontalAlignment="Center"/>
                </Grid>
709 710 711 712 713 714 715
                <Button x:Name="_shareMenuDone_"
                        Grid.Row="1"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center"
                        Content="&#xE081;"
                        Click="_shareMenuDone__Click"
                        Style="{StaticResource ButtonStyle6}"/>
Nicolas Jager's avatar
Nicolas Jager committed
716
            </Grid>
717 718 719 720 721 722 723 724 725 726 727
            <!-- devices menu. -->
            <Grid x:Name="_devicesMenuGrid_"
                  Grid.Row="2"
                  Visibility="Collapsed"
                  Background="LightBlue">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Grid Background="#FFE4F1F9">
                    <Grid.RowDefinitions>
728
                        <RowDefinition Height="auto"/>
729 730 731 732 733
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
734
                    <TextBlock Text="Device ID:"
Nicolas Jager's avatar
Nicolas Jager committed
735
                               Margin="10"
736 737
                               Grid.Row="0"
                               HorizontalAlignment="Center"/>
738
                    <TextBlock x:Name="_deviceId_"
Nicolas Jager's avatar
Nicolas Jager committed
739
                               Margin="10"
740
                               Text="[TEXT_MISSING]"
Nicolas Jager's avatar
Nicolas Jager committed
741
                               TextTrimming="CharacterEllipsis"
742 743 744
                               Grid.Row="1"
                               IsTextSelectionEnabled="True"
                               HorizontalAlignment="Center"/>
Nicolas Jager's avatar
Nicolas Jager committed
745 746 747 748 749
                    <TextBlock x:Name="_waitingDevicesList_"
                               Text="waiting for devices list..."
                               Grid.Row="2"
                               IsTextSelectionEnabled="True"
                               HorizontalAlignment="Center"/>
750
                    <ListBox x:Name="_devicesIdList_"
Nicolas Jager's avatar
Nicolas Jager committed
751
                             Visibility="Collapsed"
752
                         Grid.Row="2"/>
753 754 755 756 757 758 759 760 761
                </Grid>
                <Button x:Name="_addDevice_"
                        Grid.Row="1"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center"
                        Content="&#xE948;"
                        Click="_addDevice__Click"
                        Style="{StaticResource ButtonStyle6}"/>
            </Grid>
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
            <!-- add device (pin generator) menu. -->
            <Grid x:Name="_addingDeviceGrid_"
                  Grid.Row="2"
                  Visibility="Collapsed"
                  Background="LightBlue">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Grid Background="#FFE4F1F9">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock VerticalAlignment="Center"
                                       Text="PIN generator"
                               HorizontalAlignment="Center"
                               Grid.Row="0"
                                       Margin="10,10,0,10"/>
                    <PasswordBox x:Name="_passwordForPinGenerator_"
                                 Margin="10"
                                 Grid.Row="1"
                                 PlaceholderText="Enter your password"/>
                </Grid>
                <!-- buttons yes/no to generate a PIN. -->
                <Grid Grid.Row="1">
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Center">
                        <Button x:Name="_pinGeneratorYes_"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="&#xE081;"
                                Click="_pinGeneratorYes__Click"
                                Style="{StaticResource ButtonStyle5}"/>
                        <Button x:Name="_pinGeneratorNo_"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="&#xE106;"
                                Click="_pinGeneratorNo__Click"
                                Style="{StaticResource ButtonStyle5}"/>
                    </StackPanel>
                </Grid>
            </Grid>
            <!-- waiting for a PIN. -->
            <Grid x:Name="_waitingForPin_"
                Grid.Row="2"
                Visibility="Collapsed"
                Background="LightBlue">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Grid Background="#FFE4F1F9">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock x:Name="_waitingAndResult_"
                               VerticalAlignment="Center"
                               Text="Exporting account on the Ring..."
                               HorizontalAlignment="Center"
                               Grid.Row="0"
                               Margin="10,10,0,10"/>
                </Grid>
Nicolas Jager's avatar
Nicolas Jager committed
830 831 832 833 834 835 836 837 838 839 840 841
                <Grid Grid.Row="1">
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Center">
                        <Button x:Name="_closePin_"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="&#xE081;"
                                Click="_closePin__Click"
                                Style="{StaticResource ButtonStyle5}"/>
                    </StackPanel>
                </Grid>
842
            </Grid>
Nicolas Jager's avatar
Nicolas Jager committed
843 844 845 846 847 848 849







Nicolas Jager's avatar
Nicolas Jager committed
850
        </Grid>
851
        <!-- smartList and settings. -->
Nicolas Jager's avatar
Nicolas Jager committed
852
        <Grid Grid.Row="1">
853
            <!-- contacts + calls => smartpanelitems. -->
Nicolas Jager's avatar
Nicolas Jager committed
854 855 856 857 858 859 860 861
            <Grid x:Name="_smartGrid_"
                  Grid.Row="0">
                <Grid.RowDefinitions>
                    <RowDefinition x:Name="_rowRingTxtBx_"
                                   Height="40"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <TextBox x:Name="_ringTxtBx_"
862
                         HorizontalAlignment="Center"
Nicolas Jager's avatar
Nicolas Jager committed
863 864
                         VerticalAlignment="Center"
                         Width="320"
865
                         TextWrapping="Wrap"
866
                         Style="{StaticResource addContactTextBoxStyle}"
867
                         KeyDown="_ringTxtBx__KeyDown"
868
                         Text=""/>
Nicolas Jager's avatar
Nicolas Jager committed
869 870 871 872
                <ListBox x:Name="_smartList_"
                         Grid.Row="1"
                         Margin="0"
                         Padding="0"
873 874 875
                         SelectionChanged="_smartList__SelectionChanged"
                         ScrollViewer.HorizontalScrollBarVisibility="Auto"
                         ScrollViewer.HorizontalScrollMode="Enabled"
Nicolas Jager's avatar
Nicolas Jager committed
876
                         ItemContainerStyle="{StaticResource contactsListBoxStyle}"
877
                         ItemTemplate="{StaticResource SmartPanelItemsTemplate}"/>
Nicolas Jager's avatar
Nicolas Jager committed
878 879 880 881 882 883 884 885
            </Grid>
            <!-- settings. -->
            <Grid x:Name="_settings_"
                  Grid.Row="0"
                  Visibility="Collapsed">
                <TextBlock>some settings</TextBlock>
            </Grid>
        </Grid>
Nicolas Jager's avatar
Nicolas Jager committed
886 887 888
    </Grid>

</Page>