1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
<UserControl x:Class="Tango.Scripting.IDE.ScriptIDEView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:controls="clr-namespace:Tango.Scripting.IDE.Controls"
xmlns:local="clr-namespace:Tango.Scripting.IDE"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:ScriptIDEViewVM, IsDesignTimeCreatable=False}" x:Name="control">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<!-- Accent and AppTheme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Styles.xaml" />
<ResourceDictionary Source="Resources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Background="{StaticResource IdeLightBackgroundBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="41*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid>
<Menu>
<MenuItem Header="File"></MenuItem>
<MenuItem Header="Edit"></MenuItem>
<MenuItem Header="View"></MenuItem>
<MenuItem Header="Project"></MenuItem>
<MenuItem Header="Build"></MenuItem>
<MenuItem Header="Debug"></MenuItem>
<MenuItem Header="Tools"></MenuItem>
<MenuItem Header="Theme"></MenuItem>
</Menu>
</Grid>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" MinWidth="100" />
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="300" MinWidth="20" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*" MinHeight="100" />
<RowDefinition Height="5"/>
<RowDefinition Height="100" MinHeight="20" />
</Grid.RowDefinitions>
<Grid>
<TabControl ItemsSource="{Binding OpenProjectItems}" SelectedItem="{Binding SelectedProjectItem}">
<TabControl.ItemContainerStyle>
<Style BasedOn="{StaticResource MetroTabItem}" TargetType="{x:Type TabItem}">
<Setter Property="Background" Value="{StaticResource IdeLightBackgroundBrush}"></Setter>
<Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="12"></Setter>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<Border>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" Foreground="Gainsboro" VerticalAlignment="Center"></TextBlock>
<Button Command="{Binding ElementName=control,Path=DataContext.CloseProjectItemCommand}" CommandParameter="{Binding}" Margin="5 0 0 0" Cursor="Hand" Width="24" Height="24" VerticalAlignment="Center" Style="{DynamicResource MetroCircleButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<fa:ImageAwesome Width="10" Height="10" Icon="WindowClose" Foreground="Gainsboro"></fa:ImageAwesome>
</StackPanel>
</Button>
</StackPanel>
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True">
<Setter Property="Background" Value="#007ACC"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</TabControl.ItemContainerStyle>
<TabControl.ContentTemplate>
<DataTemplate>
<ContentPresenter Content="{Binding View}" />
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</Grid>
<GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1" Background="{StaticResource IdeLightBackgroundBrush}" />
<Grid Grid.Row="2" Background="{StaticResource IdeMidBackgroundBrush}">
</Grid>
</Grid>
<GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="1" Background="{StaticResource IdeLightBackgroundBrush}" />
<Grid Grid.Column="2">
<GroupBox Margin="0" Header="Solution Explorer" BorderThickness="1" BorderBrush="{StaticResource IdeBorderBrush}" mahapps:ControlsHelper.ContentCharacterCasing="Normal">
<TreeView ItemsSource="{Binding Solution.Projects}" Background="{StaticResource IdeMidBackgroundBrush}" >
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem" BasedOn="{StaticResource {x:Type TreeViewItem}}">
<Setter Property="Background" Value="Transparent"></Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Transparent"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</TreeView.ItemContainerStyle>
<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>
</GroupBox>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>
oToolBarButtonStyle}" >
<Image Source="/Tango.Scripting.IDE;component/Images/NewFileCollection_16x.png" Height="16" Width="16"/>
</Button>
<Button Click="Button_Click" ToolTip="Open File" Style="{DynamicResource TangoToolBarButtonStyle}">
<Image Source="/Tango.Scripting.IDE;component/Images/OpenFolder_16x.png" Height="16" Width="16"/>
</Button>
<Button Click="Button_Click" ToolTip="Save File" Style="{DynamicResource TangoToolBarButtonStyle}">
<Image Source="/Tango.Scripting.IDE;component/Images/Save_16x.png" Height="16" Width="16"/>
</Button>
<Button Click="Button_Click" ToolTip="Save All" Style="{DynamicResource TangoToolBarButtonStyle}">
<Image Source="/Tango.Scripting.IDE;component/Images/SaveAll_16x.png" Height="16" Width="16"/>
</Button>
<Separator ></Separator>
<Button Click="Button_Click" ToolTip="Undo" Style="{DynamicResource TangoToolBarButtonStyle}">
<Image Source="/Tango.Scripting.IDE;component/Images/Undo_16x.png" Height="16" Width="16"/>
</Button>
<Button Click="Button_Click" ToolTip="Redo" Style="{DynamicResource TangoToolBarButtonStyle}">
<Image Source="/Tango.Scripting.IDE;component/Images/Redo_16x.png" Height="16" Width="16"/>
</Button>
<ComboBox Style="{DynamicResource TangoComboboxStyle}" Margin="2" x:Name="cmb2" SelectedIndex="0" HorizontalContentAlignment="Stretch" Width="100" >
<ComboBoxItem IsSelected="True">Debug</ComboBoxItem>
<ComboBoxItem >Release</ComboBoxItem>
<ComboBoxItem>Configuration Manager...</ComboBoxItem>
</ComboBox>
<Separator ></Separator>
<ToggleButton x:Name="Run_Button" Command="{Binding RunProject}" IsChecked="{Binding IsRunProject, Mode=TwoWay}" ToolTip="Start">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<Rectangle x:Name="background" Fill="Transparent" Opacity="1"/>
<StackPanel Orientation="Horizontal" >
<Path x:Name="RunArrow"
HorizontalAlignment="Left" VerticalAlignment="Center"
Width="12" Height="10" Margin="2,0,0,0"
Stretch="Fill" Fill="#FF8DD28A"
RenderTransformOrigin="0.6,0.4"
Data="M0,0 L1,0 0.5,1 z" >
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="270"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
<TextBlock x:Name="Run_Text" Margin="8,0,4,0" Text="Start" VerticalAlignment="Center"/>
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Foreground" TargetName="Run_Text" Value="{DynamicResource ToggleButton.Checked.Foreground}"/>
<Setter Property="Fill" TargetName="RunArrow" Value="{DynamicResource ToggleButton.Checked.Foreground}"/>
<Setter Property="Text" TargetName="Run_Text" Value="Continue"/>
<Setter Property="ToggleButton.ToolTip" Value="Continue"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="False" />
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Fill" TargetName="background" Value="{DynamicResource Toolbar.Button.MaouseMove.Background}"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<Button Click="Button_Click" ToolTip="Pause" Visibility="{Binding IsChecked, ElementName=Run_Button, Converter={StaticResource BoolToVis}}" Style="{DynamicResource TangoToolBarButtonStyle}">
<Image Source="/Tango.Scripting.IDE;component/Images/Pause_16x.png" Height="16" Width="16"/>
</Button>
<Button x:Name="StopButton" ToolTip="Stop" Command="{Binding StopProject}" Visibility="{Binding IsChecked, ElementName=Run_Button, Converter={StaticResource BoolToVis}}" Style="{DynamicResource TangoToolBarButtonStyle}">
<Image Source="/Tango.Scripting.IDE;component/Images/stop.png" Height="16" Width="16"/>
</Button>
</ToolBar>
</ToolBarTray>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15" />
<ColumnDefinition Width="1*" MinWidth="100" />
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="300" MinWidth="20" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*" MinHeight="100" />
<RowDefinition Height="5"/>
<RowDefinition Height="100" MinHeight="20" />
</Grid.RowDefinitions>
<Grid>
<TabControl Foreground="{DynamicResource ControlForegroundKey}" ItemsSource="{Binding OpenProjectItems}" SelectedItem="{Binding SelectedProjectItem}" Style="{DynamicResource TangoTabControlStyle}">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" Foreground="Gainsboro" VerticalAlignment="Center"></TextBlock>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<ContentPresenter Content="{Binding View}" />
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</Grid>
<GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1" Background="{DynamicResource Background.Static}" />
<Grid Grid.Row="2" Background="{DynamicResource Background.Static}">
<!--<Border BorderThickness="0" Margin="1,0,0,2">-->
<TabControl TabStripPlacement="Bottom" Style="{DynamicResource TangoTabControlStyle}">
<TabItem Header="Error list">
<GroupBox Header="Error List" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" Margin="-1">
<DataGrid Background="{DynamicResource TabItem.Content.Static}" Style="{DynamicResource TangoDataGridStyle}" Padding="2,5,2,0"
ColumnHeaderStyle="{DynamicResource TangoDataGridColumnHeaderStyle}" ItemsSource="{Binding ErrorList}"
CanUserSortColumns="True" CanUserResizeColumns="True" IsReadOnly="True"/>
</GroupBox>
</TabItem>
<TabItem Header="Output">
<GroupBox Header="Output" BorderThickness="1" Style="{DynamicResource TangoGroupBoxStyle}" Margin="-1">
<TextBox TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" Name="OutputText" Background="{DynamicResource TabItem.Content.Static}" />
</GroupBox>
</TabItem>
</TabControl>
<!--</Border>-->
</Grid>
</Grid>
<GridSplitter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="2" Background="{DynamicResource Background.Static}" />
<Grid Grid.Column="3">
<Grid.RowDefinitions>
<RowDefinition Height="1*" MinHeight="100"/>
<RowDefinition Height="5"/>
<RowDefinition Height="100" MinHeight="20"/>
<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>
</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}" >
<!--<Border BorderThickness="0" Margin="1,0,0,2">-->
<DataGrid Background="{DynamicResource TabItem.Content.Static}" Style="{DynamicResource TangoDataGridStyle}" Padding="2,5,2,0"
ColumnHeaderStyle="{DynamicResource TangoDataGridColumnHeaderStyle}" ItemsSource="{Binding ErrorList}"
CanUserSortColumns="True" CanUserResizeColumns="True" IsReadOnly="True"/>
<!--</Border>-->
</GroupBox>
</Grid>
</Grid>
</Grid>
</UserControl>
|