schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
<UserControl x:Class="XHandler.View.Tabletop.TabletopManagement"
             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:local="clr-namespace:XHandler.View.Tabletop"
             xmlns:str="clr-namespace:XHandler.Properties"
             xmlns:ctrls="clr-namespace:XHandler.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920" Loaded="UserControl_Loaded">
    <UserControl.Resources>
        <ContextMenu x:Key="tableLatticeMenu" x:Name="tableLatticeMenu" Width="150">
            <MenuItem x:Name="tableMenuSetTrash" Header="{x:Static str:Resources.strMenuSetTrash}" Click="tableMenuSetTrash_Click"/>
            <MenuItem x:Name="tableMenuSetUnTrash" Header="{x:Static str:Resources.strMenuSetUnTrash}" Click="tableMenuSetUnTrash_Click"/>
            <MenuItem x:Name="tableMenuDeleteLabware" Header="{x:Static str:Resources.strDelete}" Click="tableLatticeMenuDelete_Click"/>
        </ContextMenu>
        <ContextMenu x:Key="tabletopTemplateMenu" x:Name="tabletopTemplateMenu" Width="150">
            <MenuItem x:Name="tableMenuSetSystemAppTemplate" Header="{x:Static str:Resources.strSetSystemAppTabletopTemplate}" Click="tableMenuSetSystemAppTemplate_Click"/>
            <MenuItem x:Name="tableMenuSetSystemDefaultAppTemplate" Header="{x:Static str:Resources.strSetSystemDefaultAppTabletopTemplate}" Click="tableMenuSetSystemDefaultAppTemplate_Click"/>
            <MenuItem x:Name="tableMenuDeleteTabletopTemplate" Header="{x:Static str:Resources.strDelete}" Click="tableMenuDeleteTabletopTemplate_Click"/>
        </ContextMenu>
        <!--<Style TargetType="ListBoxItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Border Name="Border" 
                            Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}" 
                            Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="Stretch" 
                                          VerticalAlignment="Center" 
                                          ContentSource="Content" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter TargetName="Border" Property="Background" Value="Blue" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="Yellow" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="Background" Value="LightBlue" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>-->
    </UserControl.Resources>
    <Grid>
        <Border Background="Transparent" CornerRadius="0,10,10,0" Margin="0,0,10,0" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1000"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.8*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="1100"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="0">
                    <Border Background="White" CornerRadius="0,10,10,0" Margin="0,0,10,0">
                        <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"></RowDefinition>
                        <RowDefinition Height="*"></RowDefinition>
                    </Grid.RowDefinitions>
                    
                        <TextBlock Grid.Row="0" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" FontSize="20" FontWeight="Bold" Text="{x:Static str:Resources.strTabletopTemp}"></TextBlock>
                        <ListBox Grid.Row="1" x:Name="lbxTabletopList" Margin="5" SelectionChanged="lbxTabletopList_SelectionChanged" 
                                 ContextMenu="{StaticResource tabletopTemplateMenu}" SelectedValuePath="tabletopid">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Border Width="10" Height="10" Background="{Binding usestate, Converter={StaticResource boolToBackgroundConvert},Mode=TwoWay}" Tag="{Binding tabletopid}">
                                            </Border>
                                            <TextBlock Margin="20,0" Text="{Binding tabletopname}" Tag="{Binding tabletopid}"></TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                    </Grid>
                    </Border>
                </Grid>
                <Grid Grid.Column="1">
                    <Border Background="White" CornerRadius="10,10,0,0" Margin="0,0,10,0">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="40"></RowDefinition>
                                <RowDefinition Height="*"></RowDefinition>
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" FontSize="20" FontWeight="Bold" Text="{x:Static str:Resources.strTabletopLattice}"></TextBlock>
                            <ListView Grid.Row="1"  x:Name="lvConsumable"  Margin="5" BorderThickness="0"
                                  ItemsPanel="{DynamicResource NormalItemsPanel}" Background="White"
                                  ItemContainerStyle="{DynamicResource ConsumableListViewItemStyle}" ItemTemplate="{DynamicResource ShelfListViewItemDataTemplate}"
                                   ScrollViewer.VerticalScrollBarVisibility="Auto" 
                                 PreviewMouseDown="lvConsumable_PreviewMouseDown" PreviewMouseMove="lvConsumable_PreviewMouseMove"
                                 QueryContinueDrag="DoQueryContinueDrag"/>
                        </Grid>
                    </Border>
                </Grid>
                <Grid Grid.Column="2" Margin="10,0,10,0">
                    <Border CornerRadius="10"  VerticalAlignment="Top" Background="White">
                        <Grid >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="40"></RowDefinition>
                                <RowDefinition Height="*"></RowDefinition>
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" FontSize="20"  FontWeight="Black" Text="{x:Static str:Resources.strTabletopLatticeLayout}"></TextBlock>
                            <Button Grid.Row="0" x:Name="btnLeft" ToolTip="左对齐" Width="33" Content=""  Margin="0,0,220,0" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Right" Style="{DynamicResource ButtonIcon}" Click="btnLeft_Click">
                                <Button.Background>
                                    <ImageBrush ImageSource="../../Assets/left.PNG"/>
                                </Button.Background>
                            </Button>
                            <Button Grid.Row="0" x:Name="btnTop" ToolTip="顶部对齐" Width="33" Content=""  Margin="0,0,180,0" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Right" Style="{DynamicResource ButtonIcon}" Click="btnTop_Click">
                                <Button.Background>
                                    <ImageBrush ImageSource="../../Assets/top.png"/>
                                </Button.Background>
                            </Button>
                            <Button Grid.Row="0" x:Name="btnResetTabletop" Content="重置台面" Style="{DynamicResource LinkButton}" FontSize="18"
                                VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 10 20 0" Click="btnResetTabletop_Click" 
                                Foreground="{DynamicResource blueBrush}"/>
                            <Border x:Name="borderTable" Grid.Row="1" >
                                <Grid x:Name="gridBaseTabletop" Margin="0 0" MinHeight="300" MaxHeight="800" MinWidth="380" Width="580" VerticalAlignment="Top" HorizontalAlignment="Center" Background="Transparent">
                                    <ctrls:GraduatedCanvas Background="White"/>
                                    <Grid x:Name="gridTable" Margin="0 0" MinHeight="300" MaxHeight="800" MinWidth="380" Width="580" VerticalAlignment="Top" Background="Transparent" AllowDrop="True" Drop="gridTable_Drop"
                                          MouseLeftButtonUp="gridTable_MouseLeftButtonUp" MouseLeave="gridTable_MouseLeave" MouseLeftButtonDown="gridTable_MouseLeftButtonDown" PreviewMouseMove="gridTable_MouseMove"/>
                                           <!--   />-->
                                    <!--<Canvas x:Name="gridTable" Margin="0 0" MinHeight="600" MaxHeight="800" MinWidth="580" Width="580" VerticalAlignment="Top" Background="Black" MouseMove="gridTable_MouseMove" AllowDrop="True" Drop="gridTable_Drop"
                                          MouseLeftButtonUp="gridTable_MouseLeftButtonUp" Opacity="0.15"/>-->
                                </Grid>
                            </Border>
                            <!--<Grid x:Name="gdTest" Background="Yellow" Grid.Row="1" Width="500" Height="500" HorizontalAlignment="Left">
 
                            </Grid>-->
                        </Grid>
                    </Border>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</UserControl>