Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Calendar layout update. (Read 6648 times)
zodraz
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 29
Joined: Jan 14th, 2011
Calendar layout update.
Mar 1st, 2011 at 8:30am
Print Post  
Hi,

        I've created a calendar and assigned several appoinments, however these are not properly rendered until I do an operation on the calendar, say moving backwards on months...

I've tried to use UpdateLayout function but nothing happens...

My code looks like this:

public MyView()
       {
           InitializeComponent();
           //this.btHelperLoader.IsEnabledChanged += new DependencyPropertyChangedEventHandler(btHelperLoader_IsEnabledChanged);
           calendar.AllowAutoScroll = true;
           calendar.Date = new DateTime(2012, 1, 1);
           calendar.EndDate = new DateTime(2012, 12, 31);
           calendar.FirstWeekendDay = DayOfWeek.Monday;
           calendar.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
           calendar.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;

           calendar.CurrentView = CalendarView.MonthRange;
           calendar.MonthRangeSettings.NumberOfMonths = 12;
           calendar.MonthRangeSettings.MonthsPerRow = 6;

           calendar.ItemSettings.Size = 25;
           calendar.MonthSettings.DaySettings.HeaderSize = 10;

           Appointment app = new Appointment();
           app.HeaderText = "500\r\nC-D";
           //app.DescriptionText = "500-600";
           app.StartTime = new DateTime(2012, 1, 25);
           app.EndTime = new DateTime(2012, 1, 25);

           calendar.Schedule.Items.Add(app);

           app = new Appointment();
           app.HeaderText = "600\r\nC";
           //app.DescriptionText = "500-600";
           app.StartTime = new DateTime(2012, 1, 2);
           app.EndTime = new DateTime(2012, 1, 2);

           calendar.Schedule.Items.Add(app);

           app = new Appointment();
           app.HeaderText = "103\r\nD";
           //app.DescriptionText = "500-600";
           app.StartTime = new DateTime(2012, 1, 3);
           app.EndTime = new DateTime(2012, 1, 3);

           calendar.Schedule.Items.Add(app);

           calendar.UpdateLayout();
       }

Thanks,

Zodraz


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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Calendar layout update.
Reply #1 - Mar 1st, 2011 at 8:55am
Print Post  
I cannot reproduce this here. Try wrapping the initialization in a BeginInit/EndInit block:

Code
Select All
calendar.BeginInit();
// Initialization
calendar.EndInit(); 


Let me know if this helps.

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


I love YaBB 1G - SP1!

Posts: 29
Joined: Jan 14th, 2011
Re: Calendar layout update.
Reply #2 - Mar 1st, 2011 at 9:14am
Print Post  
Works like a charm!!!

Thanks,

Zodraz
  
Back to top
 
IP Logged
 
zodraz
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 29
Joined: Jan 14th, 2011
Re: Calendar layout update.
Reply #3 - Mar 3rd, 2011 at 5:26pm
Print Post  
Hi,

     My application needs to update the UI several times, when I first call BeginInit/EndInit it works fantastically, but for the second time makes it crash...

The crash is odd...Its about dependency properties and for a font family... Here it is the error:

ensaje: Unhandled Error in Silverlight Application
Code: 4004   
Category: ManagedRuntimeError      
Message: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: System.ArgumentException: '' no es un valor válido para la propiedad 'FontFamily'.
   en MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   en MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
   en System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
   en System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
   en System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   en System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
   en System.Windows.Data.BindingExpression.SendDataToTarget()
   en System.Windows.Data.BindingExpression.SourcePropertyChanged(PropertyPathListener
sender, PropertyPathChangedEventArgs args)
   en System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(PropertyPathSte
p source)
   en System.Windows.PropertyAccessPathStep.RaisePropertyPathStepChanged(PropertyListe
ner source)
   en System.Windows.DependencyPropertyListener.SourcePropertyChanged(DependencyObject
sender, DependencyProperty dp)
   en System.Windows.Data.WeakDependencyPropertyChangedListener.SourcePropertyChanged(
DependencyObject sender, DependencyProperty dp)
   en System.Windows.DPChangedEventHandler.Invoke(DependencyObject sender, DependencyProperty dp)
   en System.Windows.DependencyObject.OnPropertyChanged(DependencyProperty dp)
   en System.Windows.FrameworkElement.OnPropertyChanged(DependencyProperty dp)
   en System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyPrope
rty dp, Object oldValue, Object newValue)
   en System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   en System.Windows.DependencyObject.InvalidateProperty(DependencyProperty property)


At the top on spanish is the error related to font family: "Not a valid value for font family"

Hope this will be fixed...Since it is cxrucial for my application...

Thanks,

Zodraz
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Calendar layout update.
Reply #4 - Mar 4th, 2011 at 8:43am
Print Post  
I am not able to reproduce this here. Are you able to supply me with a small sample application which causes this exception to occur?

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