Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic some MonthSettings weirdness (Read 5453 times)
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
some MonthSettings weirdness
Jan 29th, 2010 at 9:56am
Print Post  
Code
Select All
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:schedule="http://mindfusion.eu/scheduling/wpf"
xmlns:schedCode="clr-namespace:MindFusion.Scheduling;assembly=MindFusion.Scheduling.Wpf">

<schedule:Calendar Name="calendar" CurrentView="MonthRange" Theme="Vista"  Date="2010-01-01">
<schedule:Calendar.MonthRangeSettings>
<schedule:MonthRangeSettings NumberOfMonths="4" MonthsPerRow="2" VisibleRows="2" />
</schedule:Calendar.MonthRangeSettings>

<schedule:Calendar.MonthSettings>
<schedule:MonthSettings WeekHeaderStyle="Left">
<schedule:MonthSettings.DaySettings>
<schedule:CellSettings HeaderSize="12">
<schedule:CellSettings.HeaderStyle>
<schedule:CalendarStyle FontSize="8" Foreground="Lime" />
</schedule:CellSettings.HeaderStyle>
</schedule:CellSettings>
</schedule:MonthSettings.DaySettings>
</schedule:MonthSettings>
</schedule:Calendar.MonthSettings>

<schedule:Calendar.Schedule>
<schedCode:Schedule>
<schedCode:Schedule.Items>
<schedCode:Appointment StartTime="2010-02-01" AllDayEvent="True" HeaderText="Test" />
</schedCode:Schedule.Items>
</schedCode:Schedule>
</schedule:Calendar.Schedule>
</schedule:Calendar>
</UserControl> 



  • Is there a style setting for the overflow days (2009-12-27 - 2009-12-31 and 2010-04-1 - 2010-04-08)?
  • add 'Height="600"' to the Calendar node: The appointment becomes visible -- no problem here.
  • change 'Height="600"' to 'Width="600"': The day-of-week header is far too big (height) now -- the WeekHeader is totally misaligned
  • add 'HeaderPosition="Left"' to MonthSettings.DaySettings: Still no appointment is being shown -- you'll have to add Height>400 to the Calendar node (but at least then the day-of-week header and WeekHeader work well again).
  • remove the Width and Height from the Calendar node and add 'TrailingWeekCount="3" LeadingWeekCount="3"' to MonthSettings: Only the first and the last month have the correct amount of trailing/leading weeks, Feb and Mar have corrupt day-of-week headers again and the WeekHeader is misaligned everywhere (even when you remove 'FontSize="8"' from MonthSettings.HeaderStyle).
  

/\/\arkus.
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: some MonthSettings weirdness
Reply #1 - Jan 29th, 2010 at 11:48am
Print Post  
Another version of the control can be downloaded from the link below:

[url]https://mindfusion.eu/_pln_trial/MindFusion.Scheduling.Wpf.2.1b.zip[/url]

The Calendar control no longer attempt to calculate a desirable size for its content. It now uses all of the available space unless its Width and Height properties have been set explicitly. Therefore, placing the control in a grid cell will cause the control to span the entire cell. Let me know if this behavior works well for you.

[quote]Is there a style setting for the overflow days (2009-12-27 - 2009-12-31 and 2010-04-1 - 2010-04-08)? [/quote]
The style of the so-called padding dates can be customized through the MonthSettings.PaddingDaysStyle property.

[quote]Only the first and the last month have the correct amount of trailing/leading weeks...[/quote]
This is by design. In MonthRange view only the first and the last months display padding days.

Regards,
Meppy
  
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: some MonthSettings weirdness
Reply #2 - Jan 29th, 2010 at 12:00pm
Print Post  
Now I get in designer:
Code
Select All
System.InvalidOperationException
Layout measurement override of element 'MindFusion.Scheduling.Wpf.Calendar' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size.
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.ZoomableViewPresenter.DesignerBackground.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder.Initialize()
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder..ctor(UIElement content)
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.get_ViewHandle()
   at MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView() 



Reminds me of the time when I did a custom panel implementation some time ago.
  

/\/\arkus.
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: some MonthSettings weirdness
Reply #3 - Feb 1st, 2010 at 8:57am
Print Post  
  
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: some MonthSettings weirdness
Reply #4 - Feb 1st, 2010 at 9:29am
Print Post  
Hmm.. Now the size is 0?

BTW:
Quote:
Therefore, placing the control in a grid cell will cause the control to span the entire cell. Let me know if this behavior works well for you

Then the grid cell will give the control explicit width and height.
But if you look at the initial sample: Neither the usercontrol nor the calendar control has width or height set.
I know it's not simple especially with MonthsPerRow>1 -- but an automatic height which at least shows items (if there are any) but doesn't take too much space would be very cool.
  

/\/\arkus.
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: some MonthSettings weirdness
Reply #5 - Feb 1st, 2010 at 10:56am
Print Post  
We will try to implement automatic measurement in the future. But as of yet, the control size should be set explicitly.

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