本文整理汇总了C#中System.Windows.Controls.DatePicker类的典型用法代码示例。如果您正苦于以下问题:C# DatePicker类的具体用法?C# DatePicker怎么用?C# DatePicker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DatePicker类属于System.Windows.Controls命名空间,在下文中一共展示了DatePicker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: YearPicker
public YearPicker()
{
InitializeComponent();
this.SelectedYearChanged += default_SelectedYearChanged;
datePicker = year_picker;
year_picker.CalendarOpened += DatePicker_CalendarOpened;
}
开发者ID:GrayJumba,项目名称:Onion,代码行数:7,代码来源:YearPicker.xaml.cs
示例2: DateRangePanel
/// <summary>
/// Definiert das DateRangePanel
/// </summary>
/// <param name="dateFromProcessingFunction">Funktion, die vom Start-DatePicker bei Änderung aufgerufen wird</param>
/// <param name="dateToProcessingFunction">Funktion, die vom Ende-DatePicker bei Änderung aufgerufen wird</param>
/// <param name="datePickerFrom">Referenz zum darzustellenden DatePicker für Start</param>
/// <param name="datePickerTo">Referenz zum darzustellenden DatePicker für Ende</param>
public DateRangePanel(Action<DateTime> dateFromProcessingFunction, Action<DateTime> dateToProcessingFunction, ref DatePicker datePickerFrom, ref DatePicker datePickerTo)
{
this.dateFromProcessingFunction = dateFromProcessingFunction;
this.dateToProcessingFunction = dateToProcessingFunction;
this.datePickerFrom = datePickerFrom;
this.datePickerTo = datePickerTo;
Label lbFrom = new Label();
Label lbTo = new Label();
lbFrom.Content = IniParser.GetSetting("APPSETTINGS", "dateRangeFrom");
lbTo.Content = IniParser.GetSetting("APPSETTINGS", "dateRangeTo");
lbTo.Margin = new Thickness(10, 0, 0, 0);
this.datePickerFrom.Width = 95;
this.datePickerTo.Width = 95;
this.datePickerFrom.SelectedDate = BookingsHelper.getDateOfLastCashClosure();
this.datePickerTo.SelectedDate = DateTime.Today;
this.datePickerFrom.SelectedDateChanged += processDateFrom;
this.datePickerTo.SelectedDateChanged += processDateTo;
panel = new WrapPanel();
panel.HorizontalAlignment = HorizontalAlignment.Right;
panel.VerticalAlignment = VerticalAlignment.Top;
panel.Margin = new Thickness(30, 10, 20, 0); // links nur 30px wegen Platzmangel in Toolbar von Modul pSums
panel.Children.Add(lbFrom);
panel.Children.Add(this.datePickerFrom);
panel.Children.Add(lbTo);
panel.Children.Add(this.datePickerTo);
}
开发者ID:ramteid,项目名称:KoeTaf,代码行数:40,代码来源:DateRangePanel.cs
示例3: buttonCreat_Click
private void buttonCreat_Click(object sender, RoutedEventArgs e)
{
try
{
PassengerName name = new PassengerName();
name.Name = textBoxData1.Text;
DatePicker date = new DatePicker();
date.SelectedDate = DatePicker1.SelectedDate;
date.DisplayDateStart = new DateTime(2 / 8 / 16);
date.DisplayDateEnd = new DateTime(2 / 29 / 19);
date.IsTodayHighlighted = true;
filewritter1 filewriter = new filewritter1();
string PassengerInfo = null;
if (radioMke.IsChecked == true)
{
PassengerInfo = (Environment.NewLine + this.textBoxData1.Text + " is leaving on " + this.DatePicker1 + " and the flight Origin and Destination is " + this.radioMke.Content);
}
else if (radioTpa.IsChecked == true)
{
PassengerInfo = (Environment.NewLine + textBoxData1.Text + " is leaving on " + this.DatePicker1 + " and the flight Origin and Destination is " + this.radioTpa.Content);
}
filewriter.Print(PassengerInfo, "Manifest.txt");
//this.Close();
MessageBox.Show(PassengerInfo);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
开发者ID:jacobblankenburg,项目名称:MilesJakeFinalProject,代码行数:34,代码来源:MainWindow.xaml.cs
示例4: GenerateEditingElement
protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
{
DatePicker picker = new DatePicker();
picker.SetBinding(DatePicker.SelectedDateProperty, this.Binding);
picker.IsDropDownOpen = true;
return picker;
}
开发者ID:jogibear9988,项目名称:SlGanttChart,代码行数:7,代码来源:GanttDateColumn.cs
示例5: DateTimeEditor
public DateTimeEditor(WorkFrame frame)
: base(frame)
{
StackPanel panel = new StackPanel();
panel.Orientation = Orientation.Horizontal;
time = new TextBox();
time.DataContext = this;
time.Width = 64;
var timeBinding = new Binding("Value");
timeBinding.Mode = BindingMode.TwoWay;
timeBinding.Converter = this;
time.SetBinding(TextBox.TextProperty, timeBinding);
date = new DatePicker();
date.DataContext = this;
var dateBinding = new Binding("Value");
dateBinding.Converter = new DateConvert(time);
dateBinding.Mode = BindingMode.TwoWay;
date.SetBinding(DatePicker.SelectedDateProperty, dateBinding);
Button now = new Button();
now.Content = "当前时间";
now.Click += (s, e) => Value = DateTime.Now;
panel.Children.Add(date);
panel.Children.Add(time);
panel.Children.Add(now);
Content = panel;
}
开发者ID:liny4cn,项目名称:ComBoost,代码行数:31,代码来源:DateTimeEditor.cs
示例6: DocUIDate
/// <summary>
/// Creates a new instance of the TimeOption
/// </summary>
/// <param name="xmlNode">The xmlnode containing the data.</param>
/// <param name="xsdNode">The corresponding xsdnode.</param>
/// <param name="panel">The panel on which this option should be placed.</param>
/// <param name="parentForm">The form of which this option is a part.</param>
public DocUIDate(XmlNode xmlNode, XmlSchemaAnnotated xsdNode, Panel contentpanel, Panel overlaypanel, DynamicForm parentForm) :
base(xmlNode, xsdNode, contentpanel, overlaypanel, parentForm)
{
Control = new DatePicker(); //{ Form Format = TimeFormat.Custom, FormatString = "HH:mm:ss" };
//(Control as DatePicker).ValueChanged += (s, e) => { hasPendingChanges(); };
setup();
}
开发者ID:00Green27,项目名称:DocUI,代码行数:15,代码来源:DocUIDate.cs
示例7: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
DatePicker = (DatePicker)GetTemplateChild("PART_DatePicker");
DatePicker.SetBinding(DatePicker.SelectedDateProperty, new Binding { Source = this, Path = new PropertyPath(CurrentValueProperty), Mode = BindingMode.TwoWay });
DatePicker.SelectedDateChanged += DatePicker_SelectedDateChanged;
}
开发者ID:alexyjian,项目名称:ComBoost,代码行数:8,代码来源:DateEditor.cs
示例8: CreateView
public FrameworkElement CreateView(PropertyInfo property)
{
var inputControl = new DatePicker();
var binding = new Binding(property.Name);
binding.Mode = BindingMode.TwoWay;
inputControl.SetBinding(DatePicker.SelectedDateProperty, binding);
return inputControl;
}
开发者ID:zealoussnow,项目名称:OneCode,代码行数:8,代码来源:DateConfigControl.cs
示例9: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/ISEstimate;component/ISDate.xaml", System.UriKind.Relative));
this.dtpDate = ((System.Windows.Controls.DatePicker)(this.FindName("dtpDate")));
this.btnOK = ((System.Windows.Controls.Button)(this.FindName("btnOK")));
}
开发者ID:sajidk,项目名称:Estimate-SL,代码行数:9,代码来源:ISDate.g.cs
示例10: SetUpEndPicker
private void SetUpEndPicker()
{
_endDatePicker = new DatePicker();
_endDatePicker.Width = this.Width * 0.5;
_endDatePicker.Height = this.Height * 0.05;
_endDatePicker.FontSize = 20;
_endDatePicker.SelectedDateChanged += _endDatePicker_SelectedDateChanged;
}
开发者ID:RemyKaloustian,项目名称:Epic-Projects,代码行数:9,代码来源:NewProjectPopUp.cs
示例11: GenerateElement
protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
{
var element = new DatePicker
{
Style = Application.Current.Resources["DatePickerStyle"] as Style
};
element.SetBinding(DatePicker.SelectedDateProperty, Binding);
return element;
}
开发者ID:Dileriuml,项目名称:PostStore,代码行数:9,代码来源:DateTimeColumn.cs
示例12: GenerateEditingElement
protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
{
DatePicker picker = new DatePicker();
picker.MinHeight = 16;
picker.Padding = new Thickness(0);
picker.BorderThickness = new Thickness(0);
picker.SetBinding(DatePicker.SelectedDateProperty, Binding);
picker.IsDropDownOpen = true;
return picker;
}
开发者ID:eolandezhang,项目名称:Diagram,代码行数:10,代码来源:DataGridDateColumn.cs
示例13: DonorForm
public DonorForm()
{
InitializeComponent();
CurrentDonor = new Donor();
// Объявляем текущий контект для Binding.
donorInfoGrid.DataContext = CurrentDonor;
DatePicker a = new DatePicker();
}
开发者ID:Ratatui,项目名称:DonorBank,代码行数:10,代码来源:Donor.xaml.cs
示例14: IsEmpty
public static bool IsEmpty(DatePicker[] datePicker)
{
foreach (var item in datePicker)
{
if (item.Text.Length <= 0 || string.IsNullOrEmpty(item.Text))
{
return false;
}
}
return true;
}
开发者ID:estebanl,项目名称:Manufacture,代码行数:11,代码来源:ControlValidation.cs
示例15: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/%E5%A5%A5%E6%9E%AB%E7%87%83%E6%B0%94%E8%90%A5%E6%94%B6%E7%B3%BB%E7%BB%9FV3;compo" +
"nent/Program/ObjectTools/DateTimePicker.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.DatePicker = ((System.Windows.Controls.DatePicker)(this.FindName("DatePicker")));
this.TimePicker = ((System.Windows.Controls.TimePicker)(this.FindName("TimePicker")));
}
开发者ID:DuBin1988,项目名称:anjian_pad_server,代码行数:11,代码来源:DateTimePicker.g.i.cs
示例16: CheckDatePicker
private bool CheckDatePicker(DatePicker datePicker)
{
DateTime result;
if (string.IsNullOrEmpty(datePicker.Text) || !DateTime.TryParse(datePicker.Text, out result))
{
datePicker.Background = Brushes.LightPink;
return false;
}
return true;
}
开发者ID:Confirmit,项目名称:Students,代码行数:11,代码来源:CreateUser.xaml.cs
示例17: GenerateEditingElement
protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
{
var dp = new DatePicker {VerticalAlignment = VerticalAlignment.Stretch};
if (DateFormat != null)
{
IValueConverter dtc = new DateTimeConverter();
Binding.Converter = dtc;
Binding.ConverterParameter = DateFormat;
}
dp.SetBinding(DatePicker.SelectedDateProperty, Binding);
return dp;
}
开发者ID:yan122725529,项目名称:TripRobot.Crawler,代码行数:12,代码来源:DataGridColumns.cs
示例18: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/NIS.Module.Laboratory;component/Views/Add/AddAmbulanciaZamestanecView.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.AddZamestanec = ((NeuroSpeech.UIAtoms.Controls.AtomForm)(this.FindName("AddZamestanec")));
this.ZamestanecPO_Meno = ((NeuroSpeech.UIAtoms.Controls.AtomTextBox)(this.FindName("ZamestanecPO_Meno")));
this.ZamestanecPO_Priezvisko = ((NeuroSpeech.UIAtoms.Controls.AtomTextBox)(this.FindName("ZamestanecPO_Priezvisko")));
this.ZamestanecPO_DatumNarodenia = ((System.Windows.Controls.DatePicker)(this.FindName("ZamestanecPO_DatumNarodenia")));
}
开发者ID:aytacozkan,项目名称:nisproject,代码行数:12,代码来源:AddAmbulanciaZamestanecView.g.cs
示例19: pSums
public pSums()
{
InitializeComponent();
this.datePickerFrom = new DatePicker();
this.datePickerTo = new DatePicker();
cbFilterAccount = new ComboBox();
cbFilterAccount.MinWidth = 150;
cbFilterAccount.SelectionChanged += filterAccounts_SelectionChanged;
generateDataGridDataUnfiltered();
}
开发者ID:ramteid,项目名称:KoeTaf,代码行数:13,代码来源:pSums.xaml.cs
示例20: initialize
protected override void initialize() {
base.initialize();
//this.currentValue = this.Property.Value as DateTime?;
this.Property.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(this.property_PropertyChanged);
this.Property.ValueError += new EventHandler<ExceptionEventArgs>(this.property_ValueError);
this.pnl = new StackPanel {
Orientation = System.Windows.Controls.Orientation.Horizontal,
FlowDirection = System.Windows.FlowDirection.LeftToRight
};
this.Content = pnl;
this.dtp = new DatePicker {
Visibility = Visibility.Visible,
Margin = new Thickness(1, 0, 0, 0),
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left,
Width = 120,
IsEnabled = this.Property.CanWrite
};
this.pnl.Children.Add(this.dtp);
this.cbxHour = new ComboBox {
Visibility = Visibility.Visible,
Margin = new Thickness(2,0,0,0),
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left,
Width = 50,
IsEnabled = this.Property.CanWrite,
Cursor = Cursors.Hand
};
this.pnl.Children.Add(this.cbxHour);
this.cbxMin = new ComboBox {
Visibility = Visibility.Visible,
Margin = new Thickness(2, 0, 0, 0),
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left,
Width = 50,
IsEnabled = this.Property.CanWrite,
Cursor = Cursors.Hand
};
this.pnl.Children.Add(this.cbxMin);
this._init_cmbxs();
this.refreshControlsValue();
this.dtp.LostFocus += new RoutedEventHandler(this.dtp_LostFocus);
this.dtp.SelectedDateChanged += new EventHandler<SelectionChangedEventArgs>(this.dtp_SelectedDateChanged);
this.cbxHour.SelectionChanged += new SelectionChangedEventHandler(this.cbxTime_SelectionChanged);
this.cbxMin.SelectionChanged += new SelectionChangedEventHandler(this.cbxTime_SelectionChanged);
this.dtp.Focus();
}
开发者ID:tormoz70,项目名称:Bio.Framework.8,代码行数:51,代码来源:DateTimeValueEditor.cs
注:本文中的System.Windows.Controls.DatePicker类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论