private LoadPropertiesAsync ( ) : System.Threading.Tasks.Task | ||
Результат | System.Threading.Tasks.Task |
protected override void OnSelectedItemChanged( TreeItemViewModel oldSelectedItem, TreeItemViewModel newSelectedItem) { var oldItemAsDependencyObjectViewModel = oldSelectedItem as DependencyObjectViewModel; if (oldItemAsDependencyObjectViewModel != null) { oldItemAsDependencyObjectViewModel.ModelPropertyChanged -= this.OnModelPropertyChanged; } var newItemAsDependencyObjectViewModel = newSelectedItem as DependencyObjectViewModel; if (newItemAsDependencyObjectViewModel != null) { newItemAsDependencyObjectViewModel.ModelPropertyChanged += this.OnModelPropertyChanged; #pragma warning disable 4014 newSelectedItem.LoadPropertiesAsync(); #pragma warning restore 4014 } this.UpdateHighlight(); }
protected override void OnSelectedItemChanged( TreeItemViewModel oldSelectedItem, TreeItemViewModel newSelectedItem) { var oldItemAsDependencyObjectViewModel = oldSelectedItem as DependencyObjectViewModel; if (oldItemAsDependencyObjectViewModel != null) { oldItemAsDependencyObjectViewModel.ModelPropertyChanged -= this.OnModelPropertyChanged; } var newItemAsDependencyObjectViewModel = newSelectedItem as DependencyObjectViewModel; if (newItemAsDependencyObjectViewModel != null) { newItemAsDependencyObjectViewModel.ModelPropertyChanged += this.OnModelPropertyChanged; #pragma warning disable 4014 newSelectedItem.LoadPropertiesAsync(); #pragma warning restore 4014 } this.UpdateHighlight(); }