跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

SettingPanelItem.cs

50 行 · 1.8 KB历史下载
1using Core.Models.Config;
2using System;
3using System.Collections.Generic;
4using System.Collections.ObjectModel;
5using System.Diagnostics;
6using System.Linq;
7using System.Reflection;
8using System.Text;
9using System.Threading.Tasks;
10using System.Windows;
11using System.Windows.Controls;
12
13namespace 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 /// 是否显示beta标识
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}