1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- 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.Navigation;
- using System.Windows.Shapes;
- namespace compdfkit_tools.Common
- {
- /// <summary>
- /// OpactiyControl.xaml 的交互逻辑
- /// </summary>
- public partial class CPDFOpacityUI : UserControl, INotifyPropertyChanged
- {
- private int _opacityValue = 100;
- public int OpacityValue
- {
- get
- {
- return _opacityValue;
- }
- set
- {
- _opacityValue = value;
- OnPropertyChanged(nameof(OpacityValue));
- OnOpacityChanged();
- }
- }
- //public event EventHandler<string> SetCustomOpacityEvent;
- //public event EventHandler<string> SetPresetOpacityEvent;
- //public event EventHandler<int> SliderValueChangedEvent;
- //public event EventHandler<int> SliderDragCompleted;
- public event EventHandler OpacityChanged;
- public event PropertyChangedEventHandler PropertyChanged;
- public CPDFOpacityUI()
- {
- InitializeComponent();
- this.DataContext = this;
- InitPresetNumberArray();
- }
- public void InitPresetNumberArray()
- {
- List<int> list = new List<int>();
- list.Add(25);
- list.Add(50);
- list.Add(75);
- list.Add(100);
- DropDownNumberBoxControl.InitPresetNumberArray(list);
- }
- private void OnOpacityChanged()
- {
- OpacityChanged?.Invoke(this, EventArgs.Empty);
- }
- protected void OnPropertyChanged(string propertyName)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
|