When using XamDateTimeEditor how do I set the parameters of the underlying XamMonthEditor?Specifically, I'd like to display the week number and supress the TodayButton.
I can do this in a XamMonthEditor but how do I connect this to the XamDateTimeEditor?
Thanks,
- Dave
The xamDateTimeEditor doesn't really know about the xamMonthCalendar that happens to be contained within its default template. That being said I can think of two options. One would be to retemplate the xamDateTimeEditor and set local values on the xamMonthCalendar within the template. Another way would be to put a Style that targets the xamMonthCalendar into the resources of the xamDateTimeEditor. e.g.
Hello Dave,
Regarding the TodayButton, you have to retemplate the XamDateTimeEditor. You can see the default style for it in the DefaultStyles directory in the Infragistics folder.
There you will find a style for the TodayButton:
<Style TargetType="{x:Type Button}" x:Key="{x:Static igEditors:XamMonthCalendar.TodayButtonStyleKey}">
and you probably need to restyle the XamMonthCalendar to hide its TodayButton, too
...
<DockPanel SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<!-- Today button -->
<Button DockPanel.Dock="Bottom" Visibility="Collapsed"
Style="{DynamicResource {x:Static igEditors:XamMonthCalendar.TodayButtonStyleKey}}"
/>
What exactly parameters do you need to pass to the XamMonthEditor? You can use these styles and use TemplateBindings.
Regards,
Alex.