|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <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>
|