XCIFileTrimmerMainWindowLog.cs 705 B

123456789101112131415161718192021222324
  1. using Avalonia.Threading;
  2. using Ryujinx.Ava.UI.ViewModels;
  3. namespace Ryujinx.Ava.Common
  4. {
  5. internal class XCIFileTrimmerMainWindowLog : Ryujinx.Common.Logging.XCIFileTrimmerLog
  6. {
  7. private readonly MainWindowViewModel _viewModel;
  8. public XCIFileTrimmerMainWindowLog(MainWindowViewModel viewModel)
  9. {
  10. _viewModel = viewModel;
  11. }
  12. public override void Progress(long current, long total, string text, bool complete)
  13. {
  14. Dispatcher.UIThread.Post(() =>
  15. {
  16. _viewModel.StatusBarProgressMaximum = (int)(total);
  17. _viewModel.StatusBarProgressValue = (int)(current);
  18. });
  19. }
  20. }
  21. }