using C1.Xaml.Chart;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;

namespace DrillDown
{
    public sealed partial class TreemapSample : Page
    {
        private DrillDownViewModel _vm;
        public TreemapSample()
        {
            this.InitializeComponent();
            _vm = new DrillDownViewModel();
            this.DataContext = _vm;
        }


        private void HandleDrillDown(object sender, TappedRoutedEventArgs e)
        {
            var flexChart = sender as FlexChartBase;
            var hitInfo = flexChart.HitTest(e.GetPosition(flexChart));
            if (hitInfo != null && hitInfo.Distance < 2)
            {
                _vm.TreemapDataLayer.DrillDown(hitInfo.Item);
            }
        }
    }


}
