Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph node manager updates #14307

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,47 @@
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
</Style>

<!-- DataGridColumnHeadersPresenter style -->
<Style TargetType="{x:Type DataGridColumnHeadersPresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeadersPresenter}">
<Grid>
<ItemsPresenter />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- DataGridColumnHeader style -->
<Style x:Key="ColumnHeaderStyle1" TargetType="DataGridColumnHeader">
<Style x:Key="ColumnHeaderStyle1" TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Height" Value="24"/>
<Setter Property="Background" Value="{StaticResource ExtensionBackgroundColor}"/>
<Setter Property="Foreground" Value="#bbbbbb"/>
<Setter Property="BorderThickness" Value="0 0 0 1"></Setter>
<Setter Property="BorderBrush" Value="{StaticResource BorderColorBrush}"></Setter>
<Setter Property="FontSize" Value="10" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="6 0"/>
<Setter Property="UseLayoutRounding" Value="True"></Setter>
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>

<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Rectangle HorizontalAlignment="Left" Height="11" Width="1" Margin="-1,1,6,3" Stroke="#BBBBBB"/>
<TextBlock Text="{Binding}" Margin="0, 2, 2, 2"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- DataGridColumnHeader style for the first column header on the left -->
<Style x:Key="FirstColumnHeaderStyle1" TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource ColumnHeaderStyle1}">
<Setter Property="Margin" Value="5 0 0 0 "/>
</Style>

<!-- DataGridRow style -->
Expand All @@ -60,7 +89,7 @@
<Setter Property="Background" Value="#434343"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4a4a4a" />
<Setter Property="Background" Value="{StaticResource MainBackgroundColor}"/>
</Trigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -104,8 +133,8 @@

<!-- Image Style -->
<Style x:Key="ImageStyle" TargetType="Image">
<Setter Property="Width" Value="12"></Setter>
<Setter Property="Height" Value="12"></Setter>
<Setter Property="Width" Value="16"></Setter>
<Setter Property="Height" Value="16"></Setter>
<Setter Property="SnapsToDevicePixels" Value="True"></Setter>
<Setter Property="UseLayoutRounding" Value="True"></Setter>
<Setter Property="Margin" Value="3 0"></Setter>
Expand All @@ -118,7 +147,7 @@
<Setter Property="Foreground" Value="{StaticResource DarkThemeBodyMediumBrush}"></Setter>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"></Setter>
<Setter Property="FontSize" Value="10"></Setter>
<Setter Property="FontSize" Value="11"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding FilterImage}"
Width="10"
Height="10"
Width="12"
Height="12"
SnapsToDevicePixels="True"
UseLayoutRounding="True"
VerticalAlignment="Stretch"
Expand Down Expand Up @@ -76,7 +76,7 @@
<TextBlock Text="{Binding Name}"
Padding="4 2 4 0"
TextAlignment="Center"
FontSize="10"
FontSize="11"
FontWeight="Medium"
Foreground="{StaticResource DarkThemeBodyMediumBrush}"
HorizontalAlignment="Center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
VerticalAlignment="Center"/>
<Image Source="{Binding InfoIcon}"
Margin="0 1 1 1"
Width="10"
Height="10"
Width="12"
Height="12"
HorizontalAlignment="Right"
SnapsToDevicePixels="True"
UseLayoutRounding="True"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
var infoType = parameter as string;
if (infoType == null) return Visibility.Collapsed;

if ((ElementState)value == ElementState.Info && parameter.Equals(nameof(ElementState.Info)) || (ElementState)value == ElementState.PersistentInfo && parameter.Equals(nameof(ElementState.PersistentInfo)))
if ((ElementState)value == ElementState.Info && parameter.Equals(nameof(ElementState.Info)) || (ElementState)value == ElementState.PersistentInfo && parameter.Equals(nameof(ElementState.Info)))
dariaivanciucova marked this conversation as resolved.
Show resolved Hide resolved
{
return Visibility.Visible;
}
Expand Down
137 changes: 74 additions & 63 deletions src/GraphNodeManagerViewExtension/GraphNodeManagerView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="30" ></RowDefinition>
</Grid.RowDefinitions>

<!-- Search Bar -->
Expand All @@ -63,43 +64,6 @@
</ItemsControl>
</Grid>

<!-- Export Button -->
<Image x:Name="ExportImage"
DockPanel.Dock="Right"
Width="16px"
Height="16px"
Margin="0 0 15 15"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Source="/GraphNodeManagerViewExtension;component/Images/Export.png"
Stretch="UniformToFill"
MouseUp="ExportImage_OnMouseUp"
Cursor="Hand">
<Image.ContextMenu>
<ContextMenu Name="MainContextMenu"
Margin="0 -10"
Style="{StaticResource ContextMenuStyle}"
Background="#666666"
Width="170">
<MenuItem x:Name="CSVItem" Header="{x:Static p:Resources.MenuItemExportAsCSV}" Padding="10" FontSize="12"
Command="{Binding ExportCommand}" CommandParameter="CSV"/>
<MenuItem x:Name="JSONItem" Header="{x:Static p:Resources.MenuItemExportAsJSON}" Padding="10" FontSize="12"
Command="{Binding ExportCommand}" CommandParameter="JSON"/>
</ContextMenu>
</Image.ContextMenu>
<Image.ToolTip>
<controls1:DynamoToolTip AttachmentSide="Bottom" Style="{DynamicResource ResourceKey=SLightToolTip}">
<Grid>
<TextBlock MaxWidth="320"
Padding="5"
Foreground="Black" FontSize="12"
Text="{Binding IsAnyFilterOn, Converter={StaticResource BooleanToToolTipTextConverter}, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
</Grid>
</controls1:DynamoToolTip>
</Image.ToolTip>
</Image>

<!-- Clear Filter Button -->
<Button x:Name="ClearFiltersButton"
DockPanel.Dock="Right"
Expand All @@ -124,8 +88,7 @@
Background="{StaticResource ExtensionBackgroundColor}"
BorderThickness="0"
AlternationCount="2"
FontSize="10"
FontFamily="{StaticResource ArtifaktElementBold}"
FontFamily="{StaticResource ArtifaktElementRegular}"
Foreground="{StaticResource DarkThemeBodyMediumBrush}"
SelectionUnit="FullRow"
SelectionMode="Single"
Expand All @@ -136,7 +99,7 @@
CanUserSortColumns="True"
HeadersVisibility="Column"
MinColumnWidth="60"
Margin="-3 0"
Margin="0"
RowDetailsVisibilityMode="Collapsed"
IsReadOnly="True"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" >
Expand All @@ -145,28 +108,13 @@
<EventSetter Event="PreviewMouseLeftButtonUp" Handler="Row_PreviewClickHandler"/>
</Style>
</DataGrid.Resources>
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock
Text="{Binding Name}"
Foreground="#BBBBBB"
Margin="10 3 3 3"
FontSize="12"
/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</DataGrid.GroupStyle>

<DataGrid.Columns>

<!-- Name -->
<DataGridTemplateColumn
Header="{x:Static p:Resources.HeaderNameName}"
HeaderStyle="{StaticResource FirstColumnHeaderStyle1}"
IsReadOnly="True"
Width="6*">

Expand All @@ -176,7 +124,8 @@
<!-- Node Name -->
<TextBlock
Text="{Binding Name}"
FontWeight="Light"
FontSize="11"
FontFamily="{StaticResource ArtifaktElementBold}"
Foreground="{StaticResource DarkThemeBodyMediumBrush}"
Margin="3 0 0 0"
DockPanel.Dock="Left"></TextBlock>
Expand Down Expand Up @@ -208,14 +157,17 @@
<Image Source="/GraphNodeManagerViewExtension;component/Images/Function.png"
ToolTip="{x:Static p:Resources.Title_Function}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding StateIsFunction, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
<Image Source="/GraphNodeManagerViewExtension;component/Images/IsInput.png"
ToolTip="{x:Static p:Resources.Title_IsInput}"
Style="{StaticResource ImageStyle}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding StateIsInput, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
<Image Source="/GraphNodeManagerViewExtension;component/Images/IsOutput.png"
ToolTip="{x:Static p:Resources.Title_IsOutput}"
Style="{StaticResource ImageStyle}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding StateIsOutput, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
</StackPanel>
</DataTemplate>
Expand All @@ -233,10 +185,12 @@
<Image Source="/GraphNodeManagerViewExtension;component/Images/Frozen.png"
ToolTip="{x:Static p:Resources.Title_Frozen}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding StatusIsFrozen, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
<Image Source="/GraphNodeManagerViewExtension;component/Images/Hidden.png"
ToolTip="{x:Static p:Resources.Title_PreviewOff}"
Style="{StaticResource ImageStyle}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding StatusIsHidden, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
<controls:InfoBubbleControl
Margin="3 0"
Expand Down Expand Up @@ -269,11 +223,12 @@
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="-1 0 0 0"
FontSize="8"/>
FontSize="9"/>
</Border>
<Image Source="/GraphNodeManagerViewExtension;component/Images/MissingNode.png"
ToolTip="{x:Static p:Resources.Title_MissingContent}"
Style="{StaticResource ImageStyle}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding IsDummyNode, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
</StackPanel>
</DataTemplate>
Expand All @@ -288,13 +243,31 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Grid>
<Image Source="/GraphNodeManagerViewExtension;component/Images/Union.png"
ToolTip="{x:Static p:Resources.Title_IsOutputSingleItem}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding IsOutputSingleItem, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
<TextBlock
ToolTip="{x:Static p:Resources.Title_TopLevelItemsNumber}"
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
Text="{Binding TopLevelItemsNumber}"
FontSize="9"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="-1 0 0 0"
Foreground="{StaticResource InfoBubbleEdgeNormalBrush}"
Visibility="{Binding IsOutputSingleItem, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
</TextBlock>
</Grid>
<Image Source="/GraphNodeManagerViewExtension;component/Images/EmptyList.png"
ToolTip="{x:Static p:Resources.Title_EmptyList}"
Style="{StaticResource ImageStyle}"
Visibility="{Binding IsEmptyList, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
<Image Source="/GraphNodeManagerViewExtension;component/Images/Null.png"
ToolTip="{x:Static p:Resources.Title_Null}"
Style="{StaticResource ImageStyle}"
Style="{StaticResource ImageStyle}"
Width="16"
Visibility="{Binding IsNull, Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
</StackPanel>
</DataTemplate>
Expand Down Expand Up @@ -391,5 +364,43 @@
</DataGrid.RowDetailsTemplate>

</DataGrid>

<!--Export Button-->
<DockPanel Grid.Row="3">
<Grid DockPanel.Dock="Top">
<Button x:Name="ExportButton"
Content="Export"
Width="34"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0 9 7 0"
FontWeight="Regular"
Style="{StaticResource ButtonStyle1}"
Click="ExportButton_OnClick"
Cursor="Hand">
<Button.ContextMenu>
<ContextMenu Name="MainContextMenu"
Margin="0 -10"
Style="{StaticResource ContextMenuStyle}"
Background="{StaticResource MidGrayBrush}"
Width="170">
<MenuItem Name="CSVItem"
Header="{x:Static p:Resources.MenuItemExportAsCSV}"
Padding="10"
FontSize="12"
Command="{Binding ExportCommand}"
CommandParameter="CSV"/>
<MenuItem Name="JSONItem"
Header="{x:Static p:Resources.MenuItemExportAsJSON}"
Padding="10"
FontSize="12"
Command="{Binding ExportCommand}"
CommandParameter="JSON"/>

</ContextMenu>
</Button.ContextMenu>
</Button>
</Grid>
</DockPanel>
</Grid>
</UserControl>
Loading