Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Sometimes incorrect style is used by the calendar control (Read 8900 times)
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Sometimes incorrect style is used by the calendar control
Mar 4th, 2013 at 11:04pm
Print Post  
I use different speciaiisations of appointments. They each have there own ItemPresenter.
I subscribe to the event ItemPresenterCreated of the calendar and then set the corresponding Style depending on the type of presenter.
It appears that when navigating to another month some times an incorrect style is used by the control. In this example, on the 9th of march style A is used, however when navigating to april, style B should be shown on the 13th (same cell location as march), but incorrectly style A is used.
If I reload the calendar while staying at april, then style B is used correclty, but then style B is also used incorrectly when navigating back to march.
  

StyleA_march_is_OK.png (Attachment deleted)
StyleA_april_is_wrong.png (Attachment deleted)
reload_sched_now_styleB_is_used_for_april_isOK.png (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Sometimes incorrect style is used by the calendar control
Reply #1 - Mar 5th, 2013 at 12:29pm
Print Post  
Hi,

First, make sure you are using the most up-to-date version of the component - there were several problems related to item presenters that were fixed not long ago. Then, keep in mind that for performance reasons the ItemPresenter objects that are no longer in use are being reused for other items. If an ItemPresenter associated with an item of type A is later reused for an item of type B, you need to update its style accordingly. To get notified when the item associated with a presenter has changed, override the ItemPresenter.OnItemChanged method.

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


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: Sometimes incorrect style is used by the calendar control
Reply #2 - Mar 6th, 2013 at 9:38pm
Print Post  
I am using the trial 2 version you provided me in another thread (Re: convert calendar into pdf).
It is not the style that is incorrect, but the ItemPresenter object. I have 2 different ItemPresenter classes.
I've overridden the OnItemChanged and indeed I noticed that an ItemPresenter of Type_A object is at some point associated with an Item of Type_B object. This should not happen. ItemPresenter Type_A should only be re-used for Items of Type_A.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Sometimes incorrect style is used by the calendar control
Reply #3 - Mar 7th, 2013 at 2:04pm
Print Post  
This is a bug in the control. We are currently working on a fix and I will get back to you when we have something ready.

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


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: Sometimes incorrect style is used by the calendar control
Reply #4 - Mar 8th, 2013 at 9:31am
Print Post  
Thanks, in the meantime I got another exception in the same area. When removing the recurrence of an item I get a NullReferenceException. Call stack:

bij MindFusion.Scheduling.Silverlight.ItemPresenter.OnItemChanged(Item oldItem, Item newItem)
bij Trainers.CalendarHelpers.TrainingPresenter.OnItemChanged(Item oldItem, Item newItem)
bij MindFusion.Scheduling.Silverlight.ItemPresenter.OnItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
bij System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyPrope
rty dp, Object oldValue, Object newValue)
bij System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
bij System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
bij System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
bij MindFusion.Scheduling.Silverlight.ItemPresenter.set_Item(Item value)
bij A.c6d9dec63fbcdc1ec515a79b519234bee.UpdateItemPosition(Calendar calendar, c97e5673e0c605b2971b80c00b1256bf7 viewCell, Object parameter, Boolean timetableAllDay, c344a63b1287e10df4eee7c38a9892791 type)
bij MindFusion.Scheduling.Silverlight.MonthCellPresenter.cbeec0a808111aad1dd337d8d0a
35d972(c344a63b1287e10df4eee7c38a9892791 c4df335d6ed4bb0b313af384e60306a1c, Object cc1777c2113ae99e09937fa474900c19f)
bij A.c00a0a20e7f2f172e54529cdba3d483ba.Update(c344a63b1287e10df4eee7c38a9892791 type, Object parameter)
bij MindFusion.Scheduling.Silverlight.Calendar.cbeec0a808111aad1dd337d8d0a35d972(c34
4a63b1287e10df4eee7c38a9892791 c4df335d6ed4bb0b313af384e60306a1c, Object cc1777c2113ae99e09937fa474900c19f)
bij MindFusion.Scheduling.Silverlight.Calendar.OnItemRecurrenceReset(Object sender, ItemEventArgs e)
bij System.EventHandler`1.Invoke(Object sender, TEventArgs e)
bij MindFusion.Scheduling.ItemCollection.cac7722afe7a45b1ac5c756be5d334b1b(ItemEvent
Args ce5351bab187b73ac3548a065b6b6ff6d)
bij MindFusion.Scheduling.ItemCollection.cac7722afe7a45b1ac5c756be5d334b1b(Object cd89110e0d8f938c1c45fa78e7d96162c, EventArgs ce5351bab187b73ac3548a065b6b6ff6d)
bij MindFusion.Scheduling.Item.c223fe7df29e0f6584284eb0894e76e5f(EventArgs ce5351bab187b73ac3548a065b6b6ff6d)
bij MindFusion.Scheduling.Item.set_Recurrence(Recurrence value)
bij MindFusion.Scheduling.Item.set_Recurrence(Recurrence value)
bij Trainers.Dialogs.EditTraining.<>c__DisplayClass2.<.ctor>b__0(Object s2, EventArgs e2)
bij System.Windows.Controls.ChildWindow.OnClosed(EventArgs e)
bij System.Windows.Controls.ChildWindow.Close()
bij System.Windows.Controls.ChildWindow.set_DialogResult(Nullable`1 value)
bij Trainers.Dialogs.EditTraining.OKButton_Click(Object sender, RoutedEventArgs e)
bij System.Windows.Controls.Primitives.ButtonBase.OnClick()
bij System.Windows.Controls.Button.OnClick()
bij System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEve
ntArgs e)
bij System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
bij MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Sometimes incorrect style is used by the calendar control
Reply #5 - Mar 11th, 2013 at 11:10am
Print Post  
Hi again,

Check out the version of the control below. It should address the problems discussed in this topic.

https://mindfusion.eu/_temp/MindFusion.Scheduling.Silverlight.trial3.zip

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


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: Sometimes incorrect style is used by the calendar control
Reply #6 - Mar 11th, 2013 at 5:53pm
Print Post  
Thanks, both problems seem to be fixed.
1 thing I still notice is that the arrow sometimes appears in the calender at different locations while there are no events for that day.
  

arrow.png (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Sometimes incorrect style is used by the calendar control
Reply #7 - Mar 12th, 2013 at 8:57am
Print Post  
  
Back to top
 
IP Logged
 
SLUser
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 34
Joined: Dec 7th, 2012
Re: Sometimes incorrect style is used by the calendar control
Reply #8 - Mar 12th, 2013 at 6:23pm
Print Post  
The arrows keeps appearing also with this latest version. The reason seems to be that it appears correctly in a certain month because not all items are visible for that day. But when navigating to a previous/next month it remains visible at the same day of the month even if all items are visible for that day.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Sometimes incorrect style is used by the calendar control
Reply #9 - Mar 13th, 2013 at 7:16am
Print Post  
I am not able to reproduce this using the latest version. Are you using the SingleMonth view?

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