VideoConcat/Task.cs
2024-10-27 20:43:38 +08:00

36 lines
956 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace VideoConcat
{
public static class ProcessVideo
{
public static void RunTask(System.Windows.Controls.ProgressBar progressBar, System.Windows.Controls.Button btn)
{
for (int i = 0; i <= 100; i++)
{
Application.Current.Dispatcher.Invoke(() =>
{
progressBar.Dispatcher.Invoke(() =>
{
progressBar.Value = i;
});
});
System.Threading.Thread.Sleep(50);
}
btn.Dispatcher.Invoke(() =>
{
btn.IsEnabled = true;
});
}
}
}