In the XAml attachment, it should have the Command property on the Button as:
{x:Static igEditors:MonthCalendarCommands.ActivateDate}
Its probably because you are passing a string as the command parameter and not a date. Try setting the CommandParameter to a DateTime. e.g.
<Setter Property="CommandParameter"> <Setter.Value> <sys:DateTime>12.13.2012</sys:DateTime> </Setter.Value></Setter>
Ok I do have the Command executing now - It's based on a Vm bound souce. But the functionality does not match when using MonthCalendarCommands.Today.MonthCalendarCommands.Today activates the Calendar to the Month where the date is set and it also selects (highlights) the Date then closes the Calendar.
Using MonthCalendarCommands.ActivateDate only activates the Date I send as CommandParmater but does not select (highlight it) it NOR close the Calendar.
I still need it to mimic .Today command. See my updated attached XAML
ActivateDate does just that - it makes the specified date to be the ActiveDate but doesn't manipulate the selection. Currently there is no command that will activate and select a date (and signal that the selection is done when it is used in a dropdown like in xamDateTimeEditor). Perhaps we can add another command. I'll see about getting an issue written up about this.
That would be helpful.
Is there a workaround perhaps by using ActiveDate & SelectedDate DPs of XamMonthCalendar via Triggers?
Nothing that you would do using triggers. You could write your own command that will set the SelectedDate (and ActiveDate) and then invoke the MaskedEditorCommands.ToggleDropDown. e.g.
public class CustomMonthCalendarCommands { static CustomMonthCalendarCommands() { CommandManager.RegisterClassCommandBinding( typeof( XamMonthCalendar ), new CommandBinding( SelectAndActivateDate, new ExecutedRoutedEventHandler( OnExecuted ), new CanExecuteRoutedEventHandler( OnCanExecute ) ) ); } private static void OnExecuted(object sender, ExecutedRoutedEventArgs e) { if ( e.Command == SelectAndActivateDate ) { var mc = sender as XamMonthCalendar; MonthCalendarCommands.ActivateDate.Execute( e.Parameter, e.OriginalSource as IInputElement ); mc.SelectedDate = mc.ActiveDate; MaskedEditorCommands.ToggleDropDown.Execute( null, e.OriginalSource as IInputElement ); } } private static void OnCanExecute(object sender, CanExecuteRoutedEventArgs e) { if ( e.Command == SelectAndActivateDate ) { e.CanExecute = MonthCalendarCommands.ActivateDate.CanExecute( e.Parameter, e.OriginalSource as IInputElement ); e.Handled = true; } } public static readonly RoutedCommand SelectAndActivateDate = new RoutedCommand("SelectAndActivateDate", typeof(CustomMonthCalendarCommands)); }
Then you would reference that command. You might also leave the content set up the way it was but bind to the CommandParameter which has the date to display.
<igWindows:StringFormatConverter x:Key="StrFormatConv" /> <Style TargetType="{x:Type Button}" x:Key="{x:Static igEditors:XamMonthCalendar.TodayButtonStyleKey}"> <Setter Property="Command" Value="{x:Static local:CustomMonthCalendarCommands.SelectAndActivateDate}" /> <Setter Property="Content"> <Setter.Value> <MultiBinding Converter="{StaticResource StrFormatConv}" Mode="OneWay"> <Binding Path="Value" Source="{x:Static igEditors:Resources.TodayButtonCaption}" /> <Binding Path="CommandParameter" RelativeSource="{RelativeSource Self}" /> </MultiBinding> </Setter.Value> </Setter>
Hi Kevin,
If you would like to follow up on your product idea you should contact Developer Support management via email. Please include the reference number of your product idea, PI12100060 in the subject and body of your email message.
You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Hello,
has there been any updates to the Product Idea PI12100060?
Regards,
Kevin
I have submitted an additional product idea for you with the details that you and Andrew described here, directly to our Product Management team. Our product team chooses new product ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products so as trends appear in product ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your features are chosen for development you will be notified at that time. Your reference number is PI12100060. If you need any further assistance please do not hesitate to ask.