本文整理汇总了C#中System.Windows.Controls.DatePicker.InvalidateVisual方法的典型用法代码示例。如果您正苦于以下问题:C# DatePicker.InvalidateVisual方法的具体用法?C# DatePicker.InvalidateVisual怎么用?C# DatePicker.InvalidateVisual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.DatePicker
的用法示例。
在下文中一共展示了DatePicker.InvalidateVisual方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCaseListCriteriaItem
public static SearchCaseListCriteriaItem CreateCaseListCriteriaItem(String item, RefreshCaseListHandler refereshList)
{
SearchCaseListCriteriaItem critriaItem;
UIElement element;
TextBox textbx = new TextBox();
textbx.Width = 125;
textbx.Height = 25;
textbx.TextChanged += new TextChangedEventHandler(refereshList);
element = textbx;
switch (item)
{
case "CaseID":
{
break;
}
case "Analyst":
{
break;
}
case "AnalystComment":
{
break;
}
case "FlightNumber":
{
break;
}
case "ObjectID":
{
break;
}
case "Area":
{
break;
}
case "Result":
{
ComboBox cmbBx = new ComboBox();
int[] vals = (int[])Enum.GetValues(typeof(WorkstationDecision));
String[] ResultList = new String[vals.Length];
int i = 0;
foreach (int v in vals)
{
ResultList[i] = v.ToString(CultureResources.getDefaultDisplayCulture());
i++;
}
DataTemplate dataTemplate = new DataTemplate(typeof(String));
var binding = new Binding();
binding.Converter = new IntToDecisionConverter();
var elemFactory = new FrameworkElementFactory(typeof(ContentPresenter));
elemFactory.SetBinding(ContentPresenter.ContentProperty, binding);
dataTemplate.VisualTree = elemFactory;
cmbBx.ItemTemplate = dataTemplate;
cmbBx.ItemsSource = ResultList;
cmbBx.Height = 25;
cmbBx.Width = 125;
cmbBx.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center;
cmbBx.SelectionChanged += new SelectionChangedEventHandler(refereshList);
CultureResources.getDataProvider().DataChanged += new EventHandler((object sender, EventArgs e) =>
{
// reset the items source to refresh the display
int index = cmbBx.SelectedIndex;
var source = cmbBx.ItemsSource;
cmbBx.ItemsSource = null;
cmbBx.ItemsSource = source;
cmbBx.SelectedIndex = index;
});
element = cmbBx;
break;
}
case "UpdateTime":
{
StackPanel panel = new StackPanel();
DatePicker datePicker = new DatePicker();
datePicker.IsTodayHighlighted = true;
datePicker.SelectedDate = DateTime.Now.AddDays(-7);
datePicker.SelectedDateChanged += new EventHandler<SelectionChangedEventArgs>(refereshList);
panel.Children.Add(datePicker);
datePicker = new DatePicker();
datePicker.IsTodayHighlighted = true;
datePicker.SelectedDate = DateTime.Now;
datePicker.SelectedDateChanged += new EventHandler<SelectionChangedEventArgs>(refereshList);
// catch culture changes and refresh the date picker
CultureResources.getDataProvider().DataChanged += new EventHandler((object sender, EventArgs e) =>
{
datePicker.InvalidateVisual();
});
panel.Children.Add(datePicker);
//.........这里部分代码省略.........