Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Design tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Depechie committed Jan 7, 2017
1 parent 1fa6e19 commit 0f639de
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 10 deletions.
50 changes: 42 additions & 8 deletions src/Kliva/Controls/AppInfoDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,46 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="TITLE"
PrimaryButtonText="Button1"
SecondaryButtonText="Button2"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
SecondaryButtonClick="ContentDialog_SecondaryButtonClick">
Title="Kliva - info">

<Grid>
</Grid>
</ContentDialog>
<ContentDialog.Resources>
<CollectionViewSource x:Name="GroupedAppInfoOverviewItems"
Source="{Binding CurrentVersion.OverviewItems, Mode=OneWay}"
IsSourceGrouped="True"
ItemsPath="Items" />
</ContentDialog.Resources>

<RelativePanel>
<TextBlock x:Name="CurrentVersionTextBlock" Style="{StaticResource BaseTextBlock}">
<Bold>
<Run FontSize="18" Text="{Binding CurrentVersion.Version, Mode=OneWay}" Foreground="{StaticResource KlivaDarkBrush}"/>
</Bold>
<LineBreak />
<Run Text="version" FontSize="12" Foreground="{StaticResource SubTextBrush}"/>
</TextBlock>

<TextBlock x:Name="GeneralInfoTextBlock"
Style="{StaticResource BaseTextBlock}"
Padding="0,10,0,5"
TextWrapping="Wrap"
RelativePanel.Below="CurrentVersionTextBlock">
<Run Text="{Binding CurrentVersion.GeneralInfo, Mode=OneWay}" />
</TextBlock>

<ListView x:Name="AppInfoOverviewItemsList"
ItemsSource="{Binding Source={StaticResource GroupedAppInfoOverviewItems}}"
ItemTemplate="{StaticResource WhatsNewListItemDataTemplate}"
SelectionMode="None"
RelativePanel.Below="GeneralInfoTextBlock"
RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True">
<ListView.GroupStyle>
<GroupStyle HeaderTemplate="{StaticResource WhatsNewGroupHeaderTemplate}" />
</ListView.GroupStyle>
</ListView>

<Button Content="Ok"
MinWidth="100"
RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignLeftWithPanel="True"
Click="OnOkButtonClick"/>
</RelativePanel>
</ContentDialog>
10 changes: 8 additions & 2 deletions src/Kliva/Controls/AppInfoDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Kliva.Controls
{
public sealed partial class AppInfoDialog : ContentDialog
{
public AppInfoDialog()
{
this.InitializeComponent();
this.InitializeComponent();
}

private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
Expand All @@ -16,5 +17,10 @@ private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialo
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}

private void OnOkButtonClick(object sender, RoutedEventArgs e)
{
Hide();
}
}
}
9 changes: 9 additions & 0 deletions src/Kliva/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ private async void ViewLoaded()
await _settingsService.SetAppVersionAsync(runTimeVersion);
//TODO: Glenn - Check loaded version with saved version in Settings, if different show what's new dialog and overwrite settings field
AppInfoDialog appInfo = new AppInfoDialog();
//TODO: Change the strings to enums or constants for the visual states
if (CurrentState.Name.Equals("Mobile", StringComparison.OrdinalIgnoreCase))
appInfo.FullSizeDesired = true;
else
{
appInfo.MinWidth = (double) (Window.Current.Bounds.Width * 90) / 100;
appInfo.MinHeight = (double)(Window.Current.Bounds.Height * 90) / 100;
}

await appInfo.ShowAsync();
}

Expand Down

0 comments on commit 0f639de

Please sign in to comment.