MarkedZone moving

2 posts, 0 answers
  1. A K
    A K avatar
    20 posts
    Member since:
    Nov 2009

    Posted 21 Apr 2011 Link to this post

    Hi. I need to move some zone on chart (and resize) for changing period (AxisX) and refreshing table with data.
    My chart shows parameters for 3 months, and the table on page below can show more data for some selected period (see attached picture).

    I`ve done the moving and resizing things with ChartArea_PlotAreaMouseLeftButtonDown + ChartArea_MouseMove + ChartArea_PlotAreaMouseLeftButtonUp events. 

    1) Why didn`t you make ChartArea_PlotAreaMouseMove ? Sometimes I need to know AxisX coordinate while moving.
    2) I need to change cursor on left border and right border (mouse hover) of marked zone (from Arrow to SizeWE).
    I added additional CustomGridLines but Cursor=SizeWE isn`t working on it.
    My code:

    <telerik:MarkedZone StartX="{Binding Path=StartX}" EndX="{Binding Path=EndX}" 
    Background="#200094CD" />

    <telerik:CustomGridLine XIntercept="{Binding Path=StartX}"
    Visibility="Visible"
    Stroke="#AA0094CD"
    StrokeThickness="1" Cursor="SizeWE"
    />
    <telerik:CustomGridLine XIntercept="{Binding Path=EndX}"
    Visibility="Visible"
    Stroke="#AA0094CD"
    StrokeThickness="1" Cursor="SizeWE"
    />

    Any help would be appreciated.
  2. A K
    A K avatar
    20 posts
    Member since:
    Nov 2009

    Posted 22 Apr 2011 Link to this post

    Problem was solved with
    List<UIElement> list = VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(null), LayoutRoot as UIElement) as List<UIElement>;

    on MouseMove event 
    and
    UIElement el = list.FirstOrDefault(x => (x is Control) && (((Control)x).Name == "sliderLeftBorder" || ((Control)x).Name == "sliderRightBorder"));
    if (el != null)
    {
    (e.OriginalSource as FrameworkElement).Cursor = System.Windows.Input.Cursors.SizeWE;
    }
    else
    {
    (e.OriginalSource as FrameworkElement).Cursor = System.Windows.Input.Cursors.Arrow;
    }
Back to Top