update
This commit is contained in:
parent
1326c7385f
commit
e6c09e2309
10
App.xaml
10
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">
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Light.Blue.xaml"/>
|
||||
<!--需要注意 wd:Resources 必须在配色主题后,Theme="Dark" 为黑色皮肤-->
|
||||
<wd:Resources Theme="Light"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Theme.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@ -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">
|
||||
>
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@ -20,63 +20,46 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
<Grid MouseDown="Grid_MouseDown">
|
||||
<Grid.Background>
|
||||
<LinearGradientBrush StartPoint="0.1,0" EndPoint="0.9,1">
|
||||
<GradientStop Offset="1" Color="#FFE63070"/>
|
||||
<GradientStop Offset="0" Color="#FFFE8704"/>
|
||||
</LinearGradientBrush>
|
||||
</Grid.Background>
|
||||
<Border Height="390" VerticalAlignment="Top"
|
||||
Background="#220000" CornerRadius="0 0 180 0">
|
||||
<Grid >
|
||||
<Border>
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<StackPanel Width="350">
|
||||
<!-- <Image Width="300" Height="300" Margin="30" VerticalAlignment="Top" Stretch="Fill" Source="pack://application:,,,/VideoConcat;component/Images/left.png"/>-->
|
||||
</StackPanel>
|
||||
<StackPanel Width="350">
|
||||
<StackPanel Margin="20,40">
|
||||
<StackPanel Width="500">
|
||||
<StackPanel >
|
||||
<TextBlock Margin="20" FontFamily="Great Vibes"
|
||||
FontSize="38" Foreground="White" TextAlignment="Center">
|
||||
FontSize="38" TextAlignment="Center">
|
||||
用户登录
|
||||
</TextBlock>
|
||||
<StackPanel Margin="10" Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
Width="25" Height="25" Foreground="White"
|
||||
Kind="User"/>
|
||||
<TextBox x:Name="txtUserName" Width="250"
|
||||
Width="30" Height="30"
|
||||
Kind="User" Margin="10,0,10,0"/>
|
||||
<TextBox x:Name="txtUserName" Width="400"
|
||||
Margin="10,0" BorderBrush="White"
|
||||
CaretBrush="#FFD94448" Foreground="White"
|
||||
CaretBrush="#FFD94448"
|
||||
SelectionBrush="#FFD94448"
|
||||
materialDesign:HintAssist.Hint="输入 用户名"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10" Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
Width="25" Height="25" Foreground="White"
|
||||
Kind="Lock"/>
|
||||
<PasswordBox x:Name="txtPassword" Width="250"
|
||||
Width="30" Height="30"
|
||||
Kind="Lock" Margin="10,0,10,0"/>
|
||||
<PasswordBox x:Name="txtPassword" Width="400"
|
||||
Margin="10,0" BorderBrush="White"
|
||||
CaretBrush="#FFD94448" Foreground="White"
|
||||
CaretBrush="#FFD94448"
|
||||
SelectionBrush="#FFD94448"
|
||||
materialDesign:HintAssist.Hint="输入 密码"
|
||||
/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10" HorizontalAlignment="Center">
|
||||
<StackPanel Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button x:Name="btnLogin" Width="100" Height="40"
|
||||
materialDesign:ButtonAssist.CornerRadius="10"
|
||||
Background="#D94448" BorderBrush="#D94448" BorderThickness="2"
|
||||
Content="登录" Foreground="White" ToolTip="登录"
|
||||
Content="登录" ToolTip="登录"
|
||||
Style="{StaticResource MaterialDesignRaisedButton}" Click="BtnLogin_Click"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Width="100">
|
||||
<Button x:Name="btnExit" Margin="5,10" Background="{x:Null}"
|
||||
Click="BtnExit_Click" Style="{StaticResource MaterialDesignFloatingActionButton}"
|
||||
ToolTip="关闭" Height="36" Width="36">
|
||||
<materialDesign:PackIcon Width="20" Height="20"
|
||||
Foreground="White" Kind="Close"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
|
||||
@ -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("用户名或者密码错误!");
|
||||
|
||||
34
Task.cs
Normal file
34
Task.cs
Normal file
@ -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;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
18
Video.xaml
Normal file
18
Video.xaml
Normal file
@ -0,0 +1,18 @@
|
||||
<Window x:Class="VideoConcat.Video"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:local="clr-namespace:VideoConcat"
|
||||
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
|
||||
mc:Ignorable="d"
|
||||
Title="视频" Height="450" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" >
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<Button Content="开始拼接" VerticalAlignment="Top" Height="30" Click="Button_Click" x:Name="startButton" Margin="5"/>
|
||||
<TextBlock Margin="5" TextWrapping="Wrap" Text="" Height="auto" x:Name="outputTxt"/>
|
||||
</StackPanel>
|
||||
<ProgressBar x:Name="processVideoBar" Minimum="0" Maximum="100" Value="0" VerticalAlignment="Bottom" Height="10" Margin="5"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
33
Video.xaml.cs
Normal file
33
Video.xaml.cs
Normal file
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Video.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MaterialDesignXaml.DialogsHelper" Version="1.0.4" />
|
||||
<PackageReference Include="WPFDevelopers" Version="0.0.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user