VideoWaterMark:1.【app.publish文件夹】2.【*.pdb 文件】3.【*.xml 文件】4.【VideoWatermark.application 文件】5.【VideoWatermark.exe.manifest 文件】
1.Nuget引入HandyControl https://handyorg.github.io/handycontrol/quick_start/2.Nuget引入Enums.NET 并且 System.Runtime.CompilerServices.Unsafe 使用6.0版本3.添加引用 System.Text.Json、System.Memory、System.Management4.using System.Text.Json; using System.Management;
1.FFmpeg_视频处理2.PdfiumViewer_C# PDF转图片（JPG，Png）_https://blog.csdn.net/tnb_ml/article/details/124915260
创建Model（模型）首先定义一个LoginModel模型来表示登录信息。namespace Login.Model { public class LoginModel { public string Username { get; set; } public string Password { get; set; } } }创建ViewModel（视图模型）ViewModel作为View和Model之间的桥梁，包含用户输入的数据和命令绑定。using System; using System.ComponentModel; using System.Windows.Input; using Login.Command; using Login.Model; namespace Login.ViewModel { public class LoginViewModel : INotifyPropertyChanged { private LoginModel loginModel; public String Username { get { return loginModel.Username; } set { this.loginModel.Username = value; OnPropertyChanged(nameof(Username)); } } public String Password { get { return loginModel.Password; } set { this.loginModel.Password = value; OnPropertyChanged("Password"); } } public ICommand LoginCommand { get; private set; } public LoginViewModel() { loginModel = new LoginModel(); LoginCommand = new RelayCommand(Login, CanLogin); } private void Login(object parameter) { // 在这里添加登入逻辑 if (CanLogin(null)) { Console.WriteLine($"登录成功：用户名={Username}, 密码={Password}"); } } private bool CanLogin(object parameter) { // 在这里添加验证逻辑 return !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password); } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }创建View（视图）接下来创建XAML界面用于用户输入和触发登录命令。 <TextBox Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}" Margin="0,5"/> <TextBox Text="{Binding Password, UpdateSourceTrigger=PropertyChanged}" Margin="0,5"/> 4.创建RelayCommandRelayCommand是一个实现了ICommand接口的类，用于绑定View中的命令到ViewModel的命令处理方法using System; using System.Windows.Input; namespace Login.Command { public class RelayCommand : ICommand { private readonly Action _execute; private readonly Func<object, bool> _canExecute; public RelayCommand(Action execute, Func<object, bool> canExecute = null) { _execute = execute ?? throw new ArgumentNullException(nameof(execute)); _canExecute = canExecute; } public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } public bool CanExecute(object parameter) { return _canExecute == null || _canExecute(parameter); } public void Execute(object parameter) { _execute(parameter); } } }5.绑定DataContext建立视图（UI）与视图模型（ViewModel）之间的数据绑定关系using System.Windows.Data; using Login.ViewModel; namespace Login { /// /// MainWindow.xaml 的交互逻辑 /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DataContext = new LoginViewModel(); } } }