原文:WPF 使用附加属性增加控件属性

使用附加属性增加控件属性,使得这个附加属性在使用的时候没有局限性,可以在任何的控件中使用它来增加所需要的属性,使得控件的属性使用起来非常灵活

一、自定义附加属性

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace Demo3.Control
{
    public class ControlAttachProperty
    {
        #region 圆角
        public static CornerRadius GetCornerRadius(DependencyObject obj)         //注意附加属性定义和依赖属性的不同
        {
            return (CornerRadius)obj.GetValue(CornerRadiusProperty);  //Obj是使用了附加属性的对象
        }
        public static void SetCornerRadius(DependencyObject obj, CornerRadius value)
        {
            obj.SetValue(CornerRadiusProperty, value);
        }
        // Using a DependencyProperty as the backing store for CornerRadius.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty CornerRadiusProperty =
            DependencyProperty.RegisterAttached("CornerRadius"typeof(CornerRadius), typeof(ControlAttachProperty), new PropertyMetadata(null));
         
        #endregion
        #region 用户头像模板
        public static ControlTemplate GetIconTemplate(DependencyObject obj)
        {
            return (ControlTemplate)obj.GetValue(IconTemplateProperty);
        }
        public static void SetIconTemplate(DependencyObject obj, ControlTemplate value)
        {
            obj.SetValue(IconTemplateProperty, value);
        }
        // Using a DependencyProperty as the backing store for IconTemplate.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IconTemplateProperty =
            DependencyProperty.RegisterAttached("IconTemplate"typeof(ControlTemplate), typeof(ControlAttachProperty), new PropertyMetadata(null));
        #endregion
        #region 删除按妞区域模板
        public static ControlTemplate GetAttachTemplate(DependencyObject obj)
        {
            return (ControlTemplate)obj.GetValue(AttachTemplateProperty);
        }
        public static void SetAttachTemplate(DependencyObject obj, ControlTemplate value)
        {
            obj.SetValue(AttachTemplateProperty, value);
        }
        // Using a DependencyProperty as the backing store for AttachTemplate.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AttachTemplateProperty =
            DependencyProperty.RegisterAttached("AttachTemplate"typeof(ControlTemplate), typeof(ControlAttachProperty), new PropertyMetadata(null));
         
        #endregion
        #region 用户名水印
        public static string GetUserNameWaterMark(DependencyObject obj)
        {
            return (string)obj.GetValue(UserNameWaterMarkProperty);
        }
        public static void SetUserNameWaterMark(DependencyObject obj, string value)
        {
            obj.SetValue(UserNameWaterMarkProperty, value);
        }
        // Using a DependencyProperty as the backing store for UserNameWaterMark.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty UserNameWaterMarkProperty =
            DependencyProperty.RegisterAttached("UserNameWaterMark"typeof(string), typeof(ControlAttachProperty), new PropertyMetadata(null));
        #endregion
        #region 密码水印
        public static string GetPasswordWaterMark(DependencyObject obj)
        {
            return (string)obj.GetValue(PasswordWaterMarkProperty);
        }
        public static void SetPasswordWaterMark(DependencyObject obj, string value)
        {
            obj.SetValue(PasswordWaterMarkProperty, value);
        }
        // Using a DependencyProperty as the backing store for PasswordWaterMark.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PasswordWaterMarkProperty =
            DependencyProperty.RegisterAttached("PasswordWaterMark"typeof(string), typeof(ControlAttachProperty), new PropertyMetadata(null));
  
        #endregion
        #region 用户头像(未被点击时)
        public static string GetUserIcon(DependencyObject obj)
        {
            return (string)obj.GetValue(UserIconProperty);
        }
        public static void SetUserIcon(DependencyObject obj, string value)
        {
            obj.SetValue(UserIconProperty, value);
        }
        // Using a DependencyProperty as the backing store for UserIcon.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty UserIconProperty =
            DependencyProperty.RegisterAttached("UserIcon"typeof(string), typeof(ControlAttachProperty), new PropertyMetadata(null));     
       
        #endregion
        #region 用户头像(点击时)
        public static string GetUserIconPress(DependencyObject obj)
        {
            return (string)obj.GetValue(UserIconPressProperty);
        }
        public static void SetUserIconPress(DependencyObject obj, string value)
        {
            obj.SetValue(UserIconPressProperty, value);
        }
        // Using a DependencyProperty as the backing store for UserIconPress.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty UserIconPressProperty =
            DependencyProperty.RegisterAttached("UserIconPress"typeof(string), typeof(ControlAttachProperty), new PropertyMetadata(null));
         
        #endregion
        #region 密码图标(未被点击时)
        public static string GetPassWordIcon(DependencyObject obj)
        {
            return (string)obj.GetValue(PassWordIconProperty);
        }
        public static void SetPassWordIcon(DependencyObject obj, string value)
        {
            obj.SetValue(PassWordIconProperty, value);
        }
        // Using a DependencyProperty as the backing store for PassWordIcon.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PassWordIconProperty =
            DependencyProperty.RegisterAttached("PassWordIcon"typeof(string), typeof(ControlAttachProperty), new PropertyMetadata(null));
        
        #endregion
        #region 密码图标(点击时)
        public static string GetPasswordIconPress(DependencyObject obj)
        {
            return (string)obj.GetValue(PasswordIconPressProperty);
        }
        public static void SetPasswordIconPress(DependencyObject obj, string value)
        {
            obj.SetValue(PasswordIconPressProperty, value);
        }
        // Using a DependencyProperty as the backing store for PasswordIconPress.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PasswordIconPressProperty =
            DependencyProperty.RegisterAttached("PasswordIconPress"typeof(string), typeof(ControlAttachProperty), new PropertyMetadata(null));
   
        #endregion
        #region 删除按妞背景图片
        public static ImageBrush GetDeleteButtonBG(DependencyObject obj)
        {
            return (ImageBrush)obj.GetValue(DeleteButtonBGProperty);
        }
        public static void SetDeleteButtonBG(DependencyObject obj, ImageBrush value)
        {
            obj.SetValue(DeleteButtonBGProperty, value);
        }
        // Using a DependencyProperty as the backing store for DeleteButtonBG.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty DeleteButtonBGProperty =
            DependencyProperty.RegisterAttached("DeleteButtonBG"typeof(ImageBrush), typeof(ControlAttachProperty), new PropertyMetadata(null));
        #endregion
        #region 定义是否开启绑定事件
        public static bool GetIsCommandClearTextEvent(DependencyObject obj)
        {
            return (bool)obj.GetValue(IsCommandClearTextEventProperty);
        }
        public static void SetIsCommandClearTextEvent(DependencyObject obj, bool value)
        {
            obj.SetValue(IsCommandClearTextEventProperty, value);
        }
        // Using a DependencyProperty as the backing store for IsCommandClearTextEvent.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsCommandClearTextEventProperty =
            DependencyProperty.RegisterAttached("IsCommandClearTextEvent"typeof(bool), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(false,IsCommandClearTextEventChanged));
        private static void IsCommandClearTextEventChanged(DependencyObject d,DependencyPropertyChangedEventArgs e)
        {
        }
        #endregion
        #region 是否显示密码样式
        public static bool GetIsVisiblityPassword(DependencyObject obj)
        {
            return (bool)obj.GetValue(IsVisiblityPasswordProperty);
        }
        public static void SetIsVisiblityPassword(DependencyObject obj, bool value)
        {
            obj.SetValue(IsVisiblityPasswordProperty, value);
        }
        // Using a DependencyProperty as the backing store for IsVisiblityPassword.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsVisiblityPasswordProperty =
            DependencyProperty.RegisterAttached("IsVisiblityPassword"typeof(bool), typeof(ControlAttachProperty), new PropertyMetadata(false));
        #endregion
        #region 清除事件命令
        public static bool GetIsClearTextButtonBehaviorEnabled(DependencyObject obj)
        {
            return (bool)obj.GetValue(IsClearTextButtonBehaviorEnabledProperty);
        }
        public static void SetIsClearTextButtonBehaviorEnabled(DependencyObject obj, bool value)
        {
            obj.SetValue(IsClearTextButtonBehaviorEnabledProperty, value);
        }
        // Using a DependencyProperty as the backing store for IsClearTextButtonBehaviorEnabled.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsClearTextButtonBehaviorEnabledProperty =
            DependencyProperty.RegisterAttached("IsClearTextButtonBehaviorEnabled"typeof(bool), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(false,IsClearTextButtonBehaviorEnabledChanged));
        /// <summary>
        /// 当附加属性值发生改变时,调用此方法
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void IsClearTextButtonBehaviorEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var button=d as DeleteButton;
            if(e.OldValue != e.NewValue)
            {
                //当命令触发的时候,会向上传递,而此时这个命令外围就是自己本身
                button.CommandBindings.Add(ClearTextCommandBinding);
            }
        }
        /**
         * 当命令触发的时候,会一级一级向上传递,当传递到命令关联者时,会处理这个命令
         */
        /// <summary>
        /// 创建一个命令
        /// </summary>
        public static RoutedUICommand ClearTextCommand{get;private set;}
         
        /// <summary>
        /// 命令绑定关联
        /// </summary>
        private static readonly CommandBinding ClearTextCommandBinding;
        private static void ClearButtonClick(object sender,ExecutedRoutedEventArgs e)
        {
            var tbox=e.Parameter as FrameworkElement;
            if(tbox==nullreturn;
            if(tbox is TextBox)
            {
                ((TextBox)tbox).Clear();
            }
            tbox.Focus();
        }
        #endregion
        static ControlAttachProperty()
        {
            ClearTextCommand = new RoutedUICommand();
            ClearTextCommandBinding =new CommandBinding();
            //将者命令加入到这个命令关联中,如果某个控件调用了这个命令,只要他所在的层级中有关联这个命令关联对象,那么这个命令对象就会对其进行处理
            ClearTextCommandBinding.Command = ClearTextCommand;
            ClearTextCommandBinding.Executed+=ClearButtonClick;
        }
    }
}

  

在布局文件中使用它

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<Window x:Class="Demo3.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c="clr-namespace:Demo3.Control"
        Background="Black"
        Title="MainWindow"
        WindowStartupLocation="CenterScreen"
        Height="350"
        Width="525">
    <StackPanel>
        <TextBox x:Name="UserName"
                 Width="230"
                 Height="38"
                 Margin="0,20,0,0"
                 FontSize="18"
                 VerticalContentAlignment="Center"
                 c:ControlAttachProperty.CornerRadius="5"
                 c:ControlAttachProperty.UserNameWaterMark="用户名"
                 c:ControlAttachProperty.UserIcon="{StaticResource UserName_BG}"
                 c:ControlAttachProperty.UserIconPress="{StaticResource UserName_BG_Press}"
                 c:ControlAttachProperty.DeleteButtonBG="{StaticResource Delete_Button_BG}"
                 c:ControlAttachProperty.IsVisiblityPassword="false"
                 Style="{StaticResource IconClearButtonTextBox}" />
        <TextBox x:Name="Password"
                 Width="230"
                 Height="38"
                 Margin="0,20,0,0"
                 FontSize="18"
                 VerticalContentAlignment="Center"
                 c:ControlAttachProperty.CornerRadius="5"
                 c:ControlAttachProperty.UserNameWaterMark="密码"
                 c:ControlAttachProperty.UserIcon="{StaticResource Password_BG}"
                 c:ControlAttachProperty.UserIconPress="{StaticResource Password_BG_Press}"
                 c:ControlAttachProperty.DeleteButtonBG="{StaticResource Delete_Button_BG}"
                 c:ControlAttachProperty.IsVisiblityPassword="true"
                 Style="{StaticResource IconClearButtonTextBox}" />
    </StackPanel>      
     
</Window>

  

在style文件中进行使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:c="clr-namespace:Demo3.Control"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
     
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Demo3;component/Resources/Style/DeleteButton.xaml" />
    </ResourceDictionary.MergedDictionaries>
     
    <!--TextBox默认样式-->
    <Style x:Key="DefaultTextBox" TargetType="{x:Type TextBox}">
        <Setter Property="ContextMenu" Value="{DynamicResource TextBoxContextMenu}" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border x:Name="Bg"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                            CornerRadius="{TemplateBinding c:ControlAttachProperty.CornerRadius}"
                            Background="White"
                            BorderBrush="Transparent"
                            BorderThickness="0">
                        <Grid x:Name="PART_InnerGrid">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="30"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="40"/>
                            </Grid.ColumnDefinitions>
                            <!--用户头像区域-->
                            <ContentControl x:Name="UserIcon"
                                            Grid.Column="0"
                                            Margin="5"
                                            Template="{TemplateBinding c:ControlAttachProperty.IconTemplate}"
                                            Focusable="False" />
                             
                            <!--文本和水印-->
                            <ScrollViewer x:Name="PART_ContentHost"
                                          BorderThickness="0"
                                          Grid.Column="1"
                                          IsTabStop="False"
                                          Margin="2"
                                          VerticalAlignment="Stretch"
                                          Background="{x:Null}" />
                            <TextBlock x:Name="WaterMark"
                                       Grid.Column="1"
                                       VerticalAlignment="Center"
                                       Foreground="Silver"
                                       FontSize="18"
                                       Text="{TemplateBinding c:ControlAttachProperty.UserNameWaterMark}"
                                       Visibility="Collapsed"
                                       Padding="5,0,0,0" />
                             
                            <!-- 删除按钮-->
                            <ContentControl x:Name="DeleteIcon"
                                            Grid.Column="2"
                                            Width="15"
                                            Height="15"
                                            Margin="0,5,10,5"
                                            Visibility="Visible"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Right"
                                            Template="{TemplateBinding c:ControlAttachProperty.AttachTemplate}"
                                            Focusable="False" />
                        </Grid>
                    </Border>
                     
                    <ControlTemplate.Triggers>
                        <!--当Text为空时,隐藏删除按钮-->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=Text}" Value="">
                            <Setter Property="Visibility" TargetName="DeleteIcon" Value="Collapsed" />
                            <Setter Property="Visibility" TargetName="WaterMark" Value="Visible" />
                        </DataTrigger>
                         
                        <!--是否显示密码样式-->
                        <Trigger Property="c:ControlAttachProperty.IsVisiblityPassword" Value="True">
                            <Setter Property="Height" Value="30"/>
                            <Setter Property="Foreground" Value="Transparent"></Setter>
                            <Setter Property="FontSize" Value="20"></Setter>
                            <Setter Property="FontFamily" Value="Courier New"></Setter>
                            <Setter Property="TextDecorations">
                                <Setter.Value>
                                    <TextDecorationCollection>
                                        <TextDecoration>
                                            <TextDecoration.Pen>
                                                <Pen Thickness="10"
                                                     Brush="Black"
                                                     EndLineCap="Round"
                                                     StartLineCap="Round"
                                                     DashCap="Round"  >
                                                    <Pen.DashStyle>
                                                        <DashStyle Dashes="0.0,1.2" Offset="0.6"/>
                                                    </Pen.DashStyle>
                                                </Pen>
                                            </TextDecoration.Pen>
                                            <TextDecoration.Location>
                                                <TextDecorationLocation>Strikethrough</TextDecorationLocation>
                                            </TextDecoration.Location>
                                        </TextDecoration>
                                    </TextDecorationCollection>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
     
    <!--TextBox包含附加属性Icon,以及ClearText按钮的样式-->
    <Style x:Key="IconClearButtonTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource DefaultTextBox}">
        <!--设置用户头像模板-->
        <Setter Property="c:ControlAttachProperty.IconTemplate">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <Grid>
                      <Image x:Name="Bg_HP"
                             Source="{Binding Path=(c:ControlAttachProperty.UserIcon),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type TextBox}}}"
                             Visibility="Visible"/>
                      <Image x:Name="Bg_HP_Press"
                             Source="{Binding Path=(c:ControlAttachProperty.UserIconPress),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type TextBox}}}"
                             Visibility="Collapsed" />
                    </Grid>
                     
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsFocused, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" Value="true">
                            <Setter Property="Visibility" TargetName="Bg_HP" Value="Collapsed" />
                            <Setter Property="Visibility" TargetName="Bg_HP_Press" Value="Visible" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <!--设置删除按妞模板-->
        <Setter Property="c:ControlAttachProperty.AttachTemplate">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <c:DeleteButton ButtonBG="{Binding Path=(c:ControlAttachProperty.DeleteButtonBG),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type TextBox}}}"
                                    BorderBrush="Transparent"
                                    Style="{StaticResource DeleteButtonStyle}"
                                    BorderThickness="0"
                                    x:Name="CleanButton"
                                    c:ControlAttachProperty.IsClearTextButtonBehaviorEnabled="True"
                                    Command="c:ControlAttachProperty.ClearTextCommand"
                                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}"
                                    Focusable="false" />
                     
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Text,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type TextBox}}}" Value="">
                            <Setter Property="Visibility" TargetName="CleanButton" Value="Collapsed" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

WPF 使用附加属性增加控件属性相关推荐

  1. WPF前端:按钮控件属性Button

    Button的属性 Button属性 属性介绍 Margin="0,0,100,5" 外间距:左上右下 HorizontalAlignment="Right" ...

  2. WPF IP地址输入控件的实现

    WPF IP地址输入控件的实现 原文:WPF IP地址输入控件的实现 一.前言 WPF没有内置IP地址输入控件,因此我们需要通过自己定义实现. 我们先看一下IP地址输入控件有什么特性: 输满三个数字焦 ...

  3. C# wpf 实现Canvas内控件拖动

    系列文章目录 第一章 Grid内控件拖动 第二章 Canvas内控件拖动(本章) 第三章 任意控件拖动 第四章 窗口拖动 第五章 附加属性实现任意拖动 文章目录 系列文章目录 前言 一.如何实现? 1 ...

  4. WPF 实现蒙板控件

    WPF 实现蒙板控件 控件名:Mask 作   者:WPFDevelopersOrg - 驚鏵 原文链接[1]:https://github.com/WPFDevelopersOrg/WPFDevel ...

  5. 在WPF中使用WinForm控件方法

    在WPF中使用WinForm控件方法 原文:在WPF中使用WinForm控件方法 1.      首先添加对如下两个dll文件的引用:WindowsFormsIntegration.dll,Syste ...

  6. 43. ExtJs控件属性配置详细

    转自:https://www.cnblogs.com/mannixiang/p/6558225.html 序言:    1.本文摘自网络,看控件命名像是4.0以前的版本,但控件属性配置仍然可以借鉴(不 ...

  7. [开源]FreeSCADA的通道数据与控件属性关联以及自动刷新机制研究

    [开源]FreeSCADA的通道数据与控件属性关联以及自动刷新机制研究 [参考文章]: 1. WPF之Binding深入探讨, 地址:http://www.cnblogs.com/cappuccino ...

  8. linux QT 结束当前进程_Qt编写控件属性设计器7-串口采集

    一.前言 数据源是组态软件的核心灵魂,少了数据源,组态就是个花架子没卵用,一般数据源有三种方式获取,串口.网络.数据库,至于数据规则是什么,这个用户自己指定,本设计器全部采用第一个字节作为数据来演示. ...

  9. WPF 绑定StaticResource到控件的方法

    WPF 绑定StaticResource到控件的方法 原文:WPF 绑定StaticResource到控件的方法 资源文件内的属性能否直接通过绑定应用到控件?答案是肯定的. 比如,我们要直接把下面的& ...

  10. ExtJs控件属性配置详细(转)

    序言:    1.本文摘自网络,看控件命名像是4.0以前的版本,但控件属性配置仍然可以借鉴(不足之处,以后项目用到时再续完善). Ext.form.TimeField: 配置项:            ...

最新文章

  1. minimun-depth-of-binary-tree
  2. linux下scp远程拷贝文件无需输入密码工具之expect
  3. Python三元运算
  4. wine最小化游戏后无法恢复的问题
  5. jzoj3736-[NOI2014模拟7.11]数学题(math)【计算几何】
  6. Text模式和PDU模式的区别
  7. geoserver native JAI error 问题解决方法
  8. Jeecg-boot 2.4.6+ 多租户改造方案(涉及菜单部门角色等基础模块)
  9. 使用MONO使.net程序脱离.net框架运行
  10. 利用iTextSharp对PDF进行签名(E-signing PDF documents with iTextSharp)--推荐
  11. 安装Microsoft Visual Studio 2008的时候,经常会出现Microsoft Visual Studio Web创作组件安装失败的情况
  12. c盘清理代码_WIN10 C盘空间不够怎么办?几个小方法助你清理硬盘空间
  13. 英雄联盟官宣IG冠军皮肤原画 彩蛋是王思聪吃热狗
  14. faster-rcnn参数介绍
  15. 基于rdkit将smiles转换为smarts
  16. android 单点登录
  17. 医疗时鲜资讯:第二十三届中国国际医用仪器设备展览会暨技术交流会 有感
  18. html 萤火虫特效,html5 canvas逼真的夜幕森林萤火虫动画
  19. 【转】ActionScript,Flash,Flash/Flex Builder,FlashPlayer,AIR,swf,swc,swz之间的区别...
  20. 基于三维激光点云的树木建模(枝叶分离)

热门文章

  1. 销量之王,去年程序员最爱看的技术书就是它
  2. 细节也可以决定网站中交互设计的成败
  3. 在ASP.NET中加密页面机制
  4. Python生成器中的send()与next()方法解析
  5. PyTorch:Encoder-RNN|LSTM|GRU
  6. Keras:模型评估
  7. python文件和目录访问File and Directory Access
  8. Pytorch的可视化工具tensorboardX
  9. 自动控制原理概念梳理(脑图)
  10. 安师大计算机专业分数线,安徽师范大学