用于记录已添加的自定义样式和自定义控件模板,防止重复造轮子。 每条记录至少包含以下信息:名称、用途(仅用于某个具体功能or莫类型功能通用)、使用方法、效果、备注(有哪些要注意的地方) 样式 1.TabControlWithUnderLineStyle 样式位置:PDF Master\Styles\TabControlStyle.xaml 用途:用于调整HeaderPanel水平居中(不影响Content位置的前提下) 目前用于:阅读页工具栏、BOTA多页签部分 2.InsideBarBtnStyle 样式位置:PDF Master\Styles\TabControlStyle.xaml 用途:工具条的透明按钮 示例:D:\PDF_Master\PDF Master\Views\Tools\ToolsBarContent.xaml 3.CheckBoxStyle 样式位置:PDF Master\Styles\TabControlStyle.xaml 用途:是否设置相对目标页面比例的CheckBox,点击后变为黑底白勾 示例:D:\PDF_Master\PDF Master\Views\EditTools\Background\BackgroundCreateColorContent.xaml 备注:勾符号的Path可能需要重绘 自定义控件 1.LoadingContorl 位置:PDF Master\CustomControl\LoadingControl.xaml 用途:耗时操作过程中,显示圆形转圈的等待界面 使用方法:View里添加该控件、通过绑定VM里的Vibility类型变量来控制显示和隐藏,需要做异步处理才会显示出来 2.ToastControl 位置:PDF Master\CustomControl\ToastControl.xaml 用途:部分操作后,在界面中间显示提示,一段时候后自动渐隐消失 使用方法:VM里绑定一个bool变量,设为True时,Toast开始显示,开始渐隐时间(beginTime),和渐隐时间(Duration)在xaml里设置 3.WritableComboBox 位置:PDF Master\CustomControl\WritableComboBox.xaml 用途:设置页面范围 提供可选项:全部页面,奇数页,偶数页,自定义页面,可在xaml.cs中用Loading方式添加当前页选项 使用方法:绑定Text,搭配Helper/HomePageEditHelper.cs中的GetPagerange方法。 4.NumericUpDown 位置:PDF Master\CustomControl\NumericUpDown.xaml 用途:一个TextBox和两个按钮,可以输入数字,并通过旁边的按钮调节数字,每次+1/-1 使用方法:Text和后台属性绑定,按按钮或者输入数字时自动修改。 5.CommonWritableComboBox 位置:PDF Master\CustomControl\CommonWritableComboBox.xaml 用途:设置带单位可输入的ComboBox 提供可选项:绑定TypeSource设置可选项 使用方法:设置Text设置初始值,绑定Value获得无单位的真值,Unit设置单位无单位为" "空格,其他单位为单个字符单位"%" 6.PageTurningPreview 位置:PDF Master\CustomControl\PageTurningPreview.xaml 用途:普通预览控件,可进行翻页 使用方法:load自定义控件时设置PageIndexLists(负责控制页数),cpdfdocment(负责渲染的文件) 7.BatchStatus 位置:PDF Master\CustomControl\BatchStatus.xaml 用途:批量处理进度显示 使用方法:StatusValue{设置等于,"complete"(显示绿色背景勾形符号)、"error"(显示红色背景感叹符号)、 "wait"(显示等待闹钟)、"为数字时"(显示进度条)} 8.CheckPasswordDialog 位置:PDF Master\Views\Dialog\ToolsDialogs\SaftyDialogs\CheckPasswordDialog.xaml 用途: 密码校验 使用方法 ```C# VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs); //或 VerifyPasswordResult result = SecurityHelper.VerifyPasswordForSelectedPermissions(PDFViewer.Document, PermissionsSubset, dialogs); if (result.IsDiscryptied) { if (result.Password != null) { string filePath = PDFViewer.Document.FilePath; PDFViewer.CloseDocument(); PDFViewer.InitDocument(filePath); PDFViewer.Document.UnlockWithPassword(result.Password); PDFViewer.Load(); } ///TODO: ///此处填入需要执行的代码 } ``` 备注: SecurityHelper.VerifyPasswordByPasswordKind需要传入的参数:PDFViewer.Document,需要验证的密码类型(开启密码/权限密码),当前ViewModel的IDialogService对象 ecurityHelper.VerifyPasswordForSelectedPermissions需要传入的参数:PDFViewer.Document, 需要验证的权限子集(形如 枚举1|枚举2|枚举3),当前ViewModel的IDialogService对象。 返回值result对象包含两个成员:IsDiscryptied标志是否可以解锁/提权,Password对象标志当前正确的密码,当密码为空时表示当前无需输入。 该框架下的一些状态说明, IsDiscryptied == false 解锁/提权失败,拒绝下一步 IsDiscryptied == true password == null; 当前无需解锁/提权,不会唤起输入密码弹窗,直接进行下一步 IsDiscryptied == true password != null; 提权/解锁成功,共用当前PDFView的同权限级别操作全部开放,不再需要校验 * 下一步 *指解锁后的具体业务操作,例如唤起需求复制权限的弹窗等