protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (e.Property == TermoGraphView.DataContextProperty) { if (_data != null) _data.Layers.CollectionChanged -= Layers_CollectionChanged; _data = e.NewValue as TermoGraphViewModel; if (_data != null) _data.Layers.CollectionChanged += Layers_CollectionChanged; DrawGraph(); } if (e.Property == TermoGraphView.VisibilityProperty | e.Property == TermoGraphView.ActualWidthProperty | e.Property == TermoGraphView.ActualHeightProperty) DrawGraph(); }
public MainViewModel() { _RequestDate = DateTime.Today; _DataBaseManager = new DBManager(); _comService = new CommunicationService(); SelectedHistoryItems = new ArrayList(); History = new ObservableCollection<SensorDBHistoryViewModel>(); Graph = new GraphViewModel(); TermoGraph = new TermoGraphViewModel(); FillHourSource(); InitializeCommands(); //FillTestDB(); }