Right now, I have attached properties added to the month calendar control and based on the dates that are selected, i am switching the different schedule views and clearing the visible days and updating it with the selected date range.
Please Suggest.
Thanks in advance,
Hariharan
This is actually something we just added in 11.1. We added 2 new schedule controls - xamDateNavigator and xamOutlookCalendarView.
xamDateNavigator is a month calendar similar to the xamMonthCalendar that integrates with the schedule datamanager and has the ability to display bold for dates with activity of the CurrentUser of the xamScheduleDataManager and also can show the activity for a given date in the tooltip for that day.
xamOutlookCalendarView is a composite control that contains day/month/schedule view and switches between the views based on interaction with the control similar to that of Outlook - e.g. clicking on a week header in the month view shifts to week view for that week, clicking a day header in month/day/week view shifts to day view for that day, keyboard shortcuts can switch between modes, and the modes can automatically switch between day/schedule view based on the number of calendars visible (just as they do in outlook). In addition the control exposes a property named DateNavigator that is used to synchronize selection between a month calendar control and the outlook calendar view similar to that of outlook. You can set this property to an instance of a xamDateNavigator (i.e. you would set this property to a Binding whose ElementName is the xamDateNavigator you have within your ui).
Thanks Much! That sure makes it a lot cleaner.
Is this when using the xamOutlookCalendarView or just in general? Those errors are meant to indicate missing information that is required for the controls to be used. In this case it's indicating that the CurrentUserId of the xamScheduleDataManager you are using has not been set and there are no CalendarGroup instance in the CalendarGroups collection. The latter would only be needed if you wanted to display multiple calendars.
My Bad. Let me give you more details. So I wrapped the XamOutlookCalendarView inot my own user control and the UC has three dependency proeprties which are of type IEnumerable for Resources,ResourceCalendars and Appointments. These are inturn bound to ListScheduleDataConnector.
Here is the pseudo code::
UC.xaml.cs:
DP - IEnumerable Resources
DP - IEnumerable ResourceCalendars
DP - IEnumerable Appointments
UC.xaml:
<Schedules:ListScheduleDataConnector HorizontalAlignment="Left" Name="listScheduleDataConnector1" VerticalAlignment="Top" ResourceItemsSource="{Binding ResourceMembers, Mode=TwoWay}" ResourceCalendarItemsSource="{Binding ResourceCalendars, Mode=TwoWay}" AppointmentItemsSource="{Binding Appointments, Mode=TwoWay}">
Now my main view has my custom UC in it and binds values for all three lists. But I do not see any calendars in the UI and the messges from my previous post are shown in the output window.
<Controls:OSScheduler DateNavigator="{Binding ElementName=dateNavigator}" ResourceMembers="{Binding WorkQueueFilterList}" Grid.Column="1" ResourceCalendars="{Binding ResourceCalendars}"/
hariharan019 said: My Bad. Let me give you more details. So I wrapped the XamOutlookCalendarView into my own user control and the UC has three dependency proeprties which are of type IEnumerable for Resources,ResourceCalendars and Appointments. These are inturn bound to ListScheduleDataConnector. Here is the pseudo code:: UC.xaml.cs: DP - IEnumerable Resources DP - IEnumerable ResourceCalendars DP - IEnumerable Appointments UC.xaml: <Schedules:ListScheduleDataConnector HorizontalAlignment="Left" Name="listScheduleDataConnector1" VerticalAlignment="Top" ResourceItemsSource="{Binding ResourceMembers, Mode=TwoWay}" ResourceCalendarItemsSource="{Binding ResourceCalendars, Mode=TwoWay}" AppointmentItemsSource="{Binding Appointments, Mode=TwoWay}"> Now my main view has my custom UC in it and binds values for all three lists. But I do not see any calendars in the UI and the messges from my previous post are shown in the output window. <Controls:UC DateNavigator="{Binding ElementName=dateNavigator}" ResourceMembers="{Binding WorkQueueFilterList}" Grid.Column="1" ResourceCalendars="{Binding ResourceCalendars}"/
My Bad. Let me give you more details. So I wrapped the XamOutlookCalendarView into my own user control and the UC has three dependency proeprties which are of type IEnumerable for Resources,ResourceCalendars and Appointments. These are inturn bound to ListScheduleDataConnector.
Also, I need to display multiple resources , which means multiple calendars. Do i need to set CurrentUser and CalendarGroupCollections? Shouldn't it internally populate the calendar groups based on the resource calendars?In my case, since its a wrapped user control, there is no direct way for me to set those.
Thank You,
hariharan019 said:Also, I need to display multiple resources , which means multiple calendars. Do i need to set CurrentUser and CalendarGroupCollections?
The CurrentUser(Id) is used to determine the primary user and affects things like the reminders. Also when no CalendarGroups are provided it is the PrimaryCalendar of the CurrentUser that is displayed. If you want to display multiple calendars then you need to put CalendarGroup instances in the CalendarGroups of the xamScheduleDataManager or the CalendarGroupsOverride of the view control. The various requirements for the schedule controls are described here.
hariharan019 said:Shouldn't it internally populate the calendar groups based on the resource calendars?In my case, since its a wrapped user control, there is no direct way for me to set those.
The control does not assume that all the calendars should be displayed. If you want to make that assumption then perhaps you can handle the 1st time the Loaded event is raised (it can be raised multiple times by the wpf framework) and then enumerate your resource calendars and create 1 or more calendar groups to contain them. Calendar groups are discussed in the help here.
Thanks.That worked.
hariharan019 said: am also having an issue while removing a resource from the list at runtime. I assume that the scheduler supports adding and removing resources and resource calendars at runtime ?
Yes resources may be removed and the ui should be updated. It could be the same type of timing issue you had with adding the resources. If you still have an issue then please post an updated sample that demonstrates the issue with removing the resources.
hariharan019 said:Next Type any name in the textbox below and click on the "Add" Button. This adds a new resource , and the calendar and creates the calendar group, but the calendar is not visible in the scheduler
private void OnCalendarsChanged(object sender, NotifyCollectionChangedEventArgs e) { this.Dispatcher.BeginInvoke(new NotifyCollectionChangedEventHandler(this.OnCalendarsChangedImpl), sender, e); } private void OnCalendarsChangedImpl(object sender, NotifyCollectionChangedEventArgs e) { /// this is where you do what you originally had in the OnCalendarsChanged...
private void OnCalendarsChangedImpl(object sender, NotifyCollectionChangedEventArgs e) { /// this is where you do what you originally had in the OnCalendarsChanged...
I am also having an issue while removing a resource from the list at runtime. I assume that the scheduler supports adding and removing resources and resource calendars at runtime ?
Please review the sample project attached in my previous post and suggest a response.
Have you had a chance to look at my attached sample project?