Hi
I'm using XamScheduleDataManger in my SL5 application.
I have problem showing working hour. I set 00:00 to 23:59:59(as I didn't want to have "NOT Working hour" Highlithed) as Working hour and now the XamDayView default starting time is 00:00, and every time i need to scroll down to see my appointments.
So I've following questions:
1) How can i remove "NOT working Hour" Highlighting ? (without changing default working hours)
2) How can i set the Start time so when I show XamDayView or XamWeekView it doesn't start from 00:00 but from xx:xx
3) Where can i get the default CalendarBrushes List ? (as I tried setting BaseColor property to different colors in ResourceCalendar but it's not good looking as the default Calendar brushes)
Thank you
Thank you Stefan for your help.
I created another post in XamSchedule forum, give it a look please!
Bye bye
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
To position the DayView(no matter what the working hours are) to certain hour of day i used the following code(positioning the scroll bar) :
private void XamDayView1_Loaded(object sender, RoutedEventArgs e){ ScrollBar scrollBar = (ScrollBar)GetDescendantFromName(XamDayView1, "TimeslotScrollBar");
double nowOffset = (DateTime.Now.Hour + 1) / 24.0; scrollBar.Value = nowOffset * scrollBar.Maximum;}
///
/// Gets a descendant FrameworkElement based on its name./// /// A descendant FrameworkElement with the specified name or null if not found.public static FrameworkElement GetDescendantFromName(DependencyObject parent, string name){ int count = VisualTreeHelper.GetChildrenCount(parent);
if (count < 1) return null;
FrameworkElement fe;
for (int i = 0; i < count; i++) { fe = VisualTreeHelper.GetChild(parent, i) as FrameworkElement; if (fe != null) { if (fe.Name == name) return fe;
fe = GetDescendantFromName(fe, name); if (fe != null) return fe; } }
return null;}
Just to add to what Stefan wrote, the Computed read-only properties exposed by the elements are the result of calculating the brushes for that element based on its state and based on the CalendarBrushProvider associated with that element. For elements that are not within the ResourceCalendar specific areas (e.g. the time slot headers), the brush provider comes from the DefaultBrushProvider of the CalendarColorSchemeResolved. For elements that are within a ResourceCalendar specific areas that are specific to a given ResourceCalendar (e.g. appointments), the brush provider comes from the BrushProvider of the associated ResourceCalendar (so that for example the Appointment shows using the BaseColor information for the calendar it is associated with). For other elements within the ResourceCalendar specific areas (e.g. timeslots), the brush provider comes from the ResourceCalendar that represents the selected calendar within the calendar group.
Once you have the brush provider you can index into it with the CalendarBrushId enum value that represents the brush you want to get.
Since the colors of the most elements are bound to Properties that begin with Computed (e.g CoputedBackgroud, ComputedBorderBrush, etc.), this means that these colors are accessible but cannot be modified, so if you want to change a particular color, you should copy its default Style and change the Binding or set the particular Background, Foreground to a static color. You can use XAML spy for example in order to examine the colors.
Hope this helps you.