Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic WPF Scheduling: WorkTime (Read 6319 times)
Heli
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 44
Joined: Aug 29th, 2016
WPF Scheduling: WorkTime
Feb 13th, 2017 at 8:03pm
Print Post  
Hi,

in a Timetable view, I tried to enable a WorkTime visual effect by configuring TimetableSettings to ShowWorkTime=True, set WorkTimeStart and WorkTimeEnd to suitable TimeSpan values.

It compiles and runs, but I don't see any effect.

Tried with Themes Light and Silver.

Regards,
Heli
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: WPF Scheduling: WorkTime
Reply #1 - Feb 14th, 2017 at 2:11pm
Print Post  
Hi,

Try settings Calendar.TimetableSettings.WorkTimeCellStyle.Background to the desired color of the work-time cells. Also make sure that you are inspecting a work day (Mon-Fri).

Regards,
Meppy
  
Back to top
 
IP Logged
 
Heli
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 44
Joined: Aug 29th, 2016
Re: WPF Scheduling: WorkTime
Reply #2 - Feb 14th, 2017 at 3:59pm
Print Post  
WorkTime coloring still doesn't work (I applied your hint above and used the new build from today: http://mindfusion.eu/Forum/YaBB.pl?num=1487013600/2#2).

I set
Code
Select All
WorkTimeStart = new TimeSpan(8, 0, 0);
WorkTimeEnd = new TimeSpan(16, 0, 0); 


and some ugly background color, but the color does not appear.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: WPF Scheduling: WorkTime
Reply #3 - Feb 16th, 2017 at 9:52am
Print Post  
Hi,

A new version of the Calendar component can be downloaded from the link below along with a sample. The sample displays the work time in a Timetable. Let me know if this works for you. We've also rolled back the changes to the navigation buttons. In order to prevent the buttons from overlapping left-aligned texts now, use the ContentMargin property. This is illustrated in the sample as well. The new version also includes a ShowPaddingItems property as requested here and also fixes the other discussed issues.

https://mindfusion.eu/_temp/WpfApplication8.zip

Regards,
Meppy
  
Back to top
 
IP Logged
 
Heli
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 44
Joined: Aug 29th, 2016
Re: WPF Scheduling: WorkTime
Reply #4 - Feb 16th, 2017 at 12:12pm
Print Post  
I'm doing most work in XAML and MVVM, so I use bound properties for WorkTimeStart and WorkTimeEnd.

And there seems to be the problem.
With
Code
Select All
<planner:TimetableSettings ShowWorkTime="True" WorkTimeStart="08:00:00" WorkTimeEnd="16:00:00" ... /> 

the WorkTime coloring is applied (works).

With
Code
Select All
<planner:TimetableSettings ShowWorkTime="True" WorkTimeStart="{Binding MyWorkTimeStart}" WorkTimeEnd="{Binding MyWorkTimeEnd}" ... /> 

the coloring is missing. The properties are set early enough and with the same TimeSpan values as above.

Regards,
Heli
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: WPF Scheduling: WorkTime
Reply #5 - Feb 16th, 2017 at 2:35pm
Print Post  
Hi,

Binding the WorkTimeStart property works well in this sample: https://mindfusion.eu/_temp/WpfApplication8.2.zip. Make sure you are not assigning this property directly because the assigned value will override the binding.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: WPF Scheduling: WorkTime
Reply #6 - Feb 21st, 2017 at 3:21pm
Print Post  
Hi,

Apparently the settings objects were not logical children of the Calendar control, so they did not inherit the calendar's DataContext. This version should fix this: https://mindfusion.eu/_temp/MindFusion.Scheduling.Wpf.2.zip

However, I still recommend making your source properties binding properties or implementing the INotifyPropertyChanged interface on your data source. Otherwise subsequent changes to those properties will not be detected by the bindings.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Heli
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 44
Joined: Aug 29th, 2016
Re: WPF Scheduling: WorkTime
Reply #7 - Feb 22nd, 2017 at 8:02am
Print Post  
Hi Meppy,

this version works for me, thanks!

Regards,
Heli
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint