aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlDeleteDialogView.xaml
blob: 7745848c1fd0060dde242613f481c8c3ae3e5fb8 (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
<UserControl x:Class="Tango.MachineStudio.RML.Views.RmlDeleteDialogView"
             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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels"
             xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
             xmlns:local="clr-namespace:Tango.MachineStudio.RML.Views"
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="700" Height="600" Width="900" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:RmlDeleteDialogViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource Dialog.Foreground}">

    <UserControl.Resources>
        <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
    </UserControl.Resources>
    
    <Grid Margin="10">
        <DockPanel>
            <Grid DockPanel.Dock="Top">
                <StackPanel Orientation="Horizontal">
                    <Grid>
                        <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource OrangeBrush}" Width="42" Height="42" />
                    </Grid>
                    <TextBlock Margin="20 0 0 0" VerticalAlignment="Center" FontSize="22">
                        <Run>DELETE</Run>
                        <Run></Run>
                        <Run Text="{Binding Rml.Name}"></Run>
                    </TextBlock>
                </StackPanel>
            </Grid>

            <Grid DockPanel.Dock="Bottom">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Bottom">
                    <Button Command="{Binding CloseCommand}" Width="140" Height="40" Margin="0 0 10 0">
                        CANCEL
                    </Button>
                    <Button Command="{Binding OKCommand}" IsDefault="True" Width="140" Height="40">
                        DELETE
                    </Button>
                </StackPanel>
            </Grid>

            <Grid>
                <DockPanel Margin="0 10 0 0">
                    <TextBlock DockPanel.Dock="Top" Margin="5">
                        <Run>The following jobs must be removed or change thread type before the selected thread can be deleted.</Run>
                    </TextBlock>
                    <DataGrid Margin="0 10 0 10" SelectionUnit="FullRow" SelectionMode="Single" ItemsSource="{Binding JobsActions}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="MACHINE" Width="Auto" Binding="{Binding Machine.SerialNumber}" IsReadOnly="True" />
                            <DataGridTextColumn Header="JOB" Width="200" Binding="{Binding Job.Name}" IsReadOnly="True" />
                            <DataGridComboBoxColumn Header="ACTION" Width="100" SelectedItemBinding="{Binding Action}">
                                <DataGridComboBoxColumn.ElementStyle>
                                    <Style TargetType="{x:Type ComboBox}">
                                        <Setter Property="ItemsSource" Value="{Binding Path=DataContext.Actions, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
                                    </Style>
                                </DataGridComboBoxColumn.ElementStyle>
                                <DataGridComboBoxColumn.EditingElementStyle>
                                    <Style TargetType="{x:Type ComboBox}">
                                        <Setter Property="ItemsSource" Value="{Binding Path=DataContext.Actions, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
                                    </Style>
                                </DataGridComboBoxColumn.EditingElementStyle>
                            </DataGridComboBoxColumn>
                            <DataGridComboBoxColumn Header="TARGET RML" SelectedItemBinding="{Binding TargetRml}" Width="1*" DisplayMemberPath="Name"> 
                                <DataGridComboBoxColumn.ElementStyle>
                                    <Style TargetType="{x:Type ComboBox}">
                                        <Setter Property="ItemsSource" Value="{Binding Path=DataContext.Rmls, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
                                    </Style>
                                </DataGridComboBoxColumn.ElementStyle>
                                <DataGridComboBoxColumn.EditingElementStyle>
                                    <Style TargetType="{x:Type ComboBox}">
                                        <Setter Property="ItemsSource" Value="{Binding Path=DataContext.Rmls, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
                                    </Style>
                                </DataGridComboBoxColumn.EditingElementStyle>
                            </DataGridComboBoxColumn>
                        </DataGrid.Columns>   
                    </DataGrid>
                </DockPanel>
            </Grid>
        </DockPanel>
    </Grid>
</UserControl>