Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
680
XamScheduleView
posted

Hi

I'm trying to follow the help guide 'Creating a XamSchedule in XAML'.

As you can see, I'm not getting the "Amanda" in the CalendarHeaderVertical. Code follows below.

Also, I take it there's no way to make the "0830"... "0900"... "0930" smaller, so I can fit this control in without having to scroll horizontally?

 

 

--------

XAML

---------

            <ig:XamScheduleView
                x:Name="scheduleView"
                Grid.Column="0"
                Grid.ColumnSpan="3"
                Grid.Row="2"
                ShowWorkingHoursOnly="True"
                CurrentTimeIndicatorVisibility="Collapsed"
                ShowCalendarCloseButton="True"
                ShowCalendarOverlayButton="True"
                CalendarDisplayMode="Overlay">

                <ig:XamScheduleView.DataManager>
                    <ig:XamScheduleDataManager
                        x:Name="dataManager">

                        <ig:XamScheduleDataManager.Settings>
                            <ig:ScheduleSettings
                                WorkDays="Monday, Tuesday, Wednesday, Thursday, Friday">
                                <ig:ScheduleSettings.WorkingHours>
                                    <ig:WorkingHoursCollection>
                                        <ig:TimeRange
                                            Start="08:30"
                                            End="17:00" />
                                    </ig:WorkingHoursCollection>
                                </ig:ScheduleSettings.WorkingHours>
                            </ig:ScheduleSettings>
                        </ig:XamScheduleDataManager.Settings>

                        <ig:XamScheduleDataManager.CalendarGroups>
                            <ig:CalendarGroup
                                InitialCalendarIds="own1[cal1]" />
                        </ig:XamScheduleDataManager.CalendarGroups>


                        <ig:XamScheduleDataManager.DataConnector>
                            <ig:ListScheduleDataConnector
                                x:Name="dataConnector">
                            </ig:ListScheduleDataConnector>
                        </ig:XamScheduleDataManager.DataConnector>

                    </ig:XamScheduleDataManager>
                </ig:XamScheduleView.DataManager>
            </ig:XamScheduleView>

 

--------

CODE

---------

            var resources = new ObservableCollection<Resource>();
            resources.Add(new Resource
            {
                Id = "own1",
                Name = "Amanda"
            });

            var calendars = new ObservableCollection<ResourceCalendar>();
            calendars.Add(new ResourceCalendar
            {
                Id = "cal1",
                OwningResourceId = "own1"
            });

            var appointments = new ObservableCollection<Appointment>();
            appointments.Add(new Appointment
            {
                Id = "t1",
                OwningCalendarId = "cal1",
                OwningResourceId = "own1",
                Subject = "Appointment 1",
                Description = "My first appointment",
                // Convert the date to universal time, because a time zone is not set
                // in this snippet   
                Start = DateTime.Today.AddHours(9).AddMinutes(12).ToUniversalTime(),
                End = DateTime.Today.AddHours(11).AddMinutes(42).ToUniversalTime()
            });
            appointments.Add(new Appointment
            {
                Id = "t2",
                OwningCalendarId = "cal1",
                OwningResourceId = "own1",
                Subject = "Appointment 2",
                Description = "My second appointment",
                // Convert the date to universal time, because a time zone is not set
                // in this snippet   
                Start = DateTime.Today.AddHours(10).AddMinutes(12).ToUniversalTime(),
                End = DateTime.Today.AddHours(11).AddMinutes(42).ToUniversalTime()
            });

            dataConnector.ResourceItemsSource = resources;
            dataConnector.ResourceCalendarItemsSource = calendars;
            dataConnector.AppointmentItemsSource = appointments;

  • 54937
    Offline posted

    grapentin said:

    As you can see, I'm not getting the "Amanda" in the CalendarHeaderVertical. Code follows below.

    ResourceCalendar is not required if you are just going to have 1 ResourceCalendar per resource but if you are going to use them then you should also provide a Name for the ResourceCalendar since the Name of the ResourceCalendar is used (as well as the Resource's Name depending on the CurrentUser). If you don't use ResourceCalendars (i.e. don't provide the ItemsSource and don't provide the mappings) then the connector will create a default ResourceCalendar per Resource and the name of the Calendar will be that of the Resource.

    grapentin said:
    Also, I take it there's no way to make the "0830"... "0900"... "0930" smaller, so I can fit this control in without having to scroll horizontally?

    The TimeslotInterval determines the interval of the timeslots. The size of that element is based on its ControlTemplate (ScheduleViewTimeslotHeader in the case of XamSchedule). Note, there is no property that would change the TimeslotInterval based on the available size so whether horizontal scrolling is on or not will just be a factor of the total number of timeslots * the size of the timeslots relative to the available space for the timeslots.