Exemplo n.º 1
0
 protected override void OnBindingPathChanged(DependencyPropertyChangedEventArgs args)
 {
     HighValues.Clear();
     LowValues.Clear();
     Segment = null;
     base.OnBindingPathChanged(args);
 }
Exemplo n.º 2
0
        public void Handle(string message)
        {
            Execute.OnUIThreadSync(async() =>
            {
                WeatherItemViewModels?.Clear();
                LowValues?.Clear();
                HighValues?.Clear();
                GC.Collect();

                WeaResModel = await WeatherUtil.GetWeathers(message);

                if (WeaResModel?.Data?.Forecast != null)
                {
                    ChartVisibility = Visibility.Visible;
                    foreach (var item in WeaResModel.Data.Forecast)
                    {
                        var ivm         = _container.Get <WeatherItemViewModel>();
                        ivm.WeatherInfo = item;
                        await Task.Delay(200);
                        WeatherItemViewModels.Add(ivm);
                        LowValues.Add(item.LowNum);
                        HighValues.Add(item.HighNum);
                    }
                }
                else
                {
                    ChartVisibility = Visibility.Hidden;
                }
            });
        }
Exemplo n.º 3
0
 /// <summary>
 /// Called when DataSource property changed
 /// </summary>
 /// <param name="oldValue"></param>
 /// <param name="newValue"></param>
 protected override void OnDataSourceChanged(IEnumerable oldValue, IEnumerable newValue)
 {
     base.OnDataSourceChanged(oldValue, newValue);
     HighValues.Clear();
     LowValues.Clear();
     Segment = null;
     GeneratePoints(new string[] { High, Low }, HighValues, LowValues);
     isPointValidated = false;
     this.UpdateArea();
 }