aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-09-26 14:35:47 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-09-26 14:35:47 +0300
commitdee664eaeaf48edfa2ad2f90d6384d727dc35432 (patch)
tree12e4d9f3896812aa1358cb3d2587910447bcd53f /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views
parentb55886b8a240f597cdac1232764da0e08528fb22 (diff)
downloadTango-dee664eaeaf48edfa2ad2f90d6384d727dc35432.tar.gz
Tango-dee664eaeaf48edfa2ad2f90d6384d727dc35432.zip
Implemented Tech board tabs and project!!!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml107
3 files changed, 79 insertions, 69 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml
deleted file mode 100644
index fc14343a2..000000000
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml
+++ /dev/null
@@ -1,13 +0,0 @@
-<UserControl x:Class="Tango.MachineStudio.Technician.Views.MachineTechTabView"
- 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:vm="clr-namespace:Tango.MachineStudio.Technician.ViewModels"
- xmlns:local="clr-namespace:Tango.MachineStudio.Technician.Views"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MachineTechTabVM, IsDesignTimeCreatable=False}">
- <Grid>
-
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml.cs
deleted file mode 100644
index 38b1ae045..000000000
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechTabView.xaml.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace Tango.MachineStudio.Technician.Views
-{
- /// <summary>
- /// Interaction logic for MachineTechTabView.xaml
- /// </summary>
- public partial class MachineTechTabView : UserControl
- {
- public MachineTechTabView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
index 99ecf72f2..dec4cee44 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
@@ -134,6 +134,12 @@
<Menu Padding="5" Background="#C6ECECEC" Visibility="{Binding HideMenu,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<MenuItem Header="File">
+ <MenuItem Command="{Binding NewProjectCommand}" MinWidth="180" Header="New" VerticalContentAlignment="Center">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="File" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ <Separator/>
<MenuItem Command="{Binding OpenProjectCommand}" MinWidth="180" Header="Open" VerticalContentAlignment="Center">
<MenuItem.Icon>
<fa:ImageAwesome Icon="FolderOpen" Width="16" />
@@ -152,58 +158,58 @@
</MenuItem>
</MenuItem>
<MenuItem Header="Edit">
- <MenuItem Header="Cut (Ctrl+X)" Command="{Binding ElementName=editor,Path=CutCommand}" MinWidth="210">
+ <MenuItem Header="Cut (Ctrl+X)" Command="{Binding SelectedTab.Editor.CutCommand}" MinWidth="210">
<MenuItem.Icon>
<fa:ImageAwesome Icon="Cut" Width="16" />
</MenuItem.Icon>
</MenuItem>
- <MenuItem Header="Copy (Ctrl+C)" Command="{Binding ElementName=editor,Path=CopyCommand}">
+ <MenuItem Header="Copy (Ctrl+C)" Command="{Binding SelectedTab.Editor.CopyCommand}">
<MenuItem.Icon>
<fa:ImageAwesome Icon="Copy" Width="16" />
</MenuItem.Icon>
</MenuItem>
- <MenuItem Header="Paste (Ctrl+V)" Command="{Binding ElementName=editor,Path=PasteCommand}">
+ <MenuItem Header="Paste (Ctrl+V)" Command="{Binding SelectedTab.Editor.PasteCommand}">
<MenuItem.Icon>
<fa:ImageAwesome Icon="Paste" Width="16" />
</MenuItem.Icon>
</MenuItem>
<Separator/>
- <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding ElementName=editor,Path=UndoCommand}">
+ <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding SelectedTab.Editor.UndoCommand}">
<MenuItem.Icon>
<fa:ImageAwesome Icon="Undo" Width="16" />
</MenuItem.Icon>
</MenuItem>
- <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding ElementName=editor,Path=RedoCommand}">
+ <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding SelectedTab.Editor.RedoCommand}">
<MenuItem.Icon>
<fa:ImageAwesome Icon="RotateRight" Width="16"></fa:ImageAwesome>
</MenuItem.Icon>
</MenuItem>
<Separator/>
- <MenuItem Header="Delete (DELETE)" Command="{Binding ElementName=editor,Path=DeleteCommand}">
+ <MenuItem Header="Delete (DELETE)" Command="{Binding SelectedTab.Editor.DeleteCommand}">
<MenuItem.Icon>
<fa:ImageAwesome Icon="Recycle" Width="16" />
</MenuItem.Icon>
</MenuItem>
<Separator/>
- <MenuItem Header="Select All (Ctrl+A)" Command="{Binding ElementName=editor,Path=SelectAllCommand}">
+ <MenuItem Header="Select All (Ctrl+A)" Command="{Binding SelectedTab.Editor.SelectAllCommand}">
<MenuItem.Icon>
<fa:ImageAwesome Icon="Th" Width="16" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="View">
- <MenuItem Header="Zoom In" Command="{Binding ElementName=editor,Path=ZoomCommand}" CommandParameter="0.1">
+ <MenuItem Header="Zoom In" Command="{Binding SelectedTab.Editor.ZoomCommand}" CommandParameter="0.1">
<MenuItem.Icon>
<fa:ImageAwesome Icon="SearchPlus" Width="16" />
</MenuItem.Icon>
</MenuItem>
- <MenuItem Header="Zoom Out" Command="{Binding ElementName=editor,Path=ZoomCommand}" CommandParameter="-0.1">
+ <MenuItem Header="Zoom Out" Command="{Binding SelectedTab.Editor.ZoomCommand}" CommandParameter="-0.1">
<MenuItem.Icon>
<fa:ImageAwesome Icon="SearchMinus" Width="16" />
</MenuItem.Icon>
</MenuItem>
<Separator/>
- <MenuItem Header="Reset Zoom" Command="{Binding ElementName=editor,Path=ResetZoomCommand}">
+ <MenuItem Header="Reset Zoom" Command="{Binding SelectedTab.Editor.ResetZoomCommand}">
<MenuItem.Icon>
<fa:ImageAwesome Icon="Search" Width="16" />
</MenuItem.Icon>
@@ -355,28 +361,73 @@
<Grid Grid.Row="1">
<Grid.RowDefinitions>
- <RowDefinition Height="40"/>
+ <RowDefinition Height="30"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
- <ListBox Style="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" ItemsSource="{Binding Tabs}" SelectedItem="{Binding SelectedTab}">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel HorizontalAlignment="Left" Orientation="Horizontal"></StackPanel>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
+ <StackPanel Orientation="Horizontal" Margin="35 0 0 0">
+ <ListBox Style="{x:Null}" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" ItemContainerStyle="{StaticResource basicListBoxItem}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" ItemsSource="{Binding Tabs}" SelectedItem="{Binding SelectedTab}">
+ <ListBox.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel HorizontalAlignment="Left" Orientation="Horizontal"></StackPanel>
+ </ItemsPanelTemplate>
+ </ListBox.ItemsPanel>
+
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <Border Padding="5 5" Width="160" CornerRadius="10 10 0 0" Margin="1 0" Tag="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext}">
+ <Border.ContextMenu>
+ <ContextMenu DataContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
+ <MenuItem Header="Rename" Command="{Binding RenameTabCommand}" MinWidth="210">
+ <MenuItem.Icon>
+ <fa:ImageAwesome Icon="Pencil" Width="16" />
+ </MenuItem.Icon>
+ </MenuItem>
+ </ContextMenu>
+ </Border.ContextMenu>
+ <Border.Style>
+ <Style TargetType="Border">
+ <Setter Property="Background" Value="#CBCBCB"></Setter>
+ <Setter Property="TextElement.Foreground" Value="#202020"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsSelected}" Value="True">
+ <Setter Property="Background" Value="{StaticResource AccentColorBrush}"></Setter>
+ <Setter Property="TextElement.Foreground" Value="White"></Setter>
+ </DataTrigger>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter Property="Opacity" Value="0.8"></Setter>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </Border.Style>
+ <DockPanel VerticalAlignment="Center">
+ <Button Cursor="Hand" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveTabCommand}" CommandParameter="{Binding}" DockPanel.Dock="Right" Margin="5 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="2" Height="Auto">
+ <materialDesign:PackIcon Kind="Close">
+ <materialDesign:PackIcon.Style>
+ <Style TargetType="materialDesign:PackIcon">
+ <Setter Property="Foreground" Value="#202020"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsSelected}" Value="True">
+ <Setter Property="Foreground" Value="White"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </materialDesign:PackIcon.Style>
+ </materialDesign:PackIcon>
+ </Button>
+ <TextBlock Text="{Binding Name}" VerticalAlignment="Center" TextAlignment="Center" TextTrimming="CharacterEllipsis" FontSize="11"></TextBlock>
+ </DockPanel>
+ </Border>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
+ </ListBox>
+
+ <Button Margin="10 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="2" Height="24" Cursor="Hand" Command="{Binding AddTabCommand}" ToolTip="New tab">
+ <materialDesign:PackIcon Width="20" Height="20" Kind="Plus" Foreground="{StaticResource AccentColorBrush}" />
+ </Button>
+ </StackPanel>
-
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Border Background="Gray" Padding="5" CornerRadius="5 5 0 0">
- <TextBlock Text="{Binding Name}"></TextBlock>
- </Border>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
-
- <Grid Margin="5" Grid.Row="1">
+ <Grid Margin="5 0 5 5" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="300"/>