예제 #1
0
        /// <inheritdoc/>
        public virtual IDownloadProgress CreateProgressWindow(SparkleUpdater sparkle, AppCastItem item)
        {
            var viewModel = new DownloadProgressWindowViewModel()
            {
                ItemToDownload = item,
                SoftwareWillRelaunchAfterUpdateInstalled = sparkle.RelaunchAfterUpdate
            };

            return(new DownloadProgressWindow(viewModel, _iconBitmap)
            {
                Icon = _applicationIcon
            });
        }
예제 #2
0
        /// <summary>
        /// Constructor for DownloadProgressWindow that takes an initialized
        /// <see cref="DownloadProgressWindowViewModel"/> view model for use
        /// </summary>
        /// <param name="viewModel"><see cref="DownloadProgressWindowViewModel"/> view model that
        /// this window will bind to as its DataContext</param>
        /// <param name="iconBitmap">Bitmap to use for the app's logo/graphic</param>
        public DownloadProgressWindow(DownloadProgressWindowViewModel viewModel, IBitmap iconBitmap)
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
            Closing    += DownloadProgressWindow_Closing;
            DataContext = _dataContext = viewModel;
            var imageControl = this.FindControl <Image>("AppIcon");
            if (imageControl != null)
            {
                imageControl.Source = iconBitmap;
            }
        }
예제 #3
0
 /// <summary>
 /// Constructor for DownloadProgressWindow that takes an initialized
 /// <see cref="DownloadProgressWindowViewModel"/> view model for use
 /// </summary>
 /// <param name="viewModel"><see cref="DownloadProgressWindowViewModel"/> view model that
 /// this window will bind to as its DataContext</param>
 public DownloadProgressWindow(DownloadProgressWindowViewModel viewModel)
 {
     InitializeComponent();
     Closing    += DownloadProgressWindow_Closing;
     DataContext = _dataContext = viewModel;
 }