随笔分类 -  wpf

摘要:csusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Collections;using System.Windows.Data;using System.Reflection;using System.Collections.ObjectModel;using System.Windows.Con 阅读全文
posted @ 2013-05-25 17:39 法的空间 阅读(229) 评论(0) 推荐(0)
摘要:View Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:GEMS.Windows.Controls.CustomControls" xmlns:Themes="clr-namespace... 阅读全文
posted @ 2013-04-27 17:57 法的空间 阅读(207) 评论(0) 推荐(0)
摘要:View Code public class Indicator : UserControl { public Indicator() { this.InitializeComponent(); } private void InitializeComponent() { Grid g = new Grid(); this.Content = g; List<Path> pathlist = new List<Path>(); ... 阅读全文
posted @ 2013-04-21 00:36 法的空间 阅读(347) 评论(0) 推荐(0)
摘要:View Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MyWPFCustomControls" xmlns:Microsoft_Windows_Themes="clr-namespac... 阅读全文
posted @ 2013-04-16 23:57 法的空间 阅读(402) 评论(0) 推荐(0)
摘要:View Code <Trigger Property="Validation.HasError" Value="True"> <Setter TargetName="Bd" Property="BorderBrush" Value="Red"/> </Trigger>View Code <Setter Property="Validation.ErrorTemplate"> <Setter.Value> <C 阅读全文
posted @ 2013-04-02 17:02 法的空间 阅读(264) 评论(0) 推荐(0)
摘要:注意如果设置了系统dateformat格式。在变化系统culture的时候需要设置dateformat CultureInfo info = new CultureInfo(this.LanguageItems[value].Name); info.DateTimeFormat.ShortDatePattern= "dd/MM/yyyy"; info.DateTimeFormat.LongDatePattern = "dd/MM/yyyy"; Thread.CurrentThread.CurrentCulture = ... 阅读全文
posted @ 2013-03-20 23:13 法的空间 阅读(831) 评论(0) 推荐(0)
摘要:样式:View Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MCE.Gems.Common.Controls.CustomControls" xmlns:Themes="clr... 阅读全文
posted @ 2013-03-20 18:04 法的空间 阅读(370) 评论(0) 推荐(0)
摘要:View Code <RadioButton Margin="0,6,0,0" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" AutomationProperties.AutomationId="MaleRadioButton" Content="{DynamicResource ResourceKey=PM_Male}" IsChecked="{Binding Gender, ... 阅读全文
posted @ 2013-03-18 17:13 法的空间 阅读(559) 评论(0) 推荐(0)
摘要:View Code System.Timers.Timer t; DateTime lastInputTime = DateTime.MinValue; private void textBox1_PreviewKeyDown(object sender, KeyEventArgs e) { if (t!=null) { t.Stop(); } t = new System.Timers.Timer(); ... 阅读全文
posted @ 2013-03-12 00:40 法的空间 阅读(343) 评论(0) 推荐(0)
摘要:原理。。当itemsSource为null的时候。。触发Trigger 使用新样式逻辑。当itemsource绑定了源的时候。需要的时候。请讲源设置为nulldatagrid 普通样式View Code <Style x:Key="{ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}" TargetType="{x:Type Button}"> <Setter Property=&quo 阅读全文
posted @ 2013-03-11 23:43 法的空间 阅读(442) 评论(0) 推荐(0)
摘要:View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.ComponentModel;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.Windo 阅读全文
posted @ 2013-03-08 01:27 法的空间 阅读(821) 评论(0) 推荐(0)
摘要:用法如下:CustomDateFormat 只要是符合日期格式的都可以。如果乱写。就会显示有问题<CustomControl:CustomDatePicker Margin="0,100,0,0" CustomDateFormat="MM/dd/yyyy"/>代码如下View Code public class CustomDatePicker : DatePicker { public string CustomDateFormat { get { return (string)GetValue(CustomDateFormatProp.. 阅读全文
posted @ 2013-02-23 01:46 法的空间 阅读(407) 评论(0) 推荐(0)
摘要:利用radioButton的groupName分组互斥。。再解决radiobutton的取消选择的问题。给radiobutton加了一个像checkbox的样式2个方式:效果图第一种usecontrol:xaml:View Code <RadioButton x:Class="GEMS.Windows.Controls.UserControls.SingleCheckBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:// 阅读全文
posted @ 2013-02-21 13:06 法的空间 阅读(2788) 评论(0) 推荐(0)