aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogDetailsView.xaml
blob: 6511f035f6bfa7b5102f02df0f2467797ebf1beb (plain)
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
<UserControl x:Class="Tango.MachineStudio.Logging.Views.EmbeddedLogDetailsView"
             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:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:vm="clr-namespace:Tango.MachineStudio.Logging.ViewModels"
             xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views"
             mc:Ignorable="d" 
             Height="500" Width="800" Background="White" d:DataContext="{d:DesignInstance Type=vm:LogDetailsViewVM, IsDesignTimeCreatable=False}">

    <UserControl.Resources>
        <converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" />
    </UserControl.Resources>

    <Grid>
        <Grid Grid.RowSpan="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="60"/>
                <RowDefinition Height="31*"/>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>

            <StackPanel Orientation="Horizontal">
                <materialDesign:PackIcon Width="42" Height="42" VerticalAlignment="Center">
                    <materialDesign:PackIcon.Style>
                        <Style TargetType="materialDesign:PackIcon">
                            <Setter Property="Kind" Value="Alert"></Setter>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Log.Category}" Value="Info">
                                    <Setter Property="Kind" Value="Information"></Setter>
                                    <Setter Property="Foreground" Value="DimGray"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Log.Category}" Value="Warning">
                                    <Setter Property="Kind" Value="Alert"></Setter>
                                    <Setter Property="Foreground" Value="#FFA300"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Log.Category}" Value="Error">
                                    <Setter Property="Kind" Value="AlertOctagon"></Setter>
                                    <Setter Property="Foreground" Value="#FF5C5C"></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Log.Category}" Value="Critical">
                                    <Setter Property="Kind" Value="BellPlus"></Setter>
                                    <Setter Property="Foreground" Value="Red"></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </materialDesign:PackIcon.Style>
                </materialDesign:PackIcon>
                <TextBlock VerticalAlignment="Center" Text="{Binding Log.Message}" TextWrapping="NoWrap" Height="22" TextTrimming="CharacterEllipsis" Width="500" Margin="10 0 0 0" FontSize="16"></TextBlock>
            </StackPanel>

            <Grid Grid.Row="1">
                <DockPanel>
                    <Grid DockPanel.Dock="Top">
                        <controls:TableGrid RowHeight="30">
                            <TextBlock Text="Time Stamp:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Log.TimeStamp,Converter={StaticResource DateTimeUTCToStringConverter},ConverterParameter='MM/dd/yyyy HH:mm:ss.fff'}"></TextBlock>
                            <TextBlock Text="Category:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Log.Category}"></TextBlock>
                            <TextBlock Text="File:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Log.RelativeCallerFile}"></TextBlock>
                            <TextBlock Text="Module Id:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Log.DebugLogResponse.ModuleId}"></TextBlock>
                            <TextBlock Text="Filter:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Log.DebugLogResponse.Filter}"></TextBlock>
                            <TextBlock Text="Line:" FontWeight="SemiBold" />
                            <TextBlock Text="{Binding Log.CallerLineNumber}"></TextBlock>
                        </controls:TableGrid>
                    </Grid>

                    <Border Padding="5" BorderThickness="1" BorderBrush="Gainsboro">
                        <TextBox BorderThickness="0" Text="{Binding Log.Message}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent" />
                    </Border>
                </DockPanel>
            </Grid>

            <Grid Grid.Row="2">
                <Button HorizontalAlignment="Right" Width="140" Command="{Binding CloseCommand}">CLOSE</Button>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Tango.Scripting.Editors"
    xmlns:popups="clr-namespace:Tango.Scripting.Editors.Popups"
    xmlns:fa="http://schemas.fontawesome.io/icons/"
	xmlns:editing="clr-namespace:Tango.Scripting.Editors.Editing"
    xmlns:folding="clr-namespace:Tango.Scripting.Editors.Folding"
    xmlns:intellisense="clr-namespace:Tango.Scripting.Editors.Intellisense"
    xmlns:converters="clr-namespace:Tango.Scripting.Editors.Converters"
    xmlns:completion="clr-namespace:Tango.Scripting.Editors.CodeCompletion">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Tango.Scripting.Editors;component/TextEditor.xaml" />
        <ResourceDictionary Source="/Tango.Scripting.Editors;component/Search/DropDownButton.xaml" />
        <ResourceDictionary Source="/Tango.Scripting.Editors;component/Search/SearchPanel.xaml" />
        <ResourceDictionary Source="/Tango.Scripting.Editors;component/CodeCompletion/CompletionList.xaml" />
        <ResourceDictionary Source="/Tango.Scripting.Editors;component/CodeCompletion/InsightWindow.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--Colors-->
    <Color x:Key="ScriptBackground">#1E1E1E</Color>
    <Color x:Key="CompletionBackground">#232323</Color>
    <Color x:Key="CompletionToolTipBackground">#3B3B3B</Color>
    <Color x:Key="ScriptForeground">#E6E6E6</Color>
    <Color x:Key="ScriptFoldingForeground">#A0A0A0</Color>
    <Color x:Key="ScriptLineNumberForeground">#2B91AF</Color>
    <Color x:Key="ScriptReferenceTypesColor">#4EC9B0</Color>
    <Color x:Key="ScriptKeywordColor">#3F8FD6</Color>
    <Color x:Key="ScriptInterfaceColor">#B5CE8A</Color>

    <!--Brushes-->
    <SolidColorBrush x:Key="ScriptBackgroundBrush" Color="{StaticResource ScriptBackground}"></SolidColorBrush>
    <SolidColorBrush x:Key="ScriptForegroundBrush" Color="{StaticResource ScriptForeground}"></SolidColorBrush>
    <SolidColorBrush x:Key="ScriptFoldingForegroundBrush" Color="{StaticResource ScriptFoldingForeground}"></SolidColorBrush>
    <SolidColorBrush x:Key="ScriptLineNumberForegroundBrush" Color="{StaticResource ScriptLineNumberForeground}"></SolidColorBrush>
    <SolidColorBrush x:Key="CompletionBackgroundBrush" Color="{StaticResource CompletionBackground}"></SolidColorBrush>
    <SolidColorBrush x:Key="CompletionToolTipBackgroundBrush" Color="{StaticResource CompletionToolTipBackground}"></SolidColorBrush>
    <SolidColorBrush x:Key="ScriptReferenceTypesBrush" Color="{StaticResource ScriptReferenceTypesColor}"></SolidColorBrush>
    <SolidColorBrush x:Key="ScriptKeywordBrush" Color="{StaticResource ScriptKeywordColor}"></SolidColorBrush>
    <SolidColorBrush x:Key="ScriptInterfaceBrush" Color="{StaticResource ScriptInterfaceColor}"></SolidColorBrush>

    <!--Images-->
    <BitmapImage x:Key="interface" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/interface.png" />
    <BitmapImage x:Key="class" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/class.png" />
    <BitmapImage x:Key="enum" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/enum.png" />
    <BitmapImage x:Key="struct" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/struct.png" />
    <BitmapImage x:Key="namespace" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/namespace.png" />
    <BitmapImage x:Key="method" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/method.png" />
    <BitmapImage x:Key="property" UriSource="pack://application:,,,/Tango.Scripting.Editors;component/Images/property.png" />

    <!--Converters-->
    <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <converters:BooleanToVisibilityInversedConverter x:Key="BooleanToVisibilityInversedConverter" />

    <Style TargetType="{x:Type completion:CompletionList}">
        <Setter Property="Background" Value="{StaticResource CompletionBackgroundBrush}"></Setter>
        <Setter Property="BorderThickness" Value="0"></Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type completion:CompletionList}">
                    <Border MinWidth="320" MaxHeight="200" BorderBrush="#434343" BorderThickness="1" Padding="0" Background="{StaticResource CompletionBackgroundBrush}">
                        <DockPanel>
                            <Border DockPanel.Dock="Bottom" Height="25" Background="#181818" BorderThickness="0 1 0 0" BorderBrush="#434343">

                            </Border>
                            <completion:CompletionListBox x:Name="PART_ListBox" BorderThickness="0" Padding="0" Background="{StaticResource CompletionBackgroundBrush}" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                                <completion:CompletionListBox.Style>
                                    <Style TargetType="ListBox">
                                        <Setter Property="ItemContainerStyle">
                                            <Setter.Value>
                                                <Style TargetType="completion:CompletionListBoxItem">
                                                    <Setter Property="Template">
                                                        <Setter.Value>
                                                            <ControlTemplate TargetType="ListBoxItem">
                                                                <Border Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" TextElement.Foreground="{TemplateBinding Foreground}">
                                                                    <ContentPresenter/>
                                                                </Border>
                                                            </ControlTemplate>
                                                        </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="ToolTipContentTemplate">
                                                        <Setter.Value>
                                                            <DataTemplate>
                                                                <Border Background="{StaticResource CompletionToolTipBackgroundBrush}" CornerRadius="3" BorderThickness="0.5" BorderBrush="#434343" Padding="10 5" TextElement.Foreground="{StaticResource ScriptForegroundBrush}" TextElement.FontSize="12">
                                                                    <!--<ContentControl Content="{Binding}">
                                                                        <ContentControl.Style>
                                                                            <Style TargetType="ContentControl">
                                                                                <Setter Property="ContentTemplate">
                                                                                    <Setter.Value>
                                                                                        <DataTemplate>
                                                                                            <ContentPresenter Content="{Binding PopupControl}" />
                                                                                        </DataTemplate>
                                                                                    </Setter.Value>
                                                                                </Setter>
                                                                                <Style.Triggers>
                                                                                    <DataTrigger Binding="{Binding Type}" Value="method">
                                                                                        <Setter Property="ContentTemplate">
                                                                                            <Setter.Value>
                                                                                                <DataTemplate>
                                                                                                    <StackPanel>
                                                                                                        <StackPanel Orientation="Horizontal">
                                                                                                            <TextBlock Text="{Binding ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                                                                                            <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                                                                                            <TextBlock>.</TextBlock>
                                                                                                            <TextBlock Text="{Binding Text}"></TextBlock>
                                                                                                            <TextBlock>(</TextBlock>
                                                                                                            <ItemsControl ItemsSource="{Binding Parameters}">
                                                                                                                <ItemsControl.ItemsPanel>
                                                                                                                    <ItemsPanelTemplate>
                                                                                                                        <StackPanel Orientation="Horizontal"></StackPanel>
                                                                                                                    </ItemsPanelTemplate>
                                                                                                                </ItemsControl.ItemsPanel>
                                                                                                                <ItemsControl.ItemTemplate>
                                                                                                                    <DataTemplate>
                                                                                                                        <StackPanel Orientation="Horizontal">
                                                                                                                            <TextBlock Text="{Binding Type.Name}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                                                                                                            <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock>
                                                                                                                            <TextBlock Margin="0 0 5 0" Text="," Visibility="{Binding IsLast,Converter={StaticResource BooleanToVisibilityInversedConverter}}"></TextBlock>
                                                                                                                        </StackPanel>
                                                                                                                    </DataTemplate>
                                                                                                                </ItemsControl.ItemTemplate>
                                                                                                            </ItemsControl>
                                                                                                            <TextBlock>)</TextBlock>

                                                                                                            <StackPanel Margin="5 0 0 0" Orientation="Horizontal" Visibility="{Binding HasOverloads,Converter={StaticResource BooleanToVisibilityConverter}}">
                                                                                                                <TextBlock>(+</TextBlock>
                                                                                                                <TextBlock Margin="2 0" Text="{Binding Overloads}"></TextBlock>
                                                                                                                <TextBlock>overloads)</TextBlock>
                                                                                                            </StackPanel>
                                                                                                        </StackPanel>

                                                                                                        <TextBlock Text="{Binding Description}"></TextBlock>
                                                                                                    </StackPanel>
                                                                                                </DataTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </DataTrigger>

                                                                                    <DataTrigger Binding="{Binding Type}" Value="property">
                                                                                        <Setter Property="ContentTemplate">
                                                                                            <Setter.Value>
                                                                                                <DataTemplate>
                                                                                                    <StackPanel>
                                                                                                        <StackPanel Orientation="Horizontal">
                                                                                                            <TextBlock Text="{Binding ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                                                                                            <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                                                                                            <TextBlock>.</TextBlock>
                                                                                                            <TextBlock Text="{Binding Text}"></TextBlock>
                                                                                                            <TextBlock Margin="5 0 0 0">
                                                                                                                <Run>{</Run>
                                                                                                                <Run Foreground="{StaticResource ScriptKeywordBrush}">get</Run><Run>;</Run>
                                                                                                                <Run Foreground="{StaticResource ScriptKeywordBrush}">set</Run><Run>;</Run>
                                                                                                                <Run>}</Run>
                                                                                                            </TextBlock>
                                                                                                        </StackPanel>

                                                                                                        <TextBlock Text="{Binding Description}"></TextBlock>
                                                                                                    </StackPanel>
                                                                                                </DataTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </DataTrigger>
                                                                                </Style.Triggers>
                                                                            </Style>
                                                                        </ContentControl.Style>

                                                                        <ContentControl.ContentTemplate>
                                                                            <DataTemplate>
                                                                                <ContentPresenter Content="{Binding PopupControl}" />
                                                                            </DataTemplate>
                                                                        </ContentControl.ContentTemplate>
                                                                    </ContentControl>-->

                                                                    <ContentPresenter DataContext="{Binding}" Content="{Binding PopupControl}" />
                                                                </Border>
                                                            </DataTemplate>
                                                        </Setter.Value>
                                                    </Setter>
                                                    <Setter Property="Background" Value="{StaticResource CompletionBackgroundBrush}"></Setter>
                                                    <Setter Property="Foreground" Value="{StaticResource ScriptForegroundBrush}"></Setter>
                                                    <Setter Property="Padding" Value="2"></Setter>
                                                    <Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay}"></Setter>
                                                    <Setter Property="BorderThickness" Value="0"></Setter>
                                                    <Style.Triggers>
                                                        <Trigger Property="IsSelected" Value="True">
                                                            <Setter Property="Background" Value="#187DBB"></Setter>
                                                            <Setter Property="Foreground" Value="{StaticResource ScriptForegroundBrush}"></Setter>
                                                        </Trigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </completion:CompletionListBox.Style>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Width="16" Height="16" Margin="0,0,4,0" Source="{Binding Image}"></Image>
                                            <ContentControl Content="{Binding}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </completion:CompletionListBox>
                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type folding:FoldingMargin}">
        <Setter Property="FoldingMarkerBackgroundBrush" Value="{StaticResource ScriptBackgroundBrush}"></Setter>
        <Setter Property="FoldingMarkerBrush" Value="{StaticResource ScriptFoldingForegroundBrush}"></Setter>
        <Setter Property="SelectedFoldingMarkerBackgroundBrush" Value="{StaticResource ScriptBackgroundBrush}"></Setter>
        <Setter Property="SelectedFoldingMarkerBrush" Value="{StaticResource ScriptFoldingForegroundBrush}"></Setter>
        <Setter Property="Control.Cursor" Value="/Tango.Scripting.Editors;component/themes/RightArrow.cur"/>
    </Style>

    <Style TargetType="{x:Type editing:LineNumberMargin}">
        <Setter Property="Width" Value="55"></Setter>
        <Setter Property="Foreground" Value="{StaticResource ScriptLineNumberForegroundBrush}"></Setter>
        <Setter Property="Control.Cursor" Value="/Tango.Scripting.Editors;component/themes/RightArrow.cur"/>
    </Style>

    <Style TargetType="{x:Type local:ScriptEditor}">
        <Setter Property="Background" Value="{StaticResource ScriptBackgroundBrush}"></Setter>
        <Setter Property="Foreground" Value="{StaticResource ScriptForegroundBrush}"></Setter>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"></Setter>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"></Setter>
        <Setter Property="FontFamily" Value="Consolas"></Setter>
        <Setter Property="FontSize" Value="13"></Setter>
        <Setter Property="SyntaxHighlighting" Value="C#"></Setter>
        <Setter Property="ShowLineNumbers" Value="True"></Setter>
        <Setter Property="ContextMenu">
            <Setter.Value>
                <ContextMenu>
                    <ContextMenu.Resources>
                        <Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
                            <Setter Property="Foreground" Value="Gainsboro"></Setter>
                        </Style>
                    </ContextMenu.Resources>
                    <MenuItem Header="Cut" MinWidth="150" Command="Cut">
                        <MenuItem.Icon>
                            <fa:ImageAwesome Icon="Cut" Width="12" Foreground="Gainsboro" Margin="2" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator/>
                    <MenuItem Header="Copy" Command="Copy">
                        <MenuItem.Icon>
                            <fa:ImageAwesome Icon="Copy" Width="12" Foreground="Gainsboro" Margin="2" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Paste" Command="Paste">
                        <MenuItem.Icon>
                            <fa:ImageAwesome Icon="Paste" Width="12" Foreground="Gainsboro" Margin="2" />
                        </MenuItem.Icon>
                    </MenuItem>
                </ContextMenu>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ScriptEditor}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <Grid>
                            <ScrollViewer
						    Focusable="False"
						    Name="PART_ScrollViewer"
						    CanContentScroll="True"
						    VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}"
						    HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
						    Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TextArea}"
						    VerticalContentAlignment="Top"
						    HorizontalContentAlignment="Left"
						    Background="{TemplateBinding Background}"
						    Padding="{TemplateBinding Padding}"/>

                            <Popup x:Name="PART_popup" IsOpen="False" AllowsTransparency="True">
                                <Border Background="{StaticResource CompletionToolTipBackgroundBrush}" CornerRadius="3" BorderThickness="0.5" BorderBrush="#434343" Padding="10 5" TextElement.Foreground="{StaticResource ScriptForegroundBrush}" TextElement.FontSize="12">
                                    <ContentControl Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CurrentPopupContent}" />
                                </Border>
                            </Popup>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type popups:MethodPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type popups:MethodPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <DockPanel>
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Top">
                                <fa:ImageAwesome VerticalAlignment="Center" Icon="ChevronUp" Width="10" Height="10" Foreground="{StaticResource ScriptForegroundBrush}" />
                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethodIndex}"></TextBlock>
                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">of</TextBlock>
                                <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=Methods.Count}"></TextBlock>
                                <fa:ImageAwesome VerticalAlignment="Center" Margin="5 0 0 0" Icon="ChevronDown" Width="10" Height="10" Foreground="{StaticResource ScriptForegroundBrush}" />
                            </StackPanel>

                            <StackPanel Margin="10 0 0 0">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                    <TextBlock Margin="5 0 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                    <TextBlock>.</TextBlock>
                                    <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Name}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                    <TextBlock>(</TextBlock>
                                    <ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Parameters}">
                                        <ItemsControl.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <StackPanel Orientation="Horizontal"></StackPanel>
                                            </ItemsPanelTemplate>
                                        </ItemsControl.ItemsPanel>
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate DataType="{x:Type popups:ParameterDescription}">
                                                <StackPanel Orientation="Horizontal">
                                                    <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                                    <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock>
                                                    <TextBlock Margin="0 0 5 0" Visibility="{Binding IsLast,Converter={StaticResource BooleanToVisibilityInversedConverter}}">,</TextBlock>
                                                </StackPanel>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>
                                    <TextBlock>)</TextBlock>
                                </StackPanel>

                                <TextBlock Margin="0 5 0 0" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Description}" TextWrapping="Wrap"></TextBlock>

                                <ItemsControl Margin="0 10 0 0" ItemsSource="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CurrentMethod.Parameters}">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate DataType="{x:Type popups:ParameterDescription}">
                                            <StackPanel Orientation="Horizontal">
                                                <StackPanel.Style>
                                                    <Style TargetType="StackPanel">
                                                        <Setter Property="Visibility" Value="Visible"></Setter>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding Description}" Value="{x:Null}">
                                                                <Setter Property="Visibility" Value="Collapsed"></Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </StackPanel.Style>
                                                <TextBlock Text="{Binding Name}"></TextBlock>
                                                <TextBlock>:</TextBlock>
                                                <TextBlock Opacity="0.7" Margin="5 0 0 0" Text="{Binding Description}"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </StackPanel>
                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Completion Items-->

    <Style TargetType="{x:Type intellisense:ClassCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:ClassCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <TextBlock TextWrapping="Wrap">
                               <Run Text="class" Foreground="{StaticResource ScriptKeywordBrush}"></Run>
                               <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Name,Mode=OneWay}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></Run>
                               <LineBreak/>
                               <Run Text="{Binding Description,Mode=OneWay}"></Run>
                        </TextBlock>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type intellisense:EnumCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:EnumCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <TextBlock TextWrapping="Wrap">
                               <Run Text="enum" Foreground="{StaticResource ScriptKeywordBrush}"></Run>
                               <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Text,Mode=OneWay}" Foreground="{StaticResource ScriptInterfaceBrush}"></Run>
                               <LineBreak/>
                               <Run Text="{Binding Description,Mode=OneWay}"></Run>
                        </TextBlock>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type intellisense:MethodCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:MethodCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding ReturnType}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                <TextBlock>.</TextBlock>
                                <TextBlock Text="{Binding Name}"></TextBlock>
                                <TextBlock>(</TextBlock>
                                <ItemsControl ItemsSource="{Binding Parameters}">
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal"></StackPanel>
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                                <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock>
                                                <TextBlock Margin="0 0 5 0" Text="," Visibility="{Binding IsLast,Converter={StaticResource BooleanToVisibilityInversedConverter}}"></TextBlock>
                                            </StackPanel>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                                <TextBlock>)</TextBlock>

                                <StackPanel Margin="5 0 0 0" Orientation="Horizontal" Visibility="{Binding HasOverloads,Converter={StaticResource BooleanToVisibilityConverter}}">
                                    <TextBlock>(+</TextBlock>
                                    <TextBlock Margin="2 0" Text="{Binding Overloads}"></TextBlock>
                                    <TextBlock>overloads)</TextBlock>
                                </StackPanel>
                            </StackPanel>

                            <TextBlock Text="{Binding Description}"></TextBlock>
                        </StackPanel>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type intellisense:InterfaceCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:InterfaceCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <TextBlock TextWrapping="Wrap">
                               <Run Text="interface" Foreground="#3F8FD6"></Run>
                               <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Name,Mode=OneWay}" Foreground="{StaticResource ScriptInterfaceBrush}"></Run>
                               <LineBreak/>
                               <Run Text="{Binding Description,Mode=OneWay}"></Run>
                        </TextBlock>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type intellisense:NamespaceCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:NamespaceCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <TextBlock TextWrapping="Wrap">
                              <Run Text="namespace" Foreground="{StaticResource ScriptKeywordBrush}"></Run>
                              <Run Text="{Binding Name,Mode=OneWay}"></Run>
                        </TextBlock>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type intellisense:PropertyCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:PropertyCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                <TextBlock Margin="5 0 0 0" Text="{Binding Class}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                <TextBlock>.</TextBlock>
                                <TextBlock Text="{Binding Text}"></TextBlock>
                                <TextBlock Margin="5 0 0 0">
                                    <Run>{</Run>
                                    <Run Foreground="{StaticResource ScriptKeywordBrush}">get</Run><Run>;</Run>
                                    <Run Foreground="{StaticResource ScriptKeywordBrush}">set</Run><Run>;</Run>
                                    <Run>}</Run>
                                </TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding Description}"></TextBlock>
                        </StackPanel>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type intellisense:StructCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:StructCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <TextBlock TextWrapping="Wrap">
                               <Run Text="struct" Foreground="#3F8FD6"></Run>
                               <Run Text="{Binding Namespace,Mode=OneWay}"></Run>.<Run Text="{Binding Name,Mode=OneWay}" Foreground="{StaticResource ScriptInterfaceBrush}"></Run>
                               <LineBreak/>
                               <Run Text="{Binding Description,Mode=OneWay}"></Run>
                        </TextBlock>
                        
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type intellisense:FieldCompletionItemPopup}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type intellisense:FieldCompletionItemPopup}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Type}" Foreground="{StaticResource ScriptReferenceTypesBrush}"></TextBlock>
                                <TextBlock Margin="5 0 0 0" Text="{Binding Text}"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding Description}"></TextBlock>
                        </StackPanel>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>