|
- <Window
- x:Class="BPASmart.ConfigurationSoftware.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmart.ConfigurationSoftware"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- Title="MainWindow"
- Width="800"
- Height="450"
- Topmost="False"
- WindowStartupLocation="CenterScreen"
- WindowState="Maximized"
- mc:Ignorable="d">
-
- <Window.DataContext>
- <local:MainWindowViewModel />
- </Window.DataContext>
-
- <Window.Resources>
-
- <!--#region 下拉列表单选按钮样式-->
- <Style x:Key="RadioMiniButtonStyle" TargetType="{x:Type RadioButton}">
- <Setter Property="Margin" Value="20,1,1,1" />
- <!--<Setter Property="Width" Value="160" />-->
- <!--<Setter Property="Height" Value="30" />-->
- <Setter Property="FontSize" Value="14" />
- <Setter Property="FontFamily" Value="粗体" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="left" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Background" Value="#ddd" />
- <Setter Property="HorizontalAlignment" Value="left" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RadioButton}">
- <Grid
- x:Name="templateRoot"
- Background="Transparent"
- SnapsToDevicePixels="True">
- <Border x:Name="border2" />
- <ContentPresenter
- x:Name="contentPresenter"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- Focusable="False"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
-
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="HasContent" Value="True">
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle
- Margin="14,0,0,0"
- SnapsToDevicePixels="True"
- Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="Padding" Value="4,-1,0,0" />
- </Trigger>
- <Trigger Property="IsChecked" Value="{x:Null}" />
-
- <Trigger Property="IsChecked" Value="true">
- <!--<Setter Property="Foreground" Value="White" />-->
- <Setter TargetName="border2" Property="Background" Value="red" />
- </Trigger>
-
- <Trigger Property="IsChecked" Value="false">
- <Setter TargetName="border2" Property="Background" Value="Transparent" />
- <!--<Setter Property="Foreground" Value="#4B8EC4" />-->
- </Trigger>
-
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsChecked" Value="false" />
- <Condition Property="IsMouseOver" Value="True" />
- </MultiTrigger.Conditions>
- <MultiTrigger.Setters>
- <Setter TargetName="border2" Property="Background" Value="#55007acc" />
- </MultiTrigger.Setters>
- </MultiTrigger>
-
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
-
- </Window.Resources>
-
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <StackPanel Orientation="Horizontal">
- <Button
- Width="60"
- Margin="5"
- Command="{Binding NewProjectCommand}"
- Content="新建" />
-
- <Button
- Width="60"
- Margin="5"
- Command="{Binding SaveProjectCommand}"
- Content="保存" />
-
- <Button
- Width="60"
- Margin="5"
- Command="{Binding OpenProjectCommand}"
- Content="打开" />
-
- <Button
- Width="60"
- Margin="5"
- Command="{Binding RunCommand}"
- Content="运行" />
-
- <Button
- Width="60"
- Margin="5"
- Command="{Binding GengrateCommand}"
- Content="生成" />
-
- <Button
- Width="60"
- Margin="5"
- Command="{Binding OpenVarManagerCommand}"
- Content="变量管理" />
- </StackPanel>
-
- <Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="150" />
- <ColumnDefinition Width="5" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <Border BorderBrush="Blue" BorderThickness="2">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="20" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <TextBlock
- Margin="5,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Text="{Binding Head}">
- <TextBlock.ContextMenu>
- <ContextMenu>
- <MenuItem Command="{Binding NewPageCommand}" Header="新建页面" />
- </ContextMenu>
- </TextBlock.ContextMenu>
- </TextBlock>
-
- <ScrollViewer
- Grid.Row="1"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
- <ItemsControl ItemsSource="{Binding Pages}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <RadioButton
- Command="{Binding DataContext.SelectedPageCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Content="{Binding}"
- GroupName="All"
- Style="{StaticResource RadioMiniButtonStyle}">
- <!--<RadioButton.ContextMenu>
- <ContextMenu ItemsSource="{Binding DataContext}">
- <MenuItem
- Command="{Binding DataContext.RemovePageCommand, RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=5, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Header="删除页面" />
- <MenuItem
- Command="{Binding DataContext.SetStartPageCommand,RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=5,Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Header="设为启动界面" />
- <MenuItem
- Command="{Binding DataContext.ReNameCommand, RelativeSource={RelativeSource AncestorType=Grid,AncestorLevel=5, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Header="重命名" />
- </ContextMenu>
- </RadioButton.ContextMenu>-->
- </RadioButton>
-
- <Grid.ContextMenu>
- <ContextMenu ItemsSource="{Binding DataContext}">
- <MenuItem
- Command="{Binding DataContext.RemovePageCommand, RelativeSource={RelativeSource AncestorType=ScrollViewer, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Header="删除页面" />
- <MenuItem
- Command="{Binding DataContext.SetStartPageCommand, RelativeSource={RelativeSource AncestorType=ScrollViewer, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Header="设为启动界面" />
- <MenuItem
- Command="{Binding DataContext.ReNameCommand, RelativeSource={RelativeSource AncestorType=ScrollViewer, Mode=FindAncestor}}"
- CommandParameter="{Binding}"
- Header="重命名" />
- </ContextMenu>
- </Grid.ContextMenu>
-
-
-
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </Border>
-
- <GridSplitter
- Grid.Row="2"
- Width="2"
- VerticalAlignment="Stretch"
- Background="Blue" />
-
- <Grid
- Name="gr"
- Grid.Row="1"
- Grid.Column="2"
- Background="Transparent">
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition />
- <RowDefinition Height="2" />
- <RowDefinition Height="100" />
- </Grid.RowDefinitions>
-
- <ContentControl
- Grid.Row="1"
- Width="auto"
- Height="auto"
- Margin="0,0,0,5"
- Content="{Binding MainContent}" />
-
-
-
- <Border
- Grid.Row="2"
- Grid.RowSpan="2"
- Margin="-7,0,0,0"
- BorderBrush="Blue"
- BorderThickness="2">
- <Grid Margin="5,5,0,0">
- <ScrollViewer>
- <ItemsControl ItemsSource="{Binding Message}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <TextBlock
- FontSize="16"
- Foreground="Blue"
- Text="{Binding}" />
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </Border>
-
- <GridSplitter
- Grid.Row="2"
- Height="2"
- HorizontalAlignment="Stretch"
- Background="Blue" />
-
-
- </Grid>
-
- </Grid>
-
-
-
- </Grid>
- </Window>
|