This commit is contained in:
Asval 2024-09-28 20:19:15 +02:00
parent 7e35306b01
commit fdf3deed76
2 changed files with 8 additions and 1 deletions

View File

@ -38,7 +38,8 @@
<Button Grid.Column="2" Style="{DynamicResource {x:Static adonisUi:Styles.ToolbarButton}}" ToolTip="Download"
Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Grid}}"
Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}">
Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Click="OnDownload">
<Viewbox Width="16" Height="16" VerticalAlignment="Center" HorizontalAlignment="Center">
<Canvas Width="16" Height="16">
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}"

View File

@ -1,5 +1,6 @@
using System.Windows;
using System.Windows.Controls;
using AutoUpdaterDotNET;
using FModel.ViewModels.ApiEndpoints.Models;
namespace FModel.Views.Resources.Controls;
@ -19,5 +20,10 @@ public partial class CommitDownloaderControl : UserControl
get { return (GitHubAsset)GetValue(CommitAssetProperty); }
set { SetValue(CommitAssetProperty, value); }
}
private void OnDownload(object sender, RoutedEventArgs e)
{
AutoUpdater.DownloadUpdate(new UpdateInfoEventArgs { DownloadURL = CommitAsset.BrowserDownloadUrl });
}
}