Esempio n. 1
0
        public async void SelectMetricDimension(SelectionChangedEventArgs args)
        {
            if (args.AddedItems.Count == 1)
            {
                var md = args.AddedItems[0] as Metric.MetricDimension;
                DimensionValues.Clear();
                if (md.Value != null)
                {
                    var res     = SelectedResource.Value;
                    var m       = SelectedMetric.Value;
                    var dimVals = await _client.DimensionValues(res, m, md.Value, Start.Value, End.Value);

                    if (dimVals.Count() > 0)
                    {
                        foreach (var dv in dimVals)
                        {
                            DimensionValues.Add(dv);
                        }
                        SelectedDimensionValue.Value         = dimVals.First();
                        DimensionValuesSelectorEnabled.Value = dimVals.Count() > 1;
                    }
                    else
                    {
                        DimensionValuesSelectorEnabled.Value = false;
                    }
                }
                else
                {
                    DimensionValuesSelectorEnabled.Value = false;
                }
            }
        }