Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 7e2cbd7

Browse files
Restyle Updater Window
1 parent d958c5a commit 7e2cbd7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Interop/Updater/UpdateWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
Width="500" Height="200" ResizeMode="NoResize" ShowInTaskbar="False" WindowStyle="None" ShowTitleBar="False" GlowBrush="{DynamicResource AccentColorBrush}"
7-
ShowCloseButton="False" WindowStartupLocation="CenterOwner" >
6+
Width="500" Height="200" ResizeMode="NoResize" TitleCaps="False" ShowInTaskbar="False" WindowStyle="None" GlowBrush="{DynamicResource AccentColorBrush}" WindowStartupLocation="CenterOwner" >
87
<mahapps:MetroWindow.Resources>
98
<ResourceDictionary>
109
<ResourceDictionary.MergedDictionaries>
@@ -17,8 +16,9 @@
1716
</ResourceDictionary>
1817
</mahapps:MetroWindow.Resources>
1918
<Grid>
19+
<Image Name="Icon" Source="/SPCode;component/Resources/Icon.ico" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,5,5" Width="40" Height="40"/>
2020
<mahapps:ProgressRing Name="Progress" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,5,5" Width="40" Height="40" IsActive="False" IsLarge="False" IsHitTestVisible="False" />
21-
<TextBlock Name="MainLine" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="50,0,0,0" FontSize="16" Foreground="{StaticResource AccentColorBrush}" Text="An update is available. Do you want to update?" IsHitTestVisible="False" />
21+
<TextBlock Name="MainLine" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="50,0,0,0" FontSize="16" Foreground="{StaticResource AccentColorBrush}" Text="Update now?" IsHitTestVisible="False" />
2222
<TextBlock Name="SubLine" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="50,25,0,0" FontSize="14" IsHitTestVisible="False" />
2323
<Button Name="ActionYesButton" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="50,25,0,0" Content="Yes" Width="50" Click="ActionYesButton_Click" />
2424
<Button Name="ActionNoButton" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="110,25,0,0" Content="No" Width="50" Click="ActionNoButton_Click" />

Interop/Updater/UpdateWindow.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Diagnostics;
33
using System.IO;
44
using System.Net;
5+
using System.Reflection;
56
using System.Threading;
67
using System.Windows;
78
using Octokit;
@@ -21,11 +22,13 @@ public UpdateWindow()
2122
InitializeComponent();
2223
}
2324

24-
public UpdateWindow(UpdateInfo info)
25+
public UpdateWindow(UpdateInfo info) : this()
2526
{
2627
updateInfo = info;
27-
InitializeComponent();
28+
29+
Title = $"Version {info.Release.TagName} is Available!";
2830
DescriptionBox.Text = updateInfo.Release.Body;
31+
2932
if (info.SkipDialog)
3033
{
3134
StartUpdate();
@@ -52,6 +55,7 @@ private void StartUpdate()
5255

5356
ActionYesButton.Visibility = Visibility.Hidden;
5457
ActionNoButton.Visibility = Visibility.Hidden;
58+
Icon.Visibility = Visibility.Hidden;
5559
Progress.IsActive = true;
5660
MainLine.Text = "Updating to " + updateInfo.Release.TagName;
5761
SubLine.Text = "Downloading Updater";

0 commit comments

Comments
 (0)