| 1 | using Core.Models.Config; |
| 2 | using System; |
| 3 | using System.Collections.Generic; |
| 4 | using System.Collections.ObjectModel; |
| 5 | using System.Diagnostics; |
| 6 | using System.Linq; |
| 7 | using System.Reflection; |
| 8 | using System.Text; |
| 9 | using System.Threading.Tasks; |
| 10 | using System.Windows; |
| 11 | using System.Windows.Controls; |
| 12 | |
| 13 | namespace UI.Controls.SettingPanel |
| 14 | { |
| 15 | public class SettingPanelItem : Control |
| 16 | { |
| 17 | ///<summary> |
| 18 | /// |
| 19 | ///</summary> |
| 20 | public string Description { get { return (string)GetValue(DescriptionProperty); } set { SetValue(DescriptionProperty, value); } } |
| 21 | public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register("Description", typeof(string), typeof(SettingPanelItem)); |
| 22 | |
| 23 | public object Content { get { return (object)GetValue(ContentProperty); } set { SetValue(ContentProperty, value); } } |
| 24 | public static readonly DependencyProperty ContentProperty = DependencyProperty.Register("Content", typeof(object), typeof(SettingPanelItem)); |
| 25 | |
| 26 | ///<summary> |
| 27 | /// |
| 28 | ///</summary> |
| 29 | public bool IsBeta { get { return (bool)GetValue(IsBetaProperty); } set { SetValue(IsBetaProperty, value); } } |
| 30 | public static readonly DependencyProperty IsBetaProperty = DependencyProperty.Register("IsBeta", typeof(bool), typeof(SettingPanelItem)); |
| 31 | |
| 32 | public SettingPanelItem() |
| 33 | { |
| 34 | DefaultStyleKey = typeof(SettingPanelItem); |
| 35 | } |
| 36 | |
| 37 | public void Init(ConfigAttribute configAttribute_, object content_) |
| 38 | { |
| 39 | Name = configAttribute_.Name; |
| 40 | Description = configAttribute_.Description; |
| 41 | IsBeta = configAttribute_.IsBeta; |
| 42 | Content = content_; |
| 43 | } |
| 44 | public override void OnApplyTemplate() |
| 45 | { |
| 46 | base.OnApplyTemplate(); |
| 47 | |
| 48 | } |
| 49 | } |
| 50 | } |