diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-11 19:40:25 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-11 19:40:25 +0300 |
| commit | e3cd087cbe1b6c62df2beac4f6351bc20013726c (patch) | |
| tree | 0be80f9892fe1f10f6b50cd38d5e6a5811d20a7e /Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml | |
| parent | 2aa2afca5b09d465e8bf683af232cfe366abf7d4 (diff) | |
| parent | 3c6ab0ddb3f0ae70f4a30b7899b256a703d9a50b (diff) | |
| download | Tango-e3cd087cbe1b6c62df2beac4f6351bc20013726c.tar.gz Tango-e3cd087cbe1b6c62df2beac4f6351bc20013726c.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml | 70 |
1 files changed, 44 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..e79734b3a 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml @@ -6,6 +6,7 @@ xmlns:local="clr-namespace:Tango.Scripting.IDE" xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:controls="clr-namespace:Tango.Scripting.IDE.Controls" + xmlns:converters="clr-namespace:Tango.Scripting.IDE.Converters" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:ScriptIDEViewVM, IsDesignTimeCreatable=False}" x:Name="control"> <UserControl.Resources> @@ -15,7 +16,15 @@ <ResourceDictionary Source="Themes/Shared.xaml"/> </ResourceDictionary.MergedDictionaries> <BooleanToVisibilityConverter x:Key="BoolToVis" /> - </ResourceDictionary> + <converters:BitmapSourceToImageConverter x:Key="BitmapSourceToImageConverter" /> + + <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" Value="{Binding Image,Converter={StaticResource BitmapSourceToImageConverter}}"></Setter> + </Style> + </ResourceDictionary> </UserControl.Resources> <Grid Background="{DynamicResource Background.Static}"> <Grid.RowDefinitions> @@ -231,31 +240,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}" > |
