123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Regions;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace PDF_Office.ViewModels.EditTools.Watermark
- {
- public class WatermarkCreateTextContentViewModel : BindableBase,INavigationAware
- {
- private List<string> _opacityList = new List<string>();
- public List<string> OpacityList
- {
- get { return _opacityList; }
- set
- {
- SetProperty(ref _opacityList, value);
- }
- }
- private void InitOpacityList()
- {
- OpacityList.Clear();
- for (int temp = 0; temp <= 100; temp += 10)
- {
- OpacityList.Add(temp.ToString() + " %");
- }
- }
- private List<string> _rotationList = new List<string>();
- public List<string> RotationList
- {
- get { return _rotationList; }
- set
- {
- SetProperty(ref _rotationList, value);
- }
- }
- private void InitRotationList()
- {
- RotationList.Clear();
- for (int temp = -45; temp <= 45; temp += 15)
- {
- RotationList.Add(temp.ToString());
- }
- }
- private List<string> _fontSizeList = new List<string>();
- public List<string> FontSizeList
- {
- get { return _fontSizeList; }
- set
- {
- SetProperty(ref _fontSizeList, value);
- }
- }
- private void InitFontSizeList()
- {
- FontSizeList.Clear();
- FontSizeList.Add("自动");
- for (int temp = 8; temp <= 15; temp += 1)
- {
- FontSizeList.Add(temp.ToString() + "pt");
- }
- }
- private List<string> _scaleList = new List<string>();
- public List<string> ScaleList
- {
- get { return _scaleList; }
- set
- {
- SetProperty(ref _scaleList, value);
- }
- }
- private void InitScaleList()
- {
- ScaleList.Clear();
- for (int temp = 0; temp <= 100; temp += 10)
- {
- ScaleList.Add(temp.ToString() + " %");
- }
- }
- private List<string> _isFrontList = new List<string>();
- public List<string> IsFrontList
- {
- get { return _isFrontList; }
- set
- {
- SetProperty(ref _isFrontList, value);
- }
- }
- private void InitIsFrontList()
- {
- IsFrontList.Clear();
- IsFrontList.Add("位于页面上方");
- IsFrontList.Add("位于页面下方");
- }
- private int _rotationValue = 0;
- public int RotationValue
- {
- get { return _rotationValue; }
- set
- {
- SetProperty(ref _rotationValue, value);
- }
- }
- private int _opacityValue = 100;
- public int OpacityValue
- {
- get { return _opacityValue; }
- set
- {
- SetProperty(ref _opacityValue, value);
- }
- }
- private int _relativeScaleValue = 50;
- public int RelativeScaleValue
- {
- get { return _relativeScaleValue; }
- set
- {
- SetProperty(ref _relativeScaleValue, value);
- }
- }
- private string _vertOffsetValue = "0";
- public string VertOffsetValue
- {
- get { return _vertOffsetValue; }
- set
- {
- SetProperty(ref _vertOffsetValue, value);
- }
- }
- private string _horizOffsetValue = "0";
- public string HorizOffsetValue
- {
- get { return _horizOffsetValue; }
- set
- {
- SetProperty(ref _horizOffsetValue, value);
- }
- }
- private string _verticalSpacingValue = "6";
- public string VerticalSpacingValue
- {
- get { return _verticalSpacingValue; }
- set
- {
- SetProperty(ref _verticalSpacingValue, value);
- }
- }
- private string _horizontalSpacingValue = "6";
- public string HorizontalSpacingValue
- {
- get { return _horizontalSpacingValue; }
- set
- {
- SetProperty(ref _horizontalSpacingValue, value);
- }
- }
- public WatermarkCreateTextContentViewModel()
- {
- }
- private void InitList() {
- InitOpacityList();
- InitFontSizeList();
- InitIsFrontList();
- InitRotationList();
- InitScaleList();
- }
- public bool IsNavigationTarget(NavigationContext navigationContext)
- {
- return true;
- }
- public void OnNavigatedFrom(NavigationContext navigationContext)
- {
- }
- public void OnNavigatedTo(NavigationContext navigationContext)
- {
- InitList();
- }
- }
- }
|