Skip to content

Commit 009ffaf

Browse files
committed
use checkkbox to indicate selection in Revit
1 parent 814f7ca commit 009ffaf

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎sources/RevitDBExplorer/UIComponents/Trees/Base/BaseTreeView.xaml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
</ContextMenu>
100100
</StackPanel.ContextMenu>
101101

102+
<CheckBox IsChecked="{Binding IsSelectedInRevit}" IsEnabled="False" Visibility="{Binding CanBeSelectedInRevit, Converter={StaticResource BoolToVisibilityConverter}}" ToolTip="Is element selected in revit" />
102103
<Path Style="{Binding Object.NamePrefixIcon, Converter={StaticResource ToResourceWithKeyConverter}, ConverterParameter=Icon}" Margin="0 1 4 0" Fill="{Binding ElementName=cTextBlock, Path=Foreground}" />
103104
<TextBlock x:Name="cTextBlock" IsHitTestVisible="False">
104105
<Run Text="{Binding Prefix, Mode=OneWay}">
@@ -163,9 +164,6 @@
163164
<Setter Property="Foreground" Value="{DynamicResource TreeViewItem.InactiveSelectionHighlightTextBrushKey}"/>
164165
<Setter Property="Border.Background" Value="red"/>
165166
</MultiTrigger>
166-
<DataTrigger Binding="{Binding IsSelectedInRevit}" Value="True">
167-
<Setter Property="BorderBrush" Value="{DynamicResource TextBox.Focus.Border}" />
168-
</DataTrigger>
169167
</Style.Triggers>
170168
</Style>
171169
</TreeView.ItemContainerStyle>

‎sources/RevitDBExplorer/UIComponents/Trees/Base/Items/SnoopableObjectTreeItem.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public string Prefix
2424
return "";
2525
}
2626
}
27+
public override bool CanBeSelectedInRevit => Object.HasParameters;
2728

2829

2930
public SnoopableObjectTreeItem(SnoopableObject @object, TreeItemsCommands commands) : base(commands)

‎sources/RevitDBExplorer/UIComponents/Trees/Base/Items/TreeItem.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public bool IsSelectedInRevit
7979
OnPropertyChanged();
8080
}
8181
}
82+
public virtual bool CanBeSelectedInRevit => false;
8283
public TreeItemsCommands Commands { get; }
8384
public ObservableCollection<TreeItem> Items
8485
{

0 commit comments

Comments
 (0)