diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-04-11 11:24:39 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-04-11 11:24:39 +0300 |
| commit | 64aeeb1d2784569e4ebf7c72c660458cf4432eee (patch) | |
| tree | f140fd02302857c6396f50e63ce7891c8862ece8 /Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml | |
| parent | 33de6bbb3668c5d1edf9c28ee337058a29331443 (diff) | |
| download | Tango-64aeeb1d2784569e4ebf7c72c660458cf4432eee.tar.gz Tango-64aeeb1d2784569e4ebf7c72c660458cf4432eee.zip | |
Add menu to tree solution
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml | 71 |
1 files changed, 45 insertions, 26 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml index 67a673d3b..6f3914ec8 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml @@ -15,7 +15,17 @@ <ResourceDictionary Source="Themes/Shared.xaml"/> </ResourceDictionary.MergedDictionaries> <BooleanToVisibilityConverter x:Key="BoolToVis" /> - </ResourceDictionary> + <Style x:Key="ContentMmenuItemStyle" TargetType="MenuItem"> + <Setter Property="Command" Value="{Binding}"/> + <Setter Property="Header" Value="{Binding Name}"/> + <Setter Property="ItemsSource" Value="{Binding Commands}"/> + <Setter Property="Icon"> + <Setter.Value> + <Image Source="{Binding Image}" Height="12" Width="12"/> + </Setter.Value> + </Setter> + </Style> + </ResourceDictionary> </UserControl.Resources> <Grid Background="{DynamicResource Background.Static}"> <Grid.RowDefinitions> @@ -231,31 +241,40 @@ <RowDefinition Height="4"/> </Grid.RowDefinitions> <GroupBox Grid.Row="0" Margin="0,0,5,0" Header="Solution Explorer" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" > - <TreeView Style="{DynamicResource TangoTreeViewStyle}" x:Name="SolutionTree" ItemsSource="{Binding Solution.Projects}" Background="{DynamicResource TabItem.Content.Static}" Padding="0,8,0,0" SelectedItemChanged="TreeViewControl_SelectedItemChanged" PreviewMouseRightButtonDown="SolutionTree_PreviewMouseRightButtonDown" > - <TreeView.ItemTemplate> - <HierarchicalDataTemplate ItemsSource="{Binding Path=Items}" DataType="{x:Type local:IProject}"> - <controls:SolutionItemControl SolutionItem="{Binding}" OpenCommand="{Binding ElementName=control,Path=DataContext.OpenProjectItemCommand}" /> - </HierarchicalDataTemplate> - </TreeView.ItemTemplate> - <TreeView.Resources> - <ContextMenu x:Key ="SolutionContext" StaysOpen="true" BorderBrush="{DynamicResource Background.Static}" Foreground="{DynamicResource ControlForegroundKey}"> - <MenuItem Header="Add" > - <MenuItem Header="New Project..." Command="{Binding AddProjectCommand}"/> - </MenuItem> - <MenuItem Header="Rename"/> - </ContextMenu> - <ContextMenu x:Key="FolderContext" StaysOpen="true" > - <MenuItem Header="Rename"/> - <MenuItem Header="Remove"/> - <Separator/> - <MenuItem Header="Copy"/> - <MenuItem Header="Cut"/> - <MenuItem Header="Paste"/> - <MenuItem Header="Move"/> - </ContextMenu> - </TreeView.Resources> - - </TreeView> + <StackPanel Orientation="Vertical" VerticalAlignment="Stretch" Background="{DynamicResource TabItem.Content.Static}"> + <TreeView Style="{DynamicResource TangoTreeViewStyle}" x:Name="STree" DataContext="{Binding Solution}" Background="{DynamicResource TabItem.Content.Static}" Padding="0,0,2,0" PreviewMouseRightButtonDown="SolutionTree_PreviewMouseRightButtonDown" BorderThickness="1,0,1,1" + PreviewMouseLeftButtonDown="SolutionTree_PreviewMouseLeftButtonDown"> + <TreeViewItem > + <TreeViewItem.Header> + <StackPanel Orientation="Horizontal" Margin="-12,0,0,0"> + <Image Source="/Tango.Scripting.IDE;component/Images/jigsaw.png" Height="14" /> + <TextBlock Text="{Binding Name}" Margin="5,0,0,0" Foreground="{DynamicResource ControlForegroundKey}"/> + </StackPanel> + </TreeViewItem.Header> + </TreeViewItem> + <TreeView.ContextMenu> + <ContextMenu StaysOpen="true" BorderBrush="{DynamicResource Background.Static}" Foreground="{DynamicResource ControlForegroundKey}" + ItemsSource="{Binding PlacementTarget.DataContext.Commands, RelativeSource={RelativeSource Self}}" + ItemContainerStyle="{StaticResource ContentMmenuItemStyle}"> + </ContextMenu> + </TreeView.ContextMenu> + </TreeView> + <TreeView Style="{DynamicResource TangoTreeViewStyle}" Margin="0,-1,0,0" x:Name="SolutionTree" ItemsSource="{Binding Solution.Projects}" Background="{DynamicResource TabItem.Content.Static}" Padding="0,0,2,0" PreviewMouseRightButtonDown="SolutionTree_PreviewMouseRightButtonDown" BorderThickness="1,0,1,1" PreviewMouseLeftButtonDown="SolutionTree_PreviewMouseLeftButtonDown"> + <TreeView.ItemTemplate> + <HierarchicalDataTemplate ItemsSource="{Binding Path=Items}" DataType="{x:Type local:IProject}"> + <controls:SolutionItemControl SolutionItem="{Binding}" OpenCommand="{Binding ElementName=control,Path=DataContext.OpenProjectItemCommand}" + /> + </HierarchicalDataTemplate> + </TreeView.ItemTemplate> + <TreeView.ContextMenu> + <ContextMenu StaysOpen="true" BorderBrush="{DynamicResource Background.Static}" Foreground="{DynamicResource ControlForegroundKey}" + DataContext="{Binding PlacementTarget, RelativeSource={RelativeSource Self}}" + ItemsSource="{Binding PlacementTarget.SelectedItem.Commands, RelativeSource={RelativeSource Self}}" + ItemContainerStyle="{StaticResource ContentMmenuItemStyle}"> + </ContextMenu> + </TreeView.ContextMenu> + </TreeView> + </StackPanel> </GroupBox> <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource Background.Static}" /> <GroupBox Grid.Row="2" Margin="0,0,5,2" Header="Properties" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" > |
