Exemple #1
0
 private void OnMarkerViewportBoundsChanged(object sender, EventArgs e)
 {
     RecalculateViewportBounds();
     FrameworkElement element           = (FrameworkElement)sender;
     DataRect         elementBounds     = ViewportRectPanel.GetActualViewportBounds(element);
     DataRect         prevElementBounds = ViewportRectPanel.GetPrevActualViewportBounds(element);
 }
Exemple #2
0
        protected void OnMarkerBind(BindMarkerEventArgs e)
        {
            var marker = e.Marker;

            //marker.SetBinding(ViewportRectPanel.ViewportVerticalAlignmentProperty, new Binding { Path = new PropertyPath("Value"), Converter = converter });

            xValues.Add(ViewportRectPanel.GetViewportX(marker));
        }
Exemple #3
0
        private void RecalculateViewportBounds()
        {
            DataRect bounds = DataRect.Empty;

            foreach (UIElement item in itemsPanel.Children)
            {
                DataRect elementBounds = ViewportRectPanel.GetActualViewportBounds(item);
                bounds.Union(elementBounds);
            }

            Viewport2D.SetContentBounds(this, bounds);
        }
Exemple #4
0
        protected void RebuildMarkers(bool shouldReleaseMarkers)
        {
            xValues.Clear();

            base.RebuildMarkers(shouldReleaseMarkers);

            double width = 0;

            for (int i = 0; i < xValues.Count - 1; i++)
            {
                double currX = xValues[i];
                double nextX = xValues[i + 1];
                width = (nextX - currX);

                ViewportRectPanel.SetViewportWidth(ItemsPanel.Children[i], width);
            }

            if (ItemsPanel.Children.Count > 0)
            {
                ViewportRectPanel.SetViewportWidth(ItemsPanel.Children[ItemsPanel.Children.Count - 1], width);
            }
        }