Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Feature: Add DateTimePicker.DisplayMode property [19311]

$
0
0
Extracted from this discussion:
http://wpftoolkit.codeplex.com/discussions/432063
------------------------------------------------------
Hi.

I would like to suggest a change for the DateTimePicker. I would like the Calendar's [DisplayMode](http://msdn.microsoft.com/en-us/library/system.windows.controls.calendar.displaymode%28v=vs.100%29.aspx) property to be added to the control.

My suggestion for this is to add a dependency property, DisplayMode. Adding the functionality to the style seems to have [problems](http://stackoverflow.com/questions/8644264/wpf-calendar-appears-empty-when-displaymode-is-year-or-decade). I was able to get it to work correctly by changing Popup_Opened. I was seeing performance issues still with using a binding, so I just set the DisplayMode directly. Hopefully this catches most use cases, since it is set each time the popup is opened.

```
private void Popup_Opened( object sender, EventArgs e )
{
if (_calendar != null)
{
_calendar.DisplayMode = DisplayMode;
_calendar.Focus();
}
}
```
Comments: ** Comment from web user: governalem **

Thanks!


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>