using ComPDFKitViewer; using PDF_Master.Properties; using PDFSettings; using Prism.Mvvm; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; namespace PDF_Master.Model.SettingsDialog { public class InitialVIewModel:BindableBase { private ViewMode pageView; public ViewMode PageView { get { return pageView; } set { SetProperty(ref pageView, value); } } private FitMode zoomMode; public FitMode ZoomMode { get { return zoomMode; } set { SetProperty(ref zoomMode, value); } } private bool notShowBOTA; public bool NotShowBOTA { get { return notShowBOTA; } set { SetProperty(ref notShowBOTA, value); } } private bool rememberBOTA; public bool RememberBOTA { get { return rememberBOTA; } set { SetProperty(ref rememberBOTA, value); } } private bool isBOTAOpen; public bool IsBOTAOpen { get { return isBOTAOpen; } set { SetProperty(ref isBOTAOpen, value); } } private bool showOutLine; public bool ShowOutLine { get { return showOutLine; } set { SetProperty(ref showOutLine, value); } } private bool autoExpandProperty; public bool AutoExpandProperty { get { return autoExpandProperty; } set { SetProperty(ref autoExpandProperty, value); } } private bool clickOpenProperty; public bool ClickOpenProperty { get { return clickOpenProperty; } set { SetProperty(ref clickOpenProperty, value); } } private Color backGround; public Color BackGround { get { return backGround; } set { SetProperty(ref backGround, value); } } private Color backGroundInFulWindow; public Color BackGroundInFulWindow { get { return backGroundInFulWindow; } set { SetProperty(ref backGroundInFulWindow, value); } } private bool hignlightForm; public bool HignlightForm { get { return hignlightForm; } set { SetProperty(ref hignlightForm, value); } } private bool highlightLink; public bool HighlightLink { get { return highlightLink; } set { SetProperty(ref highlightLink, value); } } private Color formHighLightColor; public Color FormHighLightColor { get { return formHighLightColor; } set { SetProperty(ref formHighLightColor, value); } } private Color requiredFieldsColor; public Color RequiredFieldsColor { get { return requiredFieldsColor; } set { SetProperty(ref requiredFieldsColor, value); } } public InitialVIewModel() { InitFromSettings(); } private void InitFromSettings() { var view = Settings.Default.AppProperties.InitialVIew; this.PageView = view.PageView; this.ZoomMode = view.ZoomMode; this.NotShowBOTA = view.NotShowBOTA; this.RememberBOTA = view.RememberBOTA; this.ShowOutLine = view.ShowOutLine; this.AutoExpandProperty =view.AutoExpandProperty; this.ClickOpenProperty = view.ClickOpenProperty; this.BackGround = view.BackGround; this.BackGroundInFulWindow = view.BackGroundInFulWindow; this.HignlightForm = view.HignlightForm; this.HighlightLink = view.HighlightLink; this.FormHighLightColor = view.FormHighLightColor; this.RequiredFieldsColor = view.RequiredFieldsColor; } public void Save() { InitialVIewPropertyClass view = new InitialVIewPropertyClass(); view.PageView = this.PageView; view.ZoomMode = this.ZoomMode; view.NotShowBOTA = this.NotShowBOTA; view.RememberBOTA = this.RememberBOTA; view.ShowOutLine = this.ShowOutLine; view.AutoExpandProperty = this.AutoExpandProperty; view.ClickOpenProperty = this.ClickOpenProperty; view.BackGround = this.BackGround; view.BackGroundInFulWindow = this.BackGroundInFulWindow; view.HignlightForm = this.HignlightForm; view.HighlightLink = this.HighlightLink; view.FormHighLightColor = this.FormHighLightColor; view.RequiredFieldsColor = this.RequiredFieldsColor; Settings.Default.AppProperties.InitialVIew = view; } public void Reset() { var view = new InitialVIewPropertyClass(); this.PageView = view.PageView; this.ZoomMode = view.ZoomMode; this.NotShowBOTA = view.NotShowBOTA; this.RememberBOTA = view.RememberBOTA; this.ShowOutLine = view.ShowOutLine; this.AutoExpandProperty = view.AutoExpandProperty; this.ClickOpenProperty = view.ClickOpenProperty; this.BackGround = view.BackGround; this.BackGroundInFulWindow = view.BackGroundInFulWindow; this.HignlightForm = view.HignlightForm; this.HighlightLink = view.HighlightLink; this.FormHighLightColor = view.FormHighLightColor; this.RequiredFieldsColor = view.RequiredFieldsColor; } } }