Skip to content

Commit

Permalink
[DYN-4361] Revert changed to WatchTree (#15720)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaylo-matov authored Dec 12, 2024
1 parent 956959f commit 7bcdb04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 27 deletions.
18 changes: 7 additions & 11 deletions src/DynamoCoreWpf/Views/Preview/WatchTree.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,23 +352,19 @@
</TextBlock.Style>
</TextBlock>

<TextBox Width="Auto"
Margin="{Binding Path=IsTopLevel, Converter={StaticResource TopLevelLabelMarginConverter}}"
VerticalAlignment="Center"
FontFamily="{StaticResource SourceCodePro}"
Text="{Binding Path=NodeLabel}"
Visibility="{Binding Path=NodeLabel, Converter={StaticResource EmptyStringToCollapsedConverter}}"
IsReadOnly="True"
Background="Transparent"
BorderThickness="0"
TextWrapping="Wrap">
<TextBlock Width="Auto"
Margin="{Binding Path=IsTopLevel, Converter={StaticResource TopLevelLabelMarginConverter}}"
VerticalAlignment="Center"
FontFamily="{StaticResource SourceCodePro}"
Text="{Binding Path=NodeLabel}"
Visibility="{Binding Path=NodeLabel, Converter={StaticResource EmptyStringToCollapsedConverter}}" >
<TextBlock.Foreground>
<MultiBinding Converter="{StaticResource ObjectTypeConverter}">
<Binding Path="ValueType" />
<Binding Path="NodeLabel" />
</MultiBinding>
</TextBlock.Foreground>
</TextBox>
</TextBlock>

<Button Margin="10,2,2,2"
Padding="4,0,4,0"
Expand Down
21 changes: 5 additions & 16 deletions test/DynamoCoreWpfTests/NodeViewCustomizationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,8 @@ public void WatchContainsExpectedUiElements()
var tree = nodeView.ChildrenOfType<WatchTree>();
Assert.AreEqual(1, tree.Count());

// text block for list indexes
var textBlocks = tree.First().treeView1.ChildrenOfType<TextBlock>();
Assert.AreEqual(4, textBlocks.Count());
// text boxes for list items
var textBoxes = tree.First().treeView1.ChildrenOfType<TextBox>();
Assert.AreEqual(4, textBoxes.Count());
var items = tree.First().treeView1.ChildrenOfType<TextBlock>();
Assert.AreEqual(8, items.Count());
}

[Test, Category("DisplayHardwareDependent")]
Expand Down Expand Up @@ -441,12 +437,7 @@ public void WatchConnectDisconnectTest()

var items = tree.First().treeView1.ChildrenOfType<TextBlock>();
// watch is computed with cbn and has its value
// text block for list indexes
var textBlocks = tree.First().treeView1.ChildrenOfType<TextBlock>();
Assert.AreEqual(4, textBlocks.Count());
// text boxes for list items
var textBoxes = tree.First().treeView1.ChildrenOfType<TextBox>();
Assert.AreEqual(4, textBoxes.Count());
Assert.AreEqual(8, items.Count());

// disconnect watch
Model.ExecuteCommand(new DynamoModel.MakeConnectionCommand(watchGuid, 0, PortType.Input,
Expand All @@ -473,10 +464,8 @@ public void WatchConnectDisconnectTest()
Run();
DispatcherUtil.DoEvents();
tree = nodeView.ChildrenOfType<WatchTree>();
textBlocks = tree.First().treeView1.ChildrenOfType<TextBlock>();
Assert.AreEqual(4, textBlocks.Count());
textBoxes = tree.First().treeView1.ChildrenOfType<TextBox>();
Assert.AreEqual(4, textBoxes.Count());
items = tree.First().treeView1.ChildrenOfType<TextBlock>();
Assert.AreEqual(8, items.Count());
}

[Test]
Expand Down

0 comments on commit 7bcdb04

Please sign in to comment.