Barra de titol amb la versió actual
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
mc:Ignorable="d"
|
||||
Loaded="Window_Loaded"
|
||||
ContentRendered="CheckNewUpdates"
|
||||
Title="UtilitatPdf 1.3" Height="450" Width="550" Icon="pdf.ico" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||
Title="{Binding Titol, RelativeSource={RelativeSource Mode=Self}}"
|
||||
Height="450" Width="550" Icon="pdf.ico" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||
<Window.Resources>
|
||||
<Style x:Key="Opacity1" TargetType="Image">
|
||||
<Style.Triggers>
|
||||
|
||||
@@ -29,18 +29,35 @@ namespace UtilitatPdf
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
ObservableCollection<PdfInfo> list = new ObservableCollection<PdfInfo>();
|
||||
public string Titol
|
||||
{
|
||||
get { return (string)GetValue(PropietatsTitol); }
|
||||
set { SetValue(PropietatsTitol, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty PropietatsTitol =
|
||||
DependencyProperty.Register("Titol", typeof(string), typeof(MainWindow), new UIPropertyMetadata(null));
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Titol = "UtilitatPdf";
|
||||
}
|
||||
async void CheckNewUpdates(object sender, EventArgs e)
|
||||
{
|
||||
Updater needUpdate = new Updater();
|
||||
Titol = "UtilitatPdf " + needUpdate.CurrentVersion;
|
||||
|
||||
if (needUpdate.IsNewerVersion)
|
||||
{
|
||||
|
||||
MessageBoxResult result = MessageBox.Show("Hi Ha disponible una nova versió de l'aplicació.\n Actual: "+ needUpdate.CurrentVersion +" Nova Versió: " + needUpdate.NewReleaseVersion + "\n\nVols Actualizarla ara?", "Actualització", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
MessageBoxResult result = MessageBox.Show("Hi Ha disponible una nova versió de l'aplicació.\n Actual: " +
|
||||
needUpdate.CurrentVersion +
|
||||
" Nova Versió: " +
|
||||
needUpdate.NewReleaseVersion +
|
||||
"\n\nVols Actualizarla ara?",
|
||||
"Actualització",
|
||||
MessageBoxButton.YesNo,
|
||||
MessageBoxImage.Question);
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
await needUpdate.DownloadReleaseAsync();
|
||||
|
||||
Reference in New Issue
Block a user