PgMeMenu.xaml 17.9 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1
<Page x:Class="MultiLayout.MainEdit.PgMeMenu"
潘栩锋's avatar
潘栩锋 committed
2 3 4 5
      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" 
潘栩锋's avatar
潘栩锋 committed
6 7
      xmlns:local="clr-namespace:MultiLayout.MainEdit"
      xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
潘栩锋's avatar
潘栩锋 committed
8 9
      mc:Ignorable="d" 
      d:DesignHeight="768" d:DesignWidth="1024"
潘栩锋's avatar
潘栩锋 committed
10 11
      Title="PgMeMenu">

潘栩锋's avatar
潘栩锋 committed
12 13 14
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
潘栩锋's avatar
潘栩锋 committed
15
                <ResourceDictionary Source="pack://application:,,,/MultiLayout;component/Themes/Styles.xaml"/>
潘栩锋's avatar
潘栩锋 committed
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
            </ResourceDictionary.MergedDictionaries>




            <SolidColorBrush x:Key="Item.MouseOver.Background" Color="Transparent"/>
            <SolidColorBrush x:Key="Item.MouseOver.Foreground" Color="White"/>
            <SolidColorBrush x:Key="Item.MouseOver.Border" Color="Black"/>

            <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#FF3B3B3B"/>
            <SolidColorBrush x:Key="Item.SelectedInactive.Foreground" Color="White"/>
            <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="Black"/>

            <SolidColorBrush x:Key="Item.SelectedActive.Background" Color="White"/>
            <SolidColorBrush x:Key="Item.SelectedActive.Foreground" Color="Black"/>
            <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="Black"/>

            <Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
                <Setter Property="FocusVisualStyle">
                    <Setter.Value>
                        <Style>
                            <Setter Property="Control.Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Rectangle Margin="2" SnapsToDevicePixels="True" 
41
                                                   Stroke="{StaticResource {x:Static SystemColors.ControlTextBrushKey}}" 
潘栩锋's avatar
潘栩锋 committed
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
                                                   StrokeThickness="1" StrokeDashArray="1 2"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="FontSize" Value="30"/>
                <Setter Property="Foreground" Value="{StaticResource Item.SelectedInactive.Foreground}"/>
                <Setter Property="Background" Value="{StaticResource Item.SelectedInactive.Background}"/>
                <Setter Property="BorderBrush" Value="{StaticResource Item.SelectedInactive.Border}"/>
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Padding" Value="30,10"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid x:Name="templateRoot" SnapsToDevicePixels="True">
                                <Border x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Margin="0"/>

                                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" Focusable="False" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Background" Value="{StaticResource Item.MouseOver.Background}"/>
                                    <Setter Property="Foreground" Value="{StaticResource Item.MouseOver.Foreground}"/>
                                    <Setter Property="BorderBrush" Value="{StaticResource Item.MouseOver.Border}"/>
                                </MultiDataTrigger>

                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Background" Value="{StaticResource Item.SelectedInactive.Background}"/>
                                    <Setter Property="Foreground" Value="{StaticResource Item.SelectedInactive.Foreground}"/>
                                    <Setter Property="BorderBrush" Value="{StaticResource Item.SelectedInactive.Border}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Panel.ZIndex" Value="1"/>
                                    <Setter Property="Background" Value="{StaticResource Item.SelectedActive.Background}"/>
                                    <Setter Property="Foreground" Value="{StaticResource Item.SelectedActive.Foreground}"/>
                                    <Setter Property="BorderBrush" Value="{StaticResource Item.SelectedActive.Border}"/>
                                </MultiDataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="TabControlStyle_ABC" TargetType="{x:Type TabControl}">
                <Setter Property="Padding" Value="2"/>
                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="BorderThickness" Value="1"/>
102
                <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.ControlTextBrushKey}}"/>
潘栩锋's avatar
潘栩锋 committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabControl}">
                            <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="ColumnDefinition0"/>
                                    <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition x:Name="RowDefinition1" Height="*"/>
                                </Grid.RowDefinitions>
                                <TabPanel x:Name="headerPanel" VerticalAlignment="Bottom" Background="Transparent" Grid.Column="0" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
                                <Border x:Name="contentPanel" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
                                    <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="false">
122
                                    <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}"/>
潘栩锋's avatar
潘栩锋 committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


            <Style TargetType="Border" x:Key="BorderStyle_background">
                <Setter Property="Background" Value="White"/>
                <Setter Property="Margin" Value="3"/>
                <Setter Property="CornerRadius" Value="3"/>
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect Color="Black" Direction="270" ShadowDepth="1" Opacity="0.23" />
                    </Setter.Value>
                </Setter>
            </Style>
潘栩锋's avatar
潘栩锋 committed
141
            <Style TargetType="{x:Type Button}" x:Key="ButtonStyle_menu" >
潘栩锋's avatar
潘栩锋 committed
142 143 144 145 146 147 148
                <Setter Property="Height" Value="80"/>
                <Setter Property="Background" Value="White"/>
                <Setter Property="Content" Value="{Binding Type.Header}"/>
                <Setter Property="Padding" Value="3"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
潘栩锋's avatar
潘栩锋 committed
149 150 151 152 153 154 155
                            <ControlTemplate.Resources>
                                <ResourceDictionary>
                                    <Style TargetType="{x:Type TextBlock}">
                                        <Setter Property="Foreground" Value="White"/>
                                        <Setter Property="TextAlignment" Value="Center"/>
                                        <Setter Property="FontSize" Value="12"/>
                                        <Setter Property="FontWeight" Value="Bold"/>
潘栩锋's avatar
潘栩锋 committed
156
                                        <Setter Property="TextWrapping" Value="Wrap"/>
潘栩锋's avatar
潘栩锋 committed
157 158 159 160 161 162
                                    </Style>
                                </ResourceDictionary>
                            </ControlTemplate.Resources>
                            <Border Background="Transparent" >
                                <StackPanel Margin="5">
                                    <Rectangle Height="36" Width="36" Stroke="White" StrokeThickness="4"/>
潘栩锋's avatar
潘栩锋 committed
163
                                    <TextBlock Margin="3" Text="{TemplateBinding Content}" />
潘栩锋's avatar
潘栩锋 committed
164
                                </StackPanel>
潘栩锋's avatar
潘栩锋 committed
165 166 167 168 169 170 171 172 173 174 175 176 177
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
潘栩锋's avatar
潘栩锋 committed
178 179 180 181 182 183 184 185
            <Button Style="{StaticResource ButtonStyle_back}" Click="btnBackClick"/>
            <StackPanel Style="{StaticResource SpStyle_Header}">
                <TextBlock Text="主界面布局管理"/>
                <StackPanel>
                    <TextBlock Style="{StaticResource TextBlockStyle_SubHeader}" Text="{Binding Title}"/>
                    <TextBlock Style="{StaticResource TextBlockStyle_SubHeader}" Text="按钮区"/>
                </StackPanel>
            </StackPanel>
潘栩锋's avatar
潘栩锋 committed
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <ScrollViewer Width="200">
                <ItemsControl x:Name="itemsControl_toolbox">
                    <ItemsControl.Resources>

                    </ItemsControl.Resources>
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Style="{StaticResource ButtonStyle_empty}" Background="{Binding Background}" Tag="{Binding .}" Click="button_componentNew_Click" Margin="5" BorderBrush="#FF0C0C0C">
                                <StackPanel Orientation="Vertical" Margin="10">
                                    <TextBlock Text="{Binding Header}" FontSize="20" TextWrapping = "Wrap" />
                                    <TextBlock Text="{Binding Count}" FontSize="15" Margin="0,20,0,0"/>
                                </StackPanel>
                            </Button>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </ScrollViewer>
            <Grid Background="#bcbcbc" Grid.Column="1">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
潘栩锋's avatar
潘栩锋 committed
221
                <StackPanel x:Name="spMenu" Width="73" Background="#FF363636" >
潘栩锋's avatar
潘栩锋 committed
222
                    <StackPanel.Resources>
潘栩锋's avatar
潘栩锋 committed
223
                        <Style TargetType="Button" BasedOn="{StaticResource ButtonStyle_menu}"/>
潘栩锋's avatar
潘栩锋 committed
224
                    </StackPanel.Resources>
潘栩锋's avatar
潘栩锋 committed
225
                    <Button>
潘栩锋's avatar
潘栩锋 committed
226
                        测厚.扫描图12312123123
潘栩锋's avatar
潘栩锋 committed
227
                    </Button>
潘栩锋's avatar
潘栩锋 committed
228
                </StackPanel>
潘栩锋's avatar
潘栩锋 committed
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
                <Viewbox Grid.Column="1" Margin="5" MaxWidth="250" VerticalAlignment="Top" Opacity="0.5" >
                    <StackPanel Width="250" >
                        <StackPanel.Resources>
                            <Style TargetType="Border" x:Key="BorderStyle_background">
                                <Setter Property="Background" Value="White"/>
                                <Setter Property="Margin" Value="3"/>
                                <Setter Property="CornerRadius" Value="3"/>
                                <Setter Property="Effect">
                                    <Setter.Value>
                                        <DropShadowEffect Color="Black" Direction="270" ShadowDepth="1" Opacity="0.23" />
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </StackPanel.Resources>
                        <Border Style="{StaticResource BorderStyle_background}" >
潘栩锋's avatar
潘栩锋 committed
244 245 246 247 248
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition  />
                                    <RowDefinition Height="auto" />
                                </Grid.RowDefinitions>
潘栩锋's avatar
潘栩锋 committed
249
                                <Border Background="#FF45A6EA" CornerRadius="3" Height="100" />
潘栩锋's avatar
潘栩锋 committed
250 251
                                <StackPanel Grid.Row="1" Margin="2" Height="35"/>
                            </Grid>
潘栩锋's avatar
潘栩锋 committed
252 253 254 255
                        </Border>
                        <Border Style="{StaticResource BorderStyle_background}" Height="80"/>
                        <Border Style="{StaticResource BorderStyle_background}" Height="100"/>
                        <Border Style="{StaticResource BorderStyle_background}" Height="50"/>
潘栩锋's avatar
潘栩锋 committed
256 257
                    </StackPanel>
                </Viewbox>
潘栩锋's avatar
潘栩锋 committed
258
                <TabControl Grid.Column="2" FontSize="40" Margin="10" Style="{StaticResource TabControlStyle_ABC}" Opacity="0.5" IsEnabled="False">
潘栩锋's avatar
潘栩锋 committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
                    <TabControl.Resources>
                        <Style TargetType="Border" x:Key="BorderStyle_background">
                            <Setter Property="Background" Value="#FF7C7C7C"/>
                            <Setter Property="Margin" Value="10"/>
                            <Setter Property="CornerRadius" Value="3"/>
                            <Setter Property="Effect">
                                <Setter.Value>
                                    <DropShadowEffect Color="Black" Direction="270" ShadowDepth="1" Opacity="0.23" />
                                </Setter.Value>
                            </Setter>
                        </Style>

                    </TabControl.Resources>
                    <TabItem Header="□□□" Style="{StaticResource TabItemStyle1}" >
                        <Grid >
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Border Style="{StaticResource BorderStyle_background}"/>
                            <Border Grid.Row="1" Style="{StaticResource BorderStyle_background}"/>
                            <Border Grid.Row="2" Style="{StaticResource BorderStyle_background}"/>
                        </Grid>

                    </TabItem>
                    <TabItem Header="□□□" Style="{StaticResource TabItemStyle1}"/>
                    <TabItem Header="□□□" Style="{StaticResource TabItemStyle1}"/>
                </TabControl>
            </Grid>

        </Grid>
    </Grid>
</Page>