diff --git a/App.xaml b/App.xaml
index 89636e1..04fef6d 100644
--- a/App.xaml
+++ b/App.xaml
@@ -2,8 +2,16 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VideoConcat"
+ xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
+
+
+
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 2342266..f89e377 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -6,9 +6,9 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:VideoConcat"
mc:Ignorable="d"
- Title="登录" Height="450" Width="800"
+ Title="登录" Height="300" Width="500"
ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
- WindowStyle="None">
+ >
@@ -20,63 +20,46 @@
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+ FontSize="38" TextAlignment="Center">
用户登录
-
+
-
+
-
+
-
-
-
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index 6687c52..5f86e7b 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -27,10 +27,12 @@ namespace VideoConcat
}
private void BtnLogin_Click(object sender, RoutedEventArgs e)
- {
+ { Video video = new();
+ video.Show();
if (txtUserName.Text == "admin" && txtPassword.Password == "123456")
{
- MessageBox.Show("登录成功");
+
+ this.Close();
return;
}
MessageBox.Show("用户名或者密码错误!");
diff --git a/Task.cs b/Task.cs
new file mode 100644
index 0000000..9e1f0ff
--- /dev/null
+++ b/Task.cs
@@ -0,0 +1,34 @@
+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;
+ });
+
+ }
+ }
+
+}
diff --git a/Video.xaml b/Video.xaml
new file mode 100644
index 0000000..f8a05f4
--- /dev/null
+++ b/Video.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
diff --git a/Video.xaml.cs b/Video.xaml.cs
new file mode 100644
index 0000000..f31456d
--- /dev/null
+++ b/Video.xaml.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace VideoConcat
+{
+ ///
+ /// Video.xaml 的交互逻辑
+ ///
+ public partial class Video : Window
+ {
+ public Video()
+ {
+ InitializeComponent();
+ }
+
+ private async void Button_Click(object sender, RoutedEventArgs e)
+ {
+ startButton.IsEnabled = false;
+ await Task.Run(() => ProcessVideo.RunTask(processVideoBar, startButton));
+ }
+ }
+}
diff --git a/VideoConcat.csproj b/VideoConcat.csproj
index 45756b1..82b6fb7 100644
--- a/VideoConcat.csproj
+++ b/VideoConcat.csproj
@@ -10,6 +10,7 @@
+