|
10 | 10 | using System.Windows.Threading; |
11 | 11 | using RevitDBExplorer.Augmentations; |
12 | 12 | using RevitDBExplorer.Domain; |
| 13 | +using RevitDBExplorer.Domain.DataModel.ValueViewModels; |
13 | 14 | using RevitDBExplorer.Domain.RevitDatabaseQuery; |
14 | 15 | using RevitDBExplorer.Domain.RevitDatabaseScripting; |
15 | 16 | using RevitDBExplorer.Domain.Selectors; |
16 | 17 | using RevitDBExplorer.Properties; |
17 | 18 | using RevitDBExplorer.UIComponents.Breadcrumbs; |
18 | 19 | using RevitDBExplorer.UIComponents.List; |
| 20 | +using RevitDBExplorer.UIComponents.List.ViewModels; |
19 | 21 | using RevitDBExplorer.UIComponents.QueryEditor; |
20 | 22 | using RevitDBExplorer.UIComponents.QueryVisualization; |
21 | 23 | using RevitDBExplorer.UIComponents.Trees.Base; |
@@ -47,7 +49,7 @@ internal partial class MainWindow : Window, IAmWindowOpener, INotifyPropertyChan |
47 | 49 | private string newVersionLink; |
48 | 50 | private bool isWiderThan800px; |
49 | 51 | private string mouseStatus; |
50 | | - private string rdqGeneratedCSharpSyntax; |
| 52 | + private string rdqGeneratedCSharpSyntax = ""; |
51 | 53 |
|
52 | 54 |
|
53 | 55 | public QueryEditorViewModel QueryEditor => queryEditorVM; |
@@ -172,9 +174,13 @@ public MainWindow() |
172 | 174 | ExplorerTree.ScriptWasGenerated += OpenRDSWithGivenScript; |
173 | 175 | UtilityTree.SelectedItemChanged += Tree_SelectedItemChanged; |
174 | 176 | UtilityTree.ScriptWasGenerated += OpenRDSWithGivenScript; |
| 177 | + List.SelectedItemChanged += List_SelectedItemChanged; |
175 | 178 |
|
176 | 179 | rdvController = RevitDatabaseVisualizationFactory.CreateController(); |
177 | 180 | } |
| 181 | + |
| 182 | + |
| 183 | + |
178 | 184 | private async Task InitializeAsync() |
179 | 185 | { |
180 | 186 | (IsNewVerAvailable, NewVersionLink) = await VersionChecker.CheckIfNewVersionIsAvailable(); |
@@ -280,6 +286,21 @@ private async void Tree_SelectedItemChanged(SelectedItemChangedEventArgs eventAr |
280 | 286 | } |
281 | 287 | RightView = RightView.None; |
282 | 288 | } |
| 289 | + private void List_SelectedItemChanged(ListSelectedItemChangedEventArgs args) |
| 290 | + { |
| 291 | + if (args.NewOne is ListItemForMember listItemForMember) |
| 292 | + { |
| 293 | + var leftOne = listItemForMember[0]; |
| 294 | + var righttOne = listItemForMember[1]; |
| 295 | + |
| 296 | + if (leftOne?.ValueViewModel is DefaultPresenter { ValueContainer: { } } presenter) |
| 297 | + { |
| 298 | + var v = presenter.ValueContainer.GetVisualization(); |
| 299 | + |
| 300 | + //return Enumerable.Empty<DrawingVisual>(); |
| 301 | + } |
| 302 | + } |
| 303 | + } |
283 | 304 | bool ignoreEvents = false; |
284 | 305 | void IAmWindowOpener.Open(SourceOfObjects sourceOfObjects) |
285 | 306 | { |
@@ -364,7 +385,8 @@ private void Window_Closed(object sender, EventArgs e) |
364 | 385 | ExplorerTree.SelectedItemChanged -= Tree_SelectedItemChanged; |
365 | 386 | ExplorerTree.ScriptWasGenerated -= OpenRDSWithGivenScript; |
366 | 387 | UtilityTree.SelectedItemChanged -= Tree_SelectedItemChanged; |
367 | | - UtilityTree.ScriptWasGenerated -= OpenRDSWithGivenScript; |
| 388 | + UtilityTree.ScriptWasGenerated -= OpenRDSWithGivenScript; |
| 389 | + List.SelectedItemChanged -= List_SelectedItemChanged; |
368 | 390 | } |
369 | 391 | private void Window_Closing(object sender, EventArgs e) |
370 | 392 | { |
|
0 commit comments