diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-15 10:17:37 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-04-15 10:17:37 +0300 |
| commit | 85a6112d2e1eac554cc4cbdfa31cca91d87e6ded (patch) | |
| tree | 602c713a6f115270c5a0bee0ec5e75ec6145052e /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician | |
| parent | 34d86579a1f4e3842566b3dd187f9fa5f3838d07 (diff) | |
| download | Tango-85a6112d2e1eac554cc4cbdfa31cca91d87e6ded.tar.gz Tango-85a6112d2e1eac554cc4cbdfa31cca91d87e6ded.zip | |
Implemented catalog importer..
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician')
2 files changed, 86 insertions, 64 deletions
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 92e2b292a..8820fcd4d 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 @@ -26,9 +26,9 @@ <localConverters:SecondsToTimeSpanConverter x:Key="SecondsToTimeSpanConverter" /> <DataTemplate x:Key="TabTemplate"> - <Grid> - <Grid.Style> - <Style TargetType="Grid"> + <Border IsVisibleChanged="Border_IsVisibleChanged"> + <Border.Style> + <Style TargetType="Border"> <Setter Property="Visibility" Value="Visible"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsSelected}" Value="False"> @@ -36,12 +36,13 @@ </DataTrigger> </Style.Triggers> </Style> - </Grid.Style> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="1*"/> - <ColumnDefinition Width="Auto"/> - </Grid.ColumnDefinitions> - <editors:ElementsEditor + </Border.Style> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + <editors:ElementsEditor x:Name="editor" Elements="{Binding Elements}" Loaded="Editor_Loaded" @@ -61,63 +62,64 @@ BorderBrush="#1EA9FF" BorderThickness="1"> - <editors:ElementsEditor.Style> - <Style TargetType="editors:ElementsEditor"> - <Setter Property="IsEditable" Value="True"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=listMode,Path=SelectedIndex}" Value="1"> - <Setter Property="IsEditable" Value="False"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </editors:ElementsEditor.Style> + <editors:ElementsEditor.Style> + <Style TargetType="editors:ElementsEditor"> + <Setter Property="IsEditable" Value="True"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=listMode,Path=SelectedIndex}" Value="1"> + <Setter Property="IsEditable" Value="False"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </editors:ElementsEditor.Style> - <editors:ElementsEditor.ContextMenu> - <ContextMenu DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}"> - <MenuItem Header="Cut (Ctrl+X)" Command="{Binding CutCommand}" MinWidth="210"> - <MenuItem.Icon> - <fa:ImageAwesome Icon="Cut" Width="16" /> - </MenuItem.Icon> - </MenuItem> - <MenuItem Header="Copy (Ctrl+C)" Command="{Binding CopyCommand}"> - <MenuItem.Icon> - <fa:ImageAwesome Icon="Copy" Width="16" /> - </MenuItem.Icon> - </MenuItem> - <MenuItem Header="Paste (Ctrl+V)" Command="{Binding PasteCommand}"> - <MenuItem.Icon> - <fa:ImageAwesome Icon="Paste" Width="16" /> - </MenuItem.Icon> - </MenuItem> - <Separator/> - <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding UndoCommand}"> - <MenuItem.Icon> - <fa:ImageAwesome Icon="Undo" Width="16" /> - </MenuItem.Icon> - </MenuItem> - <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding RedoCommand}"> - <MenuItem.Icon> - <fa:ImageAwesome Icon="RotateRight" Width="16"></fa:ImageAwesome> - </MenuItem.Icon> - </MenuItem> - <Separator/> - <MenuItem Header="Delete (DELETE)" Command="{Binding DeleteCommand}"> - <MenuItem.Icon> - <fa:ImageAwesome Icon="Recycle" Width="16" /> - </MenuItem.Icon> - </MenuItem> - <Separator/> - <MenuItem Header="Select All (Ctrl+A)" Command="{Binding SelectAllCommand}"> - <MenuItem.Icon> - <fa:ImageAwesome Icon="Th" Width="16" /> - </MenuItem.Icon> - </MenuItem> - </ContextMenu> - </editors:ElementsEditor.ContextMenu> - </editors:ElementsEditor> + <editors:ElementsEditor.ContextMenu> + <ContextMenu DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}"> + <MenuItem Header="Cut (Ctrl+X)" Command="{Binding CutCommand}" MinWidth="210"> + <MenuItem.Icon> + <fa:ImageAwesome Icon="Cut" Width="16" /> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="Copy (Ctrl+C)" Command="{Binding CopyCommand}"> + <MenuItem.Icon> + <fa:ImageAwesome Icon="Copy" Width="16" /> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="Paste (Ctrl+V)" Command="{Binding PasteCommand}"> + <MenuItem.Icon> + <fa:ImageAwesome Icon="Paste" Width="16" /> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding UndoCommand}"> + <MenuItem.Icon> + <fa:ImageAwesome Icon="Undo" Width="16" /> + </MenuItem.Icon> + </MenuItem> + <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding RedoCommand}"> + <MenuItem.Icon> + <fa:ImageAwesome Icon="RotateRight" Width="16"></fa:ImageAwesome> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="Delete (DELETE)" Command="{Binding DeleteCommand}"> + <MenuItem.Icon> + <fa:ImageAwesome Icon="Recycle" Width="16" /> + </MenuItem.Icon> + </MenuItem> + <Separator/> + <MenuItem Header="Select All (Ctrl+A)" Command="{Binding SelectAllCommand}"> + <MenuItem.Icon> + <fa:ImageAwesome Icon="Th" Width="16" /> + </MenuItem.Icon> + </MenuItem> + </ContextMenu> + </editors:ElementsEditor.ContextMenu> + </editors:ElementsEditor> - <Slider Grid.Column="1" Orientation="Vertical" Margin="5" Maximum="3" Minimum="0.2" Value="{Binding ElementName=editor,Path=ScaleFactor}"></Slider> - </Grid> + <Slider Grid.Column="1" Orientation="Vertical" Margin="5" Maximum="3" Minimum="0.2" Value="{Binding ElementName=editor,Path=ScaleFactor}"></Slider> + </Grid> + </Border> </DataTemplate> </UserControl.Resources> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs index 694debd26..e4ebe2424 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml.cs @@ -23,11 +23,14 @@ namespace Tango.MachineStudio.Technician.Views public partial class MachineTechView : UserControl { private MachineTechViewVM _vm; + private Dictionary<Border, UIElement> _tabs_content; public MachineTechView() { InitializeComponent(); + _tabs_content = new Dictionary<Border, UIElement>(); + this.Loaded += (x, y) => { _vm = DataContext as MachineTechViewVM; @@ -67,5 +70,22 @@ namespace Tango.MachineStudio.Technician.Views (editor.UndoRedoStatesProvider as ElementsEditorUndoRedoStatesProvider).StateExecuted += MachineTechView_StateExecuted; } + + private void Border_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) + { + Border border = sender as Border; + if (border.Visibility != Visibility.Visible) + { + _tabs_content[border] = border.Child; + border.Child = null; + } + else + { + if (_tabs_content.ContainsKey(border)) + { + border.Child = _tabs_content[border]; + } + } + } } } |
