提交记录新增UI/Controls/Base/CheckBox.cs+32 −0看文件
修改UI/Controls/Base/IconConverter.cs+5 −0看文件
修改UI/Controls/Base/IconTypes.cs+6 −1看文件
新增UI/Controls/Base/Img.cs+65 −0看文件
新增UI/Controls/Base/Text.cs+64 −0看文件
修改UI/Controls/Button/Button.cs+45 −10看文件
修改UI/Controls/Charts/ChartsItemTypeA.cs+5 −5看文件
修改UI/Controls/Charts/ChartsItemTypeCard.cs+5 −5看文件
新增UI/Controls/Select/ImageSelect.cs+85 −0看文件
新增UI/Controls/Select/Option.cs+44 −0看文件
新增UI/Controls/Select/Select.cs+111 −0看文件
新增UI/Controls/Select/SelectItemModel.cs+15 −0看文件
修改UI/Controls/Window/DefaultWindow.cs+9 −1看文件
新增UI/Controls/Window/ToastType.cs+19 −0看文件
新增UI/Themes/Base/CheckBox.xaml+26 −0看文件
新增UI/Themes/Base/Img.xaml+25 −0看文件
新增UI/Themes/Base/Text.xaml+18 −0看文件
修改UI/Themes/Generic.xaml+7 −0看文件
新增UI/Themes/Select/ImageSelect.xaml+55 −0看文件
新增UI/Themes/Select/Option.xaml+85 −0看文件
新增UI/Themes/Select/Select.xaml+60 −0看文件
修改UI/Themes/Window/DefaultWindow.xaml+13 −3看文件
| @@ -0,0 +1,32 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Text; | |
| 4 | 新增:using System.Windows; | |
| 5 | 新增:using System.Windows.Controls; | |
| 6 | 新增:using System.Windows.Media; | |
| 7 | 新增: | |
| 8 | 新增:namespace UI.Controls.Base | |
| 9 | 新增:{ | |
| 10 | 新增: public class CheckBox : Control | |
| 11 | 新增: { | |
| 12 | 新增: public bool IsChecked | |
| 13 | 新增: { | |
| 14 | 新增: get { return (bool)GetValue(IsCheckedProperty); } | |
| 15 | 新增: set { SetValue(IsCheckedProperty, value); } | |
| 16 | 新增: } | |
| 17 | 新增: public static readonly DependencyProperty IsCheckedProperty = | |
| 18 | 新增: DependencyProperty.Register("IsChecked", | |
| 19 | 新增: typeof(bool), | |
| 20 | 新增: typeof(CheckBox), new PropertyMetadata(false, new PropertyChangedCallback(OnPropertyChanged))); | |
| 21 | 新增: | |
| 22 | 新增: private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |
| 23 | 新增: { | |
| 24 | 新增: | |
| 25 | 新增: } | |
| 26 | 新增: | |
| 27 | 新增: public CheckBox() | |
| 28 | 新增: { | |
| 29 | 新增: DefaultStyleKey = typeof(CheckBox); | |
| 30 | 新增: } | |
| 31 | 新增: } | |
| 32 | 新增:} | |
| @@ -118,6 +118,11 @@ namespace UI.Controls.Base | ||
| 118 | 118 | {IconTypes.Blocked,"\xE733"}, |
| 119 | 119 | {IconTypes.Remove,"\xE738"}, |
| 120 | 120 | {IconTypes.Chart,"\xE999"}, |
| 121 | 新增: {IconTypes.Forward,"\xE72A"}, | |
| 122 | 新增: {IconTypes.FileImage,"\xF311"}, | |
| 123 | 新增: {IconTypes.CriticalErrorSolid,"\xF5C9"}, | |
| 124 | 新增: {IconTypes.TagGroup,"\xE3F6"}, | |
| 125 | 新增: {IconTypes.ClipboardListMirrored,"\xF0E4"}, | |
| 121 | 126 | |
| 122 | 127 | |
| 123 | 128 | }; |
| @@ -141,6 +141,11 @@ namespace UI.Controls.Base | ||
| 141 | 141 | Preview, |
| 142 | 142 | Blocked, |
| 143 | 143 | Remove, |
| 144 | 删除: Chart | |
| 144 | 新增: Chart, | |
| 145 | 新增: Forward, | |
| 146 | 新增: FileImage, | |
| 147 | 新增: CriticalErrorSolid, | |
| 148 | 新增: TagGroup, | |
| 149 | 新增: ClipboardListMirrored | |
| 145 | 150 | } |
| 146 | 151 | } |
| @@ -0,0 +1,65 @@ | ||
| 1 | 新增:using Core.Librarys.Image; | |
| 2 | 新增:using System; | |
| 3 | 新增:using System.Collections.Generic; | |
| 4 | 新增:using System.Linq; | |
| 5 | 新增:using System.Text; | |
| 6 | 新增:using System.Threading.Tasks; | |
| 7 | 新增:using System.Windows; | |
| 8 | 新增:using System.Windows.Controls; | |
| 9 | 新增:using System.Windows.Data; | |
| 10 | 新增:using System.Windows.Documents; | |
| 11 | 新增:using System.Windows.Input; | |
| 12 | 新增:using System.Windows.Media; | |
| 13 | 新增:using System.Windows.Media.Imaging; | |
| 14 | 新增:using System.Windows.Navigation; | |
| 15 | 新增:using System.Windows.Shapes; | |
| 16 | 新增: | |
| 17 | 新增:namespace UI.Controls.Base | |
| 18 | 新增:{ | |
| 19 | 新增: public class Img : Control | |
| 20 | 新增: { | |
| 21 | 新增: /// <summary> | |
| 22 | 新增: /// 图片链接 | |
| 23 | 新增: /// </summary> | |
| 24 | 新增: public string URL | |
| 25 | 新增: { | |
| 26 | 新增: get { return (string)GetValue(URLProperty); } | |
| 27 | 新增: set { SetValue(URLProperty, value); } | |
| 28 | 新增: } | |
| 29 | 新增: public static readonly DependencyProperty URLProperty = | |
| 30 | 新增: DependencyProperty.Register("URL", | |
| 31 | 新增: typeof(string), | |
| 32 | 新增: typeof(Img), new PropertyMetadata(new PropertyChangedCallback(OnPropertyChanged))); | |
| 33 | 新增: | |
| 34 | 新增: private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |
| 35 | 新增: { | |
| 36 | 新增: var control = (d as Img); | |
| 37 | 新增: if (e.Property == URLProperty && e.OldValue != e.NewValue) | |
| 38 | 新增: { | |
| 39 | 新增: control.Render(); | |
| 40 | 新增: } | |
| 41 | 新增: } | |
| 42 | 新增: | |
| 43 | 新增: private Image _image; | |
| 44 | 新增: public Img() | |
| 45 | 新增: { | |
| 46 | 新增: DefaultStyleKey = typeof(Img); | |
| 47 | 新增: } | |
| 48 | 新增: | |
| 49 | 新增: public override void OnApplyTemplate() | |
| 50 | 新增: { | |
| 51 | 新增: base.OnApplyTemplate(); | |
| 52 | 新增: _image = GetTemplateChild("image") as Image; | |
| 53 | 新增: Render(); | |
| 54 | 新增: } | |
| 55 | 新增: | |
| 56 | 新增: private void Render() | |
| 57 | 新增: { | |
| 58 | 新增: if (_image == null) | |
| 59 | 新增: { | |
| 60 | 新增: return; | |
| 61 | 新增: } | |
| 62 | 新增: _image.Source = Imager.Load(URL); | |
| 63 | 新增: } | |
| 64 | 新增: } | |
| 65 | 新增:} | |
| @@ -0,0 +1,64 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增:using System.Windows; | |
| 7 | 新增:using System.Windows.Controls; | |
| 8 | 新增: | |
| 9 | 新增:namespace UI.Controls.Base | |
| 10 | 新增:{ | |
| 11 | 新增: public class Text : Control | |
| 12 | 新增: { | |
| 13 | 新增: public string Content | |
| 14 | 新增: { | |
| 15 | 新增: get { return (string)GetValue(ContentProperty); } | |
| 16 | 新增: set { SetValue(ContentProperty, value); } | |
| 17 | 新增: } | |
| 18 | 新增: public static readonly DependencyProperty ContentProperty = | |
| 19 | 新增: DependencyProperty.Register("Content", | |
| 20 | 新增: typeof(string), | |
| 21 | 新增: typeof(Text)); | |
| 22 | 新增: public bool Value | |
| 23 | 新增: { | |
| 24 | 新增: get { return (bool)GetValue(ValueProperty); } | |
| 25 | 新增: set { SetValue(ValueProperty, value); } | |
| 26 | 新增: } | |
| 27 | 新增: public static readonly DependencyProperty ValueProperty = | |
| 28 | 新增: DependencyProperty.Register("Value", | |
| 29 | 新增: typeof(bool), | |
| 30 | 新增: typeof(Text), new PropertyMetadata(new PropertyChangedCallback(OnPropertyChanged))); | |
| 31 | 新增: | |
| 32 | 新增: private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |
| 33 | 新增: { | |
| 34 | 新增: Text c = (Text)d; | |
| 35 | 新增: | |
| 36 | 新增: c.SetContent(); | |
| 37 | 新增: | |
| 38 | 新增: } | |
| 39 | 新增: | |
| 40 | 新增: public string Content_ { get; set; } | |
| 41 | 新增: public Text() | |
| 42 | 新增: { | |
| 43 | 新增: DefaultStyleKey = typeof(Text); | |
| 44 | 新增: } | |
| 45 | 新增: | |
| 46 | 新增: public override void OnApplyTemplate() | |
| 47 | 新增: { | |
| 48 | 新增: base.OnApplyTemplate(); | |
| 49 | 新增: SetContent(); | |
| 50 | 新增: } | |
| 51 | 新增: | |
| 52 | 新增: private void SetContent() | |
| 53 | 新增: { | |
| 54 | 新增: if (string.IsNullOrEmpty(Content) || Content.IndexOf('?') == -1 || Content.IndexOf(':') == -1) | |
| 55 | 新增: { | |
| 56 | 新增: return; | |
| 57 | 新增: } | |
| 58 | 新增: | |
| 59 | 新增: string yes = Content.Substring(Content.IndexOf('?') + 1, Content.IndexOf(':') - 1); | |
| 60 | 新增: string no = Content.Substring(Content.IndexOf(':') + 1); | |
| 61 | 新增: Content_ = Value ? yes : no; | |
| 62 | 新增: } | |
| 63 | 新增: } | |
| 64 | 新增:} | |
| @@ -21,20 +21,55 @@ namespace UI.Controls.Button | ||
| 21 | 21 | DependencyProperty.Register("Icon", |
| 22 | 22 | typeof(IconTypes), |
| 23 | 23 | typeof(Button), new PropertyMetadata(IconTypes.None)); |
| 24 | 新增: | |
| 25 | 新增: public string Text | |
| 26 | 新增: { | |
| 27 | 新增: get { return (string)GetValue(TextProperty); } | |
| 28 | 新增: set { SetValue(TextProperty, value); } | |
| 29 | 新增: } | |
| 30 | 新增: public static readonly DependencyProperty TextProperty = | |
| 31 | 新增: DependencyProperty.Register("Text", | |
| 32 | 新增: typeof(string), | |
| 33 | 新增: typeof(Button)); | |
| 34 | 新增: public bool Value | |
| 35 | 新增: { | |
| 36 | 新增: get { return (bool)GetValue(ValueProperty); } | |
| 37 | 新增: set { SetValue(ValueProperty, value); } | |
| 38 | 新增: } | |
| 39 | 新增: public static readonly DependencyProperty ValueProperty = | |
| 40 | 新增: DependencyProperty.Register("Value", | |
| 41 | 新增: typeof(bool), | |
| 42 | 新增: typeof(Button), new PropertyMetadata(new PropertyChangedCallback(OnPropertyChanged))); | |
| 43 | 新增: | |
| 44 | 新增: private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |
| 45 | 新增: { | |
| 46 | 新增: Button button = (Button)d; | |
| 47 | 新增: | |
| 48 | 新增: button.SetContent(); | |
| 49 | 新增: | |
| 50 | 新增: } | |
| 51 | 新增: | |
| 24 | 52 | public Button() |
| 25 | 53 | { |
| 26 | 54 | DefaultStyleKey = typeof(Button); |
| 27 | 55 | } |
| 28 | 56 | |
| 29 | 删除: //protected override void OnMouseEnter(MouseEventArgs e) | |
| 30 | 删除: //{ | |
| 31 | 删除: // base.OnMouseEnter(e); | |
| 32 | 删除: // VisualStateManager.GoToState(this, "MouseOver", true); | |
| 33 | 删除: //} | |
| 34 | 删除: //protected override void OnMouseLeave(MouseEventArgs e) | |
| 35 | 删除: //{ | |
| 36 | 删除: // base.OnMouseLeave(e); | |
| 37 | 删除: // VisualStateManager.GoToState(this, "Normal", true); | |
| 38 | 删除: //} | |
| 57 | 新增: public override void OnApplyTemplate() | |
| 58 | 新增: { | |
| 59 | 新增: base.OnApplyTemplate(); | |
| 60 | 新增: SetContent(); | |
| 61 | 新增: } | |
| 62 | 新增: | |
| 63 | 新增: private void SetContent() | |
| 64 | 新增: { | |
| 65 | 新增: if (string.IsNullOrEmpty(Text) || Text.IndexOf('?') == -1 || Text.IndexOf(':') == -1) | |
| 66 | 新增: { | |
| 67 | 新增: return; | |
| 68 | 新增: } | |
| 69 | 新增: | |
| 70 | 新增: string yes = Text.Substring(Text.IndexOf('?') + 1, Text.IndexOf(':') - 1); | |
| 71 | 新增: string no = Text.Substring(Text.IndexOf(':') + 1); | |
| 72 | 新增: Content = Value ? yes : no; | |
| 73 | 新增: } | |
| 39 | 74 | } |
| 40 | 75 | } |
| @@ -109,11 +109,11 @@ namespace UI.Controls.Charts | ||
| 109 | 109 | isRendering = true; |
| 110 | 110 | NameTextObj.Text = Data.Name; |
| 111 | 111 | //对部分程序未获取程序名的程序使用路径中名字作为程序名 |
| 112 | 删除: if (Data.Name.Trim() == "" && Data.PopupText.Trim() != "") | |
| 113 | 删除: { | |
| 114 | 删除: FileInfo fi = new FileInfo(Data.PopupText); | |
| 115 | 删除: NameTextObj.Text = fi.Name.Replace(fi.Extension, ""); | |
| 116 | 删除: } | |
| 112 | 新增: //if (Data.Name.Trim() == "" && Data.PopupText.Trim() != "") | |
| 113 | 新增: //{ | |
| 114 | 新增: // FileInfo fi = new FileInfo(Data.PopupText); | |
| 115 | 新增: // NameTextObj.Text = fi.Name.Replace(fi.Extension, ""); | |
| 116 | 新增: //} | |
| 117 | 117 | |
| 118 | 118 | ValueTextObj.Text = Data.Tag; |
| 119 | 119 | IconObj.Source = Imager.Load(Data.Icon); |
| @@ -109,11 +109,11 @@ namespace UI.Controls.Charts | ||
| 109 | 109 | |
| 110 | 110 | //对部分程序未获取程序名的程序使用路径中名字作为程序名 |
| 111 | 111 | NameTextObj.Text = Data.Name; |
| 112 | 删除: if (Data.Name.Trim() == "" && Data.PopupText.Trim() != "") | |
| 113 | 删除: { | |
| 114 | 删除: FileInfo fi = new FileInfo(Data.PopupText); | |
| 115 | 删除: NameTextObj.Text = fi.Name.Replace(fi.Extension, ""); | |
| 116 | 删除: } | |
| 112 | 新增: //if (Data.Name.Trim() == "" && Data.PopupText.Trim() != "") | |
| 113 | 新增: //{ | |
| 114 | 新增: // FileInfo fi = new FileInfo(Data.PopupText); | |
| 115 | 新增: // NameTextObj.Text = fi.Name.Replace(fi.Extension, ""); | |
| 116 | 新增: //} | |
| 117 | 117 | |
| 118 | 118 | NameTextObj.SizeChanged += (e, c) => |
| 119 | 119 | { |
| @@ -0,0 +1,85 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增:using System.Windows; | |
| 7 | 新增:using System.Windows.Controls; | |
| 8 | 新增: | |
| 9 | 新增:namespace UI.Controls.Select | |
| 10 | 新增:{ | |
| 11 | 新增: public class ImageSelect : Control | |
| 12 | 新增: { | |
| 13 | 新增: public string URL | |
| 14 | 新增: { | |
| 15 | 新增: get { return (string)GetValue(URLProperty); } | |
| 16 | 新增: set { SetValue(URLProperty, value); } | |
| 17 | 新增: } | |
| 18 | 新增: public static readonly DependencyProperty URLProperty = | |
| 19 | 新增: DependencyProperty.Register("URL", | |
| 20 | 新增: typeof(string), | |
| 21 | 新增: typeof(ImageSelect), new PropertyMetadata(new PropertyChangedCallback(OnPropertyChanged))); | |
| 22 | 新增: | |
| 23 | 新增: private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |
| 24 | 新增: { | |
| 25 | 新增: var control = d as ImageSelect; | |
| 26 | 新增: if (e.Property == URLProperty) | |
| 27 | 新增: { | |
| 28 | 新增: control.IsSelected = !string.IsNullOrEmpty(control.URL); | |
| 29 | 新增: } | |
| 30 | 新增: } | |
| 31 | 新增: | |
| 32 | 新增: public bool IsSelected | |
| 33 | 新增: { | |
| 34 | 新增: get { return (bool)GetValue(IsSelectedProperty); } | |
| 35 | 新增: set { SetValue(IsSelectedProperty, value); } | |
| 36 | 新增: } | |
| 37 | 新增: public static readonly DependencyProperty IsSelectedProperty = | |
| 38 | 新增: DependencyProperty.Register("IsSelected", | |
| 39 | 新增: typeof(bool), | |
| 40 | 新增: typeof(ImageSelect), new PropertyMetadata(false)); | |
| 41 | 新增: | |
| 42 | 新增: public double ImageWidth | |
| 43 | 新增: { | |
| 44 | 新增: get { return (double)GetValue(ImageWidthProperty); } | |
| 45 | 新增: set { SetValue(ImageWidthProperty, value); } | |
| 46 | 新增: } | |
| 47 | 新增: public static readonly DependencyProperty ImageWidthProperty = | |
| 48 | 新增: DependencyProperty.Register("ImageWidth", | |
| 49 | 新增: typeof(double), | |
| 50 | 新增: typeof(ImageSelect), new PropertyMetadata((double)30)); | |
| 51 | 新增: | |
| 52 | 新增: public double ImageHeight | |
| 53 | 新增: { | |
| 54 | 新增: get { return (double)GetValue(ImageHeightProperty); } | |
| 55 | 新增: set { SetValue(ImageHeightProperty, value); } | |
| 56 | 新增: } | |
| 57 | 新增: public static readonly DependencyProperty ImageHeightProperty = | |
| 58 | 新增: DependencyProperty.Register("ImageHeight", | |
| 59 | 新增: typeof(double), | |
| 60 | 新增: typeof(ImageSelect), new PropertyMetadata((double)30)); | |
| 61 | 新增: public Command SelectCommand { get; set; } | |
| 62 | 新增: public ImageSelect() | |
| 63 | 新增: { | |
| 64 | 新增: DefaultStyleKey = typeof(ImageSelect); | |
| 65 | 新增: SelectCommand = new Command(new Action<object>(OnSelect)); | |
| 66 | 新增: } | |
| 67 | 新增: | |
| 68 | 新增: private void OnSelect(object obj) | |
| 69 | 新增: { | |
| 70 | 新增: Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); | |
| 71 | 新增: | |
| 72 | 新增: | |
| 73 | 新增: dlg.Filter = "PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg"; | |
| 74 | 新增: | |
| 75 | 新增: | |
| 76 | 新增: bool? result = dlg.ShowDialog(); | |
| 77 | 新增: | |
| 78 | 新增: | |
| 79 | 新增: if (result == true) | |
| 80 | 新增: { | |
| 81 | 新增: URL = dlg.FileName; | |
| 82 | 新增: } | |
| 83 | 新增: } | |
| 84 | 新增: } | |
| 85 | 新增:} | |
| @@ -0,0 +1,44 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增:using System.Windows; | |
| 7 | 新增:using System.Windows.Controls; | |
| 8 | 新增: | |
| 9 | 新增:namespace UI.Controls.Select | |
| 10 | 新增:{ | |
| 11 | 新增: public class Option : Control | |
| 12 | 新增: { | |
| 13 | 新增: public bool IsChecked | |
| 14 | 新增: { | |
| 15 | 新增: get { return (bool)GetValue(IsCheckedProperty); } | |
| 16 | 新增: set { SetValue(IsCheckedProperty, value); } | |
| 17 | 新增: } | |
| 18 | 新增: public static readonly DependencyProperty IsCheckedProperty = | |
| 19 | 新增: DependencyProperty.Register("IsChecked", | |
| 20 | 新增: typeof(bool), | |
| 21 | 新增: typeof(Option), new PropertyMetadata(false)); | |
| 22 | 新增: | |
| 23 | 新增: public SelectItemModel Value | |
| 24 | 新增: { | |
| 25 | 新增: get { return (SelectItemModel)GetValue(ValueProperty); } | |
| 26 | 新增: set { SetValue(ValueProperty, value); } | |
| 27 | 新增: } | |
| 28 | 新增: public static readonly DependencyProperty ValueProperty = | |
| 29 | 新增: DependencyProperty.Register("Value", | |
| 30 | 新增: typeof(SelectItemModel), | |
| 31 | 新增: typeof(Option)); | |
| 32 | 新增: public Option() | |
| 33 | 新增: { | |
| 34 | 新增: DefaultStyleKey = typeof(Option); | |
| 35 | 新增: | |
| 36 | 新增: MouseLeftButtonUp += Option_MouseLeftButtonUp; | |
| 37 | 新增: } | |
| 38 | 新增: | |
| 39 | 新增: private void Option_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) | |
| 40 | 新增: { | |
| 41 | 新增: IsChecked = !IsChecked; | |
| 42 | 新增: } | |
| 43 | 新增: } | |
| 44 | 新增:} | |
| @@ -0,0 +1,111 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增:using System.Windows; | |
| 7 | 新增:using System.Windows.Controls; | |
| 8 | 新增: | |
| 9 | 新增:namespace UI.Controls.Select | |
| 10 | 新增:{ | |
| 11 | 新增: public class Select : Control | |
| 12 | 新增: { | |
| 13 | 新增: public bool IsOpen | |
| 14 | 新增: { | |
| 15 | 新增: get { return (bool)GetValue(IsOpenProperty); } | |
| 16 | 新增: set { SetValue(IsOpenProperty, value); } | |
| 17 | 新增: } | |
| 18 | 新增: public static readonly DependencyProperty IsOpenProperty = | |
| 19 | 新增: DependencyProperty.Register("IsOpen", | |
| 20 | 新增: typeof(bool), | |
| 21 | 新增: typeof(Select)); | |
| 22 | 新增: public List<SelectItemModel> Options | |
| 23 | 新增: { | |
| 24 | 新增: get { return (List<SelectItemModel>)GetValue(OptionsProperty); } | |
| 25 | 新增: set { SetValue(OptionsProperty, value); } | |
| 26 | 新增: } | |
| 27 | 新增: public static readonly DependencyProperty OptionsProperty = | |
| 28 | 新增: DependencyProperty.Register("Options", | |
| 29 | 新增: typeof(List<SelectItemModel>), | |
| 30 | 新增: typeof(Select), new PropertyMetadata(new PropertyChangedCallback(OnPropertyChanged))); | |
| 31 | 新增: | |
| 32 | 新增: private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |
| 33 | 新增: { | |
| 34 | 新增: var control = (d as Select); | |
| 35 | 新增: if (e.Property == OptionsProperty && e.OldValue != e.NewValue) | |
| 36 | 新增: { | |
| 37 | 新增: control.RenderOptions(); | |
| 38 | 新增: } | |
| 39 | 新增: if (e.Property == SelectItemProperty && e.NewValue != e.OldValue) | |
| 40 | 新增: { | |
| 41 | 新增: control.OnSelectedItemChange(); | |
| 42 | 新增: } | |
| 43 | 新增: } | |
| 44 | 新增: | |
| 45 | 新增: public SelectItemModel SelectedItem | |
| 46 | 新增: { | |
| 47 | 新增: get { return (SelectItemModel)GetValue(SelectItemProperty); } | |
| 48 | 新增: set { SetValue(SelectItemProperty, value); } | |
| 49 | 新增: } | |
| 50 | 新增: | |
| 51 | 新增: public static readonly DependencyProperty SelectItemProperty = DependencyProperty.Register("SelectedItem", typeof(SelectItemModel), typeof(Select), new PropertyMetadata(new PropertyChangedCallback(OnPropertyChanged))); | |
| 52 | 新增: | |
| 53 | 新增: | |
| 54 | 新增: private StackPanel _optionsContainer; | |
| 55 | 新增: public Select() | |
| 56 | 新增: { | |
| 57 | 新增: DefaultStyleKey = typeof(Select); | |
| 58 | 新增: | |
| 59 | 新增: MouseLeftButtonUp += Select_MouseLeftButtonUp; | |
| 60 | 新增: } | |
| 61 | 新增: | |
| 62 | 新增: private void Select_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) | |
| 63 | 新增: { | |
| 64 | 新增: IsOpen = !IsOpen; | |
| 65 | 新增: } | |
| 66 | 新增: | |
| 67 | 新增: public override void OnApplyTemplate() | |
| 68 | 新增: { | |
| 69 | 新增: base.OnApplyTemplate(); | |
| 70 | 新增: _optionsContainer = GetTemplateChild("OptionsContainer") as StackPanel; | |
| 71 | 新增: this.RenderOptions(); | |
| 72 | 新增: } | |
| 73 | 新增: | |
| 74 | 新增: public void RenderOptions() | |
| 75 | 新增: { | |
| 76 | 新增: if (_optionsContainer == null || Options == null) | |
| 77 | 新增: { | |
| 78 | 新增: return; | |
| 79 | 新增: } | |
| 80 | 新增: | |
| 81 | 新增: _optionsContainer?.Children.Clear(); | |
| 82 | 新增: | |
| 83 | 新增: foreach (var item in Options) | |
| 84 | 新增: { | |
| 85 | 新增: var option = new Option(); | |
| 86 | 新增: option.Value = item; | |
| 87 | 新增: option.IsChecked = SelectedItem?.Name == item.Name; | |
| 88 | 新增: option.MouseLeftButtonUp += Option_MouseLeftButtonUp; ; | |
| 89 | 新增: _optionsContainer.Children.Add(option); | |
| 90 | 新增: } | |
| 91 | 新增: } | |
| 92 | 新增: | |
| 93 | 新增: private void Option_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) | |
| 94 | 新增: { | |
| 95 | 新增: var option = sender as Option; | |
| 96 | 新增: if (option != null) | |
| 97 | 新增: { | |
| 98 | 新增: SelectedItem = option.Value; | |
| 99 | 新增: OnSelectedItemChange(); | |
| 100 | 新增: } | |
| 101 | 新增: } | |
| 102 | 新增: | |
| 103 | 新增: private void OnSelectedItemChange() | |
| 104 | 新增: { | |
| 105 | 新增: foreach (Option option in _optionsContainer.Children) | |
| 106 | 新增: { | |
| 107 | 新增: option.IsChecked = SelectedItem.Name == option.Value.Name; | |
| 108 | 新增: } | |
| 109 | 新增: } | |
| 110 | 新增: } | |
| 111 | 新增:} | |
| @@ -0,0 +1,15 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增: | |
| 7 | 新增:namespace UI.Controls.Select | |
| 8 | 新增:{ | |
| 9 | 新增: public class SelectItemModel | |
| 10 | 新增: { | |
| 11 | 新增: public string Name { get; set; } | |
| 12 | 新增: public string Img { get; set; } | |
| 13 | 新增: public object Data { get; set; } | |
| 14 | 新增: } | |
| 15 | 新增:} | |
| @@ -56,7 +56,15 @@ namespace UI.Controls.Window | ||
| 56 | 56 | get { return (string)GetValue(ToastContentProperty); } |
| 57 | 57 | set { SetValue(ToastContentProperty, value); } |
| 58 | 58 | } |
| 59 | 删除: | |
| 59 | 新增: public static readonly DependencyProperty ToastTypeProperty = DependencyProperty.Register("ToastType", typeof(ToastType), typeof(DefaultWindow), new PropertyMetadata(ToastType.Info)); | |
| 60 | 新增: /// <summary> | |
| 61 | 新增: /// toast type | |
| 62 | 新增: /// </summary> | |
| 63 | 新增: public ToastType ToastType | |
| 64 | 新增: { | |
| 65 | 新增: get { return (ToastType)GetValue(ToastTypeProperty); } | |
| 66 | 新增: set { SetValue(ToastTypeProperty, value); } | |
| 67 | 新增: } | |
| 60 | 68 | public static readonly DependencyProperty PageContainerProperty = DependencyProperty.Register("PageContainer", typeof(PageContainer), typeof(DefaultWindow), new PropertyMetadata(null, new PropertyChangedCallback(OnPageContainerChanged))); |
| 61 | 69 | public PageContainer PageContainer { get { return (PageContainer)GetValue(PageContainerProperty); } set { SetValue(PageContainerProperty, value); } } |
| 62 | 70 | #region 最小化按钮显示状态 |
| @@ -0,0 +1,19 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增: | |
| 7 | 新增:namespace UI.Controls.Window | |
| 8 | 新增:{ | |
| 9 | 新增: /// <summary> | |
| 10 | 新增: /// 通知类型 | |
| 11 | 新增: /// </summary> | |
| 12 | 新增: public enum ToastType | |
| 13 | 新增: { | |
| 14 | 新增: Info, | |
| 15 | 新增: Error, | |
| 16 | 新增: Warning, | |
| 17 | 新增: Success | |
| 18 | 新增: } | |
| 19 | 新增:} | |
| @@ -0,0 +1,26 @@ | ||
| 1 | 新增:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 2 | 新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| 3 | 新增: xmlns:local="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: <Style TargetType="{x:Type local:CheckBox}"> | |
| 5 | 新增: <Setter Property="SnapsToDevicePixels" | |
| 6 | 新增: Value="true" /> | |
| 7 | 新增: | |
| 8 | 新增: <Setter Property="MinWidth" Value="18"/> | |
| 9 | 新增: <Setter Property="MinHeight" Value="18"/> | |
| 10 | 新增: <Setter Property="FontSize" Value="16"/> | |
| 11 | 新增: <Setter Property="FontFamily" Value="pack://application:,,,/Tai;component/Resources/Fonts/#Fabric MDL2 Assets"/> | |
| 12 | 新增: <Setter Property="Background" Value="Transparent"/> | |
| 13 | 新增: | |
| 14 | 新增: <Setter Property="Template"> | |
| 15 | 新增: <Setter.Value> | |
| 16 | 新增: <ControlTemplate TargetType="{x:Type local:CheckBox}"> | |
| 17 | 新增: <Border Background="{TemplateBinding Background}"> | |
| 18 | 新增: | |
| 19 | 新增: | |
| 20 | 新增: </Border> | |
| 21 | 新增: | |
| 22 | 新增: </ControlTemplate> | |
| 23 | 新增: </Setter.Value> | |
| 24 | 新增: </Setter> | |
| 25 | 新增: </Style> | |
| 26 | 新增:</ResourceDictionary> | |
| 文件末尾没有换行 | ||
| @@ -0,0 +1,25 @@ | ||
| 1 | 新增:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 2 | 新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| 3 | 新增: xmlns:local="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: <Style TargetType="{x:Type local:Img}"> | |
| 5 | 新增: <Setter Property="SnapsToDevicePixels" | |
| 6 | 新增: Value="true" /> | |
| 7 | 新增: | |
| 8 | 新增: <Setter Property="MinWidth" Value="18"/> | |
| 9 | 新增: <Setter Property="MinHeight" Value="18"/> | |
| 10 | 新增: <Setter Property="FontSize" Value="16"/> | |
| 11 | 新增: <Setter Property="FontFamily" Value="pack://application:,,,/Tai;component/Resources/Fonts/#Fabric MDL2 Assets"/> | |
| 12 | 新增: <Setter Property="Background" Value="Transparent"/> | |
| 13 | 新增: | |
| 14 | 新增: <Setter Property="Template"> | |
| 15 | 新增: <Setter.Value> | |
| 16 | 新增: <ControlTemplate TargetType="{x:Type local:Img}"> | |
| 17 | 新增: <Border Background="{TemplateBinding Background}"> | |
| 18 | 新增: <Image x:Name="image" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/> | |
| 19 | 新增: </Border> | |
| 20 | 新增: | |
| 21 | 新增: </ControlTemplate> | |
| 22 | 新增: </Setter.Value> | |
| 23 | 新增: </Setter> | |
| 24 | 新增: </Style> | |
| 25 | 新增:</ResourceDictionary> | |
| 文件末尾没有换行 | ||
| @@ -0,0 +1,18 @@ | ||
| 1 | 新增:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 2 | 新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| 3 | 新增: xmlns:local="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: <Style TargetType="{x:Type local:Text}"> | |
| 5 | 新增: <Setter Property="SnapsToDevicePixels" | |
| 6 | 新增: Value="true" /> | |
| 7 | 新增: <Setter Property="Template"> | |
| 8 | 新增: <Setter.Value> | |
| 9 | 新增: <ControlTemplate TargetType="{x:Type local:Text}"> | |
| 10 | 新增: <Border SnapsToDevicePixels="True" Background="{TemplateBinding Background}"> | |
| 11 | 新增: <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Text}}, Path=Content_}"/> | |
| 12 | 新增: </Border> | |
| 13 | 新增: | |
| 14 | 新增: </ControlTemplate> | |
| 15 | 新增: </Setter.Value> | |
| 16 | 新增: </Setter> | |
| 17 | 新增: </Style> | |
| 18 | 新增:</ResourceDictionary> | |
| 文件末尾没有换行 | ||
| @@ -8,6 +8,9 @@ | ||
| 8 | 8 | <ResourceDictionary Source="/Tai;component/Themes/Base/Icon.xaml"/> |
| 9 | 9 | <ResourceDictionary Source="/Tai;component/Themes/Base/Placeholder.xaml"/> |
| 10 | 10 | <ResourceDictionary Source="/Tai;component/Themes/Base/EmptyData.xaml"/> |
| 11 | 新增: <ResourceDictionary Source="/Tai;component/Themes/Base/Img.xaml"/> | |
| 12 | 新增: <ResourceDictionary Source="/Tai;component/Themes/Base/CheckBox.xaml"/> | |
| 13 | 新增: <ResourceDictionary Source="/Tai;component/Themes/Base/Text.xaml"/> | |
| 11 | 14 | |
| 12 | 15 | <ResourceDictionary Source="/Tai;component/Themes/PageContainer.xaml"/> |
| 13 | 16 | <ResourceDictionary Source="/Tai;component/Themes/Charts/Charts.xaml"/> |
| @@ -28,6 +31,10 @@ | ||
| 28 | 31 | <ResourceDictionary Source="/Tai;component/Themes/List/BaseList.xaml"/> |
| 29 | 32 | <ResourceDictionary Source="/Tai;component/Themes/List/BaseListItem.xaml"/> |
| 30 | 33 | |
| 34 | 新增: <ResourceDictionary Source="/Tai;component/Themes/Select/Select.xaml"/> | |
| 35 | 新增: <ResourceDictionary Source="/Tai;component/Themes/Select/Option.xaml"/> | |
| 36 | 新增: <ResourceDictionary Source="/Tai;component/Themes/Select/ImageSelect.xaml"/> | |
| 37 | 新增: | |
| 31 | 38 | </ResourceDictionary.MergedDictionaries> |
| 32 | 39 | |
| 33 | 40 | </ResourceDictionary> |
| @@ -0,0 +1,55 @@ | ||
| 1 | 新增:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 2 | 新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| 3 | 新增: xmlns:local="clr-namespace:UI.Controls.Select" xmlns:base="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: | |
| 5 | 新增: | |
| 6 | 新增: <Style TargetType="{x:Type local:ImageSelect}"> | |
| 7 | 新增: <Setter Property="SnapsToDevicePixels" | |
| 8 | 新增: Value="True" /> | |
| 9 | 新增: | |
| 10 | 新增: <Setter Property="Background" Value="Transparent"/> | |
| 11 | 新增: <Setter Property="ToolTip" Value="选择图片"/> | |
| 12 | 新增: | |
| 13 | 新增: <Setter Property="Template"> | |
| 14 | 新增: <Setter.Value> | |
| 15 | 新增: <ControlTemplate TargetType="{x:Type local:ImageSelect}"> | |
| 16 | 新增: <Border SnapsToDevicePixels="True" Background="{TemplateBinding Background}" HorizontalAlignment="Left" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> | |
| 17 | 新增: <Border.InputBindings> | |
| 18 | 新增: <MouseBinding Gesture="LeftClick" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ImageSelect}}, Path=SelectCommand}"/> | |
| 19 | 新增: </Border.InputBindings> | |
| 20 | 新增: <Grid> | |
| 21 | 新增: <Border x:Name="Choose" Background="#f7f8fa" Padding="20" CornerRadius="10"> | |
| 22 | 新增: <Grid HorizontalAlignment="Center"> | |
| 23 | 新增: <Grid.RowDefinitions> | |
| 24 | 新增: <RowDefinition Height="*"/> | |
| 25 | 新增: <RowDefinition Height="*"/> | |
| 26 | 新增: </Grid.RowDefinitions> | |
| 27 | 新增: <base:Icon IconType="FileImage" Foreground="#2b20d9" VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
| 28 | 新增: | |
| 29 | 新增: <TextBlock Text="选择图片" Grid.Row="1" Margin="0,10,0,0"/> | |
| 30 | 新增: </Grid> | |
| 31 | 新增: </Border> | |
| 32 | 新增: <Border x:Name="Img" BorderBrush="#f7f8fa" BorderThickness="1" CornerRadius="10" Padding="10"> | |
| 33 | 新增: <base:Img URL="{TemplateBinding URL}" Width="{TemplateBinding ImageWidth}" Height="{TemplateBinding ImageHeight}"/> | |
| 34 | 新增: </Border> | |
| 35 | 新增: | |
| 36 | 新增: </Grid> | |
| 37 | 新增: </Border> | |
| 38 | 新增: <ControlTemplate.Triggers> | |
| 39 | 新增: <Trigger Property="IsMouseOver" Value="True"> | |
| 40 | 新增: <Setter Property="Background" TargetName="Choose" Value="#FFE8E6FF"/> | |
| 41 | 新增: </Trigger> | |
| 42 | 新增: <Trigger Property="IsSelected" Value="True"> | |
| 43 | 新增: <Setter Property="Visibility" TargetName="Img" Value="Visible"/> | |
| 44 | 新增: <Setter Property="Visibility" TargetName="Choose" Value="Collapsed"/> | |
| 45 | 新增: </Trigger> | |
| 46 | 新增: <Trigger Property="IsSelected" Value="False"> | |
| 47 | 新增: <Setter Property="Visibility" TargetName="Img" Value="Collapsed"/> | |
| 48 | 新增: <Setter Property="Visibility" TargetName="Choose" Value="Visible"/> | |
| 49 | 新增: </Trigger> | |
| 50 | 新增: </ControlTemplate.Triggers> | |
| 51 | 新增: </ControlTemplate> | |
| 52 | 新增: </Setter.Value> | |
| 53 | 新增: </Setter> | |
| 54 | 新增: </Style> | |
| 55 | 新增:</ResourceDictionary> | |
| 文件末尾没有换行 | ||
| @@ -0,0 +1,85 @@ | ||
| 1 | 新增:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 2 | 新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| 3 | 新增: xmlns:local="clr-namespace:UI.Controls.Select" xmlns:base="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: <Style TargetType="{x:Type local:Option}"> | |
| 5 | 新增: <Setter Property="SnapsToDevicePixels" | |
| 6 | 新增: Value="true" /> | |
| 7 | 新增: | |
| 8 | 新增: <Setter Property="Background" Value="Transparent"/> | |
| 9 | 新增: <!--<Setter Property="Height" Value="15"/>--> | |
| 10 | 新增: | |
| 11 | 新增: <Setter Property="Template"> | |
| 12 | 新增: <Setter.Value> | |
| 13 | 新增: <ControlTemplate TargetType="{x:Type local:Option}"> | |
| 14 | 新增: <Border CornerRadius="10" Background="{TemplateBinding Background}" Padding="10,8"> | |
| 15 | 新增: | |
| 16 | 新增: <Border> | |
| 17 | 新增: <Grid> | |
| 18 | 新增: <Grid.ColumnDefinitions> | |
| 19 | 新增: <ColumnDefinition Width="30"/> | |
| 20 | 新增: | |
| 21 | 新增: <ColumnDefinition Width="40"/> | |
| 22 | 新增: <ColumnDefinition Width="*"/> | |
| 23 | 新增: | |
| 24 | 新增: </Grid.ColumnDefinitions> | |
| 25 | 新增: <!--标记是否选中--> | |
| 26 | 新增: <Border> | |
| 27 | 新增: <Grid> | |
| 28 | 新增: <!--选中--> | |
| 29 | 新增: <Border | |
| 30 | 新增: Width="20" | |
| 31 | 新增: Height="20" | |
| 32 | 新增: Background="#FFA9A4FD" | |
| 33 | 新增: BorderBrush="#2b21d9" | |
| 34 | 新增: BorderThickness="2" | |
| 35 | 新增: CornerRadius="20" | |
| 36 | 新增: x:Name="CheckStyle" Visibility="Collapsed"> | |
| 37 | 新增: <Rectangle Width="10" Height="10" RadiusX="10" RadiusY="10" Fill="White" VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
| 38 | 新增: </Border> | |
| 39 | 新增: | |
| 40 | 新增: <!--未选中--> | |
| 41 | 新增: <Border | |
| 42 | 新增: Width="20" | |
| 43 | 新增: Height="20" | |
| 44 | 新增: BorderBrush="#FFECECEC" | |
| 45 | 新增: BorderThickness="2" | |
| 46 | 新增: CornerRadius="20" | |
| 47 | 新增: x:Name="UnCheckStyle" Visibility="Collapsed"> | |
| 48 | 新增: | |
| 49 | 新增: </Border> | |
| 50 | 新增: </Grid> | |
| 51 | 新增: </Border> | |
| 52 | 新增: <!--图标--> | |
| 53 | 新增: <Border Grid.Column="1" Margin="5,0,0,0"> | |
| 54 | 新增: <base:Img URL="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Option}}, Path=Value.Img}" Width="25" Height="25" VerticalAlignment="Center"/> | |
| 55 | 新增: </Border> | |
| 56 | 新增: <!--文字--> | |
| 57 | 新增: <Border Grid.Column="2"> | |
| 58 | 新增: <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Option}}, Path=Value.Name}" VerticalAlignment="Center" Margin="5,0,0,0"/> | |
| 59 | 新增: </Border> | |
| 60 | 新增: </Grid> | |
| 61 | 新增: </Border> | |
| 62 | 新增: | |
| 63 | 新增: | |
| 64 | 新增: | |
| 65 | 新增: | |
| 66 | 新增: </Border> | |
| 67 | 新增: <ControlTemplate.Triggers> | |
| 68 | 新增: <Trigger Property="IsChecked" Value="True"> | |
| 69 | 新增: <Setter TargetName="CheckStyle" Property="Visibility" Value="Visible"/> | |
| 70 | 新增: <Setter TargetName="UnCheckStyle" Property="Visibility" Value="Collapsed"/> | |
| 71 | 新增: </Trigger> | |
| 72 | 新增: <Trigger Property="IsChecked" Value="False"> | |
| 73 | 新增: <Setter TargetName="CheckStyle" Property="Visibility" Value="Collapsed"/> | |
| 74 | 新增: <Setter TargetName="UnCheckStyle" Property="Visibility" Value="Visible"/> | |
| 75 | 新增: </Trigger> | |
| 76 | 新增: <Trigger Property="IsMouseOver" Value="True"> | |
| 77 | 新增: <Setter Property="Background" Value="#F7F6F9"/> | |
| 78 | 新增: </Trigger> | |
| 79 | 新增: </ControlTemplate.Triggers> | |
| 80 | 新增: | |
| 81 | 新增: </ControlTemplate> | |
| 82 | 新增: </Setter.Value> | |
| 83 | 新增: </Setter> | |
| 84 | 新增: </Style> | |
| 85 | 新增:</ResourceDictionary> | |
| 文件末尾没有换行 | ||
| @@ -0,0 +1,60 @@ | ||
| 1 | 新增:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 2 | 新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| 3 | 新增: xmlns:local="clr-namespace:UI.Controls.Select" xmlns:base="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: | |
| 5 | 新增: | |
| 6 | 新增: <Style TargetType="{x:Type local:Select}"> | |
| 7 | 新增: <Setter Property="SnapsToDevicePixels" | |
| 8 | 新增: Value="true" /> | |
| 9 | 新增: | |
| 10 | 新增: <Setter Property="Background" Value="Transparent"/> | |
| 11 | 新增: | |
| 12 | 新增: <Setter Property="Template"> | |
| 13 | 新增: <Setter.Value> | |
| 14 | 新增: <ControlTemplate TargetType="{x:Type local:Select}"> | |
| 15 | 新增: <Border Background="{TemplateBinding Background}" HorizontalAlignment="Left" > | |
| 16 | 新增: <Grid> | |
| 17 | 新增: <!--当前选择项--> | |
| 18 | 新增: <Border x:Name="Main" Margin="0,10,0,0" Background="#f9f9f9" HorizontalAlignment="Left" Padding="15,5" CornerRadius="5"> | |
| 19 | 新增: <Border.Effect> | |
| 20 | 新增: <DropShadowEffect Color="#d8d2d2" BlurRadius="1" Direction="300" ShadowDepth="4" Opacity="0.1" RenderingBias="Performance" ></DropShadowEffect> | |
| 21 | 新增: </Border.Effect> | |
| 22 | 新增: <StackPanel Orientation="Horizontal"> | |
| 23 | 新增: <base:Img URL="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Select}}, Path=SelectedItem.Img}" Width="30" Height="30" VerticalAlignment="Center"/> | |
| 24 | 新增: <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Select}}, Path=SelectedItem.Name}" VerticalAlignment="Center" Margin="5,0,0,0"/> | |
| 25 | 新增: </StackPanel> | |
| 26 | 新增: </Border> | |
| 27 | 新增: | |
| 28 | 新增: <!--选择--> | |
| 29 | 新增: <Popup | |
| 30 | 新增: Placement="Bottom" | |
| 31 | 新增: PlacementTarget="{Binding ElementName=Main}" | |
| 32 | 新增: IsOpen="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Select}}, Path=IsOpen,Mode=TwoWay}" AllowsTransparency="True" StaysOpen="False"> | |
| 33 | 新增: <Border | |
| 34 | 新增: CornerRadius="10" | |
| 35 | 新增: BorderBrush="#CCC" | |
| 36 | 新增: BorderThickness="1" | |
| 37 | 新增: Background="White" Padding="10" MaxHeight="300" Margin="10"> | |
| 38 | 新增: <Border.Effect> | |
| 39 | 新增: <DropShadowEffect BlurRadius="6" ShadowDepth="2" Direction="315" Color="Gray" Opacity=".1"/> | |
| 40 | 新增: </Border.Effect> | |
| 41 | 新增: <ScrollViewer HorizontalScrollBarVisibility="Disabled"> | |
| 42 | 新增: <StackPanel x:Name="OptionsContainer"> | |
| 43 | 新增: | |
| 44 | 新增: </StackPanel> | |
| 45 | 新增: </ScrollViewer> | |
| 46 | 新增: | |
| 47 | 新增: </Border> | |
| 48 | 新增: </Popup> | |
| 49 | 新增: </Grid> | |
| 50 | 新增: </Border> | |
| 51 | 新增: <ControlTemplate.Triggers> | |
| 52 | 新增: <Trigger Property="IsMouseOver" Value="True"> | |
| 53 | 新增: <Setter Property="Background" TargetName="Main" Value="#FFE8E6FF"/> | |
| 54 | 新增: </Trigger> | |
| 55 | 新增: </ControlTemplate.Triggers> | |
| 56 | 新增: </ControlTemplate> | |
| 57 | 新增: </Setter.Value> | |
| 58 | 新增: </Setter> | |
| 59 | 新增: </Style> | |
| 60 | 新增:</ResourceDictionary> | |
| 文件末尾没有换行 | ||
| @@ -177,7 +177,7 @@ | ||
| 177 | 177 | <!--内容--> |
| 178 | 178 | <Border |
| 179 | 179 | Padding="15,15" |
| 180 | 删除: CornerRadius="6" | |
| 180 | 新增: CornerRadius="12" | |
| 181 | 181 | MaxWidth="320" |
| 182 | 182 | x:Name="ToastBorder" Background="White" HorizontalAlignment="Center" VerticalAlignment="Top" Panel.ZIndex="1000"> |
| 183 | 183 | <Border.RenderTransform> |
| @@ -194,8 +194,8 @@ | ||
| 194 | 194 | <ColumnDefinition Width="*"/> |
| 195 | 195 | |
| 196 | 196 | </Grid.ColumnDefinitions> |
| 197 | 删除: <base:Icon IconType="{TemplateBinding ToastIcon}" VerticalAlignment="Top" Margin="0,0,10,0"/> | |
| 198 | 删除: <TextBlock Grid.Column="1" Text="{TemplateBinding ToastContent}" VerticalAlignment="Top" TextWrapping="WrapWithOverflow"/> | |
| 197 | 新增: <base:Icon IconType="{TemplateBinding ToastIcon}" VerticalAlignment="Top" Margin="0,0,10,0" x:Name="ToastIcon"/> | |
| 198 | 新增: <TextBlock x:Name="ToastText" Grid.Column="1" Text="{TemplateBinding ToastContent}" VerticalAlignment="Top" TextWrapping="WrapWithOverflow"/> | |
| 199 | 199 | </Grid> |
| 200 | 200 | </Border> |
| 201 | 201 | <!--遮罩层--> |
| @@ -224,6 +224,16 @@ | ||
| 224 | 224 | </VisualStateManager.VisualStateGroups> |
| 225 | 225 | </Border> |
| 226 | 226 | <ControlTemplate.Triggers> |
| 227 | 新增: <Trigger Property="ToastType" Value="Success"> | |
| 228 | 新增: <Setter TargetName="ToastBorder" Property="Background" Value="#24bf5f" /> | |
| 229 | 新增: <Setter TargetName="ToastIcon" Property="Foreground" Value="#fff" /> | |
| 230 | 新增: <Setter TargetName="ToastText" Property="Foreground" Value="#fff" /> | |
| 231 | 新增: </Trigger> | |
| 232 | 新增: <Trigger Property="ToastType" Value="Error"> | |
| 233 | 新增: <Setter TargetName="ToastBorder" Property="Background" Value="#f54f4e" /> | |
| 234 | 新增: <Setter TargetName="ToastIcon" Property="Foreground" Value="#fff" /> | |
| 235 | 新增: <Setter TargetName="ToastText" Property="Foreground" Value="#fff" /> | |
| 236 | 新增: </Trigger> | |
| 227 | 237 | <MultiTrigger> |
| 228 | 238 | <MultiTrigger.Conditions> |
| 229 | 239 | <Condition Property="WindowState" Value="Normal" /> |

