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
40
How to adjust VisibleMinimum and VisibleMaximum to some custom dates using ScrollScale and ScrollPosition?
posted

Hi Folks,

I am new to xamtimeline control, i am trying to allow the user to select only the week end dates say Saturday in both the end,

For example ,

suppose the user left the "zoom bar" in the Monday that should adjust to adjacent Saturday in the timeline control, i need this kind of behavior

should happen in both the end.

i tried with adjusting "scroll scale" and "scroll position" properties to adjust the "visible maximum" and "visible minimum" , i am not able to achieve this can anyone please help me to get this done.

i have attached my sample code for reference.

Thanks in advance.

AdjustXamTimeLineTooltip.zip
Parents
No Data
Reply
  • 12875
    posted

    Hi, 

    There is a section of this documentation specifically concerning the zoombar and Integration with xamTimeLine.

    https://help.infragistics.com/Doc/Silverlight/2012.1/CLR4.0/?page=xamZoombar_Using_xamZoombar.html 

    This may also be helpful for general information but it is specifically concerning the xamZoombar as a separate control.

    https://help.infragistics.com/Doc/Silverlight/2012.1/CLR4.0/?page=xamZoombar_Getting_Started_with_xamZoombar.html 

    I’ll assume that you are using a DateTimeAxis, so you might set the Minimum and Maximum to dates as in the following Axis definition:

    <ig:XamTimeline x:Name="xamTimeline1"

                        Margin="0">

        <ig:XamTimeline.PreviewAxis>

            <ig:PreviewAxis ShowLabels="True" ShowMajorTickMarks="True" ShowMinorTickMarks="True"/>

        </ig:XamTimeline.PreviewAxis>

     

        <ig:XamTimeline.Axis>

        <ig:DateTimeAxis Minimum="07/01/2012" Maximum="07/31/2012"

             AutoRange="False"

             UnitType="Days"   Unit="31"                                 

             ScrollPosition=".0323"

             ScrollScale=".225806452"

                             />

        </ig:XamTimeline.Axis>

    </ig:XamTimeline>

     

    I have added DateTimeEntry items with time values over several weeks. 

    The ScrollPosition and ScrollScale will be values between 0 and 1. 

    ScrollScale sets the level of magnification in the timeline. The value is expressed as a value between 0 and 1. For example, a value of .5 for the ScrollScale means that 50 percent of the timeline is displayed. 

    ScrollPosition determines the position of the slider in the xamZoombar, effectively controlling the xamTimeline control’s current viewable area. The value is expressed as a value between 0 and 1. 

    And you would be setting the initial settings of these properties. Your uses will be able to stretch the thumb and move the thumb along the zoombar modifying your initial settings. 

    If you want to show only 1 week of a 31 day month you would want to calculate the fraction of the month that 7 days represents, which I believe would be .225806452.  That would be your ScrollScale to show 7 days.  

    Where along the zoombar do you want the thumb to appear; which week should be visible?  Actually which 7 days, if you want to show the first Monday to Sunday, you would need to know when the first Monday is in the month and how many days are in you range of data.  

    In July 2012, the first Monday is the 2nd so you would need to take that into consideration in determining the scaleposition value.  I set the ScrolPosition to .323 which positioned the thumb at the first Monday.

    Please let me know if you have any question.

Children