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.
Yes as the user navigates the control with the keyboard (e.g. use the right arrow key in dayview to navigate to the next day) or uses the scrollbar in xamMonthView, the VisibleDates are updated to reflect the dates that are displayed by the control. Also depending upon properties you change on the control, the VisibleDates may change (e.g. changing the WeekMode for schedule/day view).
From the snippet you provided it looks like you are just looking to have a "one-time" binding since your collection will not be updated as the user scrolls nor will the control be updated if you change the contents of that collection. If you want to keep the two in sync then you would have to hook the control's VisibleDates collection and the collection you set in that property and keep the two in sync similar to what I described in my previous response.
So it does...
how do you propose to retrieve the data as the user navigates to these new dates?
Is there an event to hook up?
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
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.
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.
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.
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.
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.
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.
Hope you can help.