当前位置: 首页>>代码示例>>C#>>正文


C# Controls.DatePicker类代码示例

本文整理汇总了C#中System.Windows.Controls.DatePicker的典型用法代码示例。如果您正苦于以下问题:C# DatePicker类的具体用法?C# DatePicker怎么用?C# DatePicker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DatePicker类属于System.Windows.Controls命名空间,在下文中一共展示了DatePicker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的System.Windows.Controls.DatePicker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。