I would be useful for MVVM to be able to bind the VisibleDates property to an ObservableCollection. Any reason why this can't be done?
Hello Geoff,
I have been looking into your request and although I am not quite sure what you mean by that I doubt that it is impossible. Usually this is a read-only property which gives you access to the days within the control and like other functionality and feature is decided on based mostly on popular demand along with other implementation criteria.
Here is the page where all our clients can influence/contribute to our product line: http://devcenter.infragistics.com/Protected/RequestFeature.aspx . If your suggestion is picked up for development you’ll be notified with an email.
Please let me know if you require any further assistance on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
In the examples where it shows multiple days it's demonstrated by clearing the VisibleDates property on the schedule and then repopulating it using the collection .Add() syntax.
The problem is this property is not a dependency property and I cannot bind to it in the XAML.
The ListScheduleDataConnector and WcfListScheduleDataConnector use Linq to query only the information that is needed so if your datasource is a linq enabled one (e.g. linq to sql) then only the information that is needed for the display will be loaded. If you wanted to try and manage this yourself then you would either write a custom dataconnector (which will be more involved but gives you control over providing the information that the datamanager is requesting on behalf of the controls with which it is associated) or you could hook the CollectionChanged of the VisibleDates of all the controls and aggregate them but I would make sure to do this asynchronously as the event could fire multiple times.
What about supporting a WCF Data Services data source? And it would require a custom query.
Hello,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
If this is what you were looking for please verify the answer so it helps other users as well.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support
The VisibleDates collection was a dead end on this one. With MVVM i was able to bind to the collection but then getting the changes back was just plain messy.
I ended up writing the data connector to pick up the data but that was also a bit of a challenge, the docs are very slim on detail.
There is still a problem I was unable to resolve and it is during the GetActivities call. The query is made async so a result is created and passed back to the caller, then the initialise is called with the data. I created Appointments from my data and then cast them with .ToList<IActivityBase> but the appointment is now displayed as a plain box on the screen.
The connection with the appointment seems lost, like the IActivity is cloned somewhere.
I would also like to set the DataItem on the appointment but this is readonly, why? I want to style the display to show an appointment status but there is just no connection back to the original appointment.
Hope you can help.
jifman said: There is still a problem I was unable to resolve and it is during the GetActivities call. The query is made async so a result is created and passed back to the caller, then the initialise is called with the data. I created Appointments from my data and then cast them with .ToList<IActivityBase> but the appointment is now displayed as a plain box on the screen.
jifman said: The connection with the appointment seems lost, like the IActivity is cloned somewhere.
There is no IActivity so I'm guessing you mean ActivityBase but I'm not sure what you mean by the connection being lost. Are you creating new activity (e.g. appointment) instances for each GetActivities call? The connector is supposed to return the same activity instance that represents a specific underlying activity item. The ListScheduleDataConnector does this for the items in its ItemsSource collections by maintaining a relationship between the Id of the dataitem and the activity that it handed out that represents that dataitem.
jifman said: I would also like to set the DataItem on the appointment but this is readonly, why? I want to style the display to show an appointment status but there is just no connection back to the original appointment.
Yes, I did mean ActivityBase, not IActivity.
I was setting the OwningResourceId and not the OwningResource as with the OwningResourceCalendar/Id and after changing that it all fell into place and worked.
Thanks for the thorough response.