Hi,
In my app, I can create "appointments" and "quick appointments" : they are exactly the same but only the ScheduleViewDialog will be different.
So, I've implemented my ScheduleViewDialogHostFactory, and I want to let the user choose with the context menu :
How can I find what the user selected between the both on the ScheduleViewDialogHostFactory to display the correct window ?
I've tried to bind my own commands, and then call the ScheduleViewDialogHostFactory with a parameter like that :
But this scheduleView has no appointment attached...
Thanks.
In my app, I can create "appointments" and "quick appointments" : they are exactly the same but only the ScheduleViewDialog will be different.
So, I've implemented my ScheduleViewDialogHostFactory, and I want to let the user choose with the context menu :
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
>
<
telerik:RadMenuItem
Header
=
"New appointment..."
CommandTarget
=
"{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command
=
"schedule:RadScheduleViewCommands.CreateAppointment"
/>
<
telerik:RadMenuItem
Header
=
"New quick appointment..."
CommandTarget
=
"{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command
=
"schedule:RadScheduleViewCommands.CreateAppointment"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
How can I find what the user selected between the both on the ScheduleViewDialogHostFactory to display the correct window ?
I've tried to bind my own commands, and then call the ScheduleViewDialogHostFactory with a parameter like that :
<
telerik:RadMenuItem
Header
=
"New quick appointment..."
CommandTarget
=
"{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
Command
=
"{Binding QuickAppointmentCreated}"
CommandParameter
=
"{Binding Menu.UIElement, RelativeSource={RelativeSource Self}}"
/>
ScheduleViewModel.csScheduleViewDialogHostFactory.cspublic
ICommand QuickAppointmentCreated {
get
;
private
set
; }
QuickAppointmentCreated =
new
DelegateCommand(CreateQuickAppointment);
public
void
CreateQuickAppointment(
object
param)
{
RadScheduleView rsv = param
as
RadScheduleView;
IScheduleViewDialogHost cw = ScheduleViewDialogHostFactory.CreateNew(rsv, DialogType.AppointmentDialog, ModalType.QuickAppointment);
if
(cw !=
null
) { cw.Show(
true
); }
}
case
ModalType.QuickAppointment:
{
CwEditQuickAppointmentDialog cw =
new
CwEditQuickAppointmentDialog() { ScheduleView = scheduleView
cw.Closed +=
new
EventHandler<WindowClosedEventArgs>(Dialog_Closed);
return
cw;
}
But this scheduleView has no appointment attached...
Thanks.