@@ -3128,13 +3128,13 @@ | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="Border" Property="Background" Value="#EA18659B"/> | |||
<Setter TargetName="Border" Property="BorderBrush" Value="#EA18659B"/> | |||
<Setter TargetName="Border" Property="Background" Value="#EA18979B"/> | |||
<Setter TargetName="Border" Property="BorderBrush" Value="#EA18979B"/> | |||
<Setter Property="Foreground" Value="#a2c2e8"/> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="False"> | |||
<Setter TargetName="Border" Property="Background" Value="Transparent"/> | |||
<Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/> | |||
<Setter TargetName="Border" Property="Background" Value="#EA18659B"/> | |||
<Setter TargetName="Border" Property="BorderBrush" Value="#EA18659B"/> | |||
<Setter Property="Foreground" Value="#a2c2e8"/> | |||
</Trigger> | |||
<Trigger Property="IsSelected" Value="true"> | |||
@@ -30,58 +30,68 @@ | |||
<!--左侧选择区域--> | |||
<TabControl SelectedIndex="0"> | |||
<TabItem Header="页面编辑"> | |||
<Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Background="Transparent" > | |||
<ListBox x:Name="PageList" Grid.Row="0" Margin="0,5,0,0" HorizontalAlignment="Center" SelectedItem="{Binding MenuModel.SelectPageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding MenuModel.pageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" ItemTemplate="{DynamicResource PageBoxStyle}" FontSize="14" BorderThickness="0" > | |||
<ListBox.ContextMenu> | |||
<ContextMenu> | |||
<MenuItem Header="增加一页" Command="{Binding AddPageCommand}" CommandParameter="{Binding MenuModel.SelectPageModels}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Add" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="设置首页" Command="{Binding SetHomePageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Home" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="向上移动" Command="{Binding SetTopPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Upload" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="向下移动" Command="{Binding SetBottomPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Download" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="删除该页" Command="{Binding DeletePageCommand}" CommandParameter="{Binding MenuModel.SelectPageModels}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Delete" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="(加载)页面" Command="{Binding LoadAllPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="(保存)页面" Command="{Binding SaveAllPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Save" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="变量管理器" Command="{Binding LoadValuesCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
</ContextMenu> | |||
</ListBox.ContextMenu> | |||
</ListBox> | |||
</Border> | |||
<Border BorderThickness="1" BorderBrush="#FFA9A9A9" Background="Transparent" > | |||
<Grid > | |||
<ListBox x:Name="PageList" | |||
ItemContainerStyle="{StaticResource ItemContainerStyle1}" Grid.Row="0" Margin="0,5,0,0" | |||
HorizontalAlignment="Center" | |||
SelectedItem="{Binding MenuModel.SelectPageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
ItemsSource="{Binding MenuModel.pageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" | |||
Background="Transparent" | |||
ScrollViewer.VerticalScrollBarVisibility="Auto" | |||
ItemTemplate="{DynamicResource PageBoxStyle}" | |||
FontSize="14" BorderThickness="0" > | |||
<ListBox.ContextMenu> | |||
<ContextMenu> | |||
<MenuItem Header="增加一页" Command="{Binding AddPageCommand}" CommandParameter="{Binding MenuModel.SelectPageModels}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Add" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="设置首页" Command="{Binding SetHomePageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Home" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="向上移动" Command="{Binding SetTopPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Upload" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="向下移动" Command="{Binding SetBottomPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Download" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="删除该页" Command="{Binding DeletePageCommand}" CommandParameter="{Binding MenuModel.SelectPageModels}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Delete" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="(加载)页面" Command="{Binding LoadAllPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="(保存)页面" Command="{Binding SaveAllPageCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Save" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
<MenuItem Header="变量管理器" Command="{Binding LoadValuesCommand}"> | |||
<MenuItem.Icon> | |||
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" /> | |||
</MenuItem.Icon> | |||
</MenuItem> | |||
</ContextMenu> | |||
</ListBox.ContextMenu> | |||
</ListBox> | |||
</Grid> | |||
</Border> | |||
</TabItem> | |||
<TabItem Header="组件列表"> | |||
<Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Background="Transparent"> | |||
<Border BorderThickness="1" BorderBrush="#FFA9A9A9" Background="Transparent"> | |||
<ListBox x:Name="CtlList" Grid.Row="2" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" | |||
ItemTemplate="{DynamicResource ToolBoxStyle}" FontSize="14" BorderThickness="0" | |||
PreviewMouseMove="CtlList_PreviewMouseMove" | |||
@@ -90,7 +100,7 @@ | |||
</TabItem> | |||
<TabItem Header="菜单布局"> | |||
<Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Background="Transparent"> | |||
<Border BorderThickness="1" BorderBrush="#FFA9A9A9" Background="Transparent"> | |||
<mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True" | |||
FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False" | |||
AutoGenerateProperties="False" | |||
@@ -20,7 +20,7 @@ | |||
</Border> | |||
<StackPanel x:Name="waibustack" Orientation="Horizontal" MouseMove="wrapanl_main_MouseMove" MouseLeave="wrapanl_main_MouseLeave" > | |||
<StackPanel x:Name="waibustack" Cursor="Hand" Orientation="Horizontal" MouseMove="wrapanl_main_MouseMove" MouseLeave="wrapanl_main_MouseLeave" > | |||
<Grid Style="{DynamicResource image矩阵框1}" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Stretch" x:Name="wrapanl_main" > | |||
<TextBlock x:Name="TitleName" FontWeight="Bold" Style="{DynamicResource imageTextBlock}" Padding="10" FontSize="18" TextWrapping="Wrap" MaxWidth="118" HorizontalAlignment="Center" VerticalAlignment="Top" Text="{Binding MenuModel.Name}" FontFamily="{DynamicResource Digital}"> | |||
<TextBlock.Foreground> | |||
@@ -70,7 +70,7 @@ | |||
<GradientStop Color="Transparent" Offset="1"/> | |||
</LinearGradientBrush> | |||
</Border.BorderBrush> | |||
<Image x:Name="lachuStyle" Style="{DynamicResource image右1}" Width="70" Height="30"></Image> | |||
<Image x:Name="lachuStyle" Style="{DynamicResource image右1}" Cursor="Hand" Width="70" Height="30"></Image> | |||
</Border> | |||
</StackPanel> | |||
</Grid> | |||
@@ -352,7 +352,7 @@ namespace BeDesignerSCADA.Controls | |||
DoubleAnimation da = new DoubleAnimation(); | |||
da.From = menuWidthDefault; | |||
da.To = menuWidth; | |||
da.Duration = TimeSpan.FromSeconds(0.2); | |||
da.Duration = TimeSpan.FromSeconds(0.1); | |||
if (menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.左边 || menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.右边) | |||
{ | |||
wrapanl_main.BeginAnimation(WidthProperty, da); | |||
@@ -365,16 +365,13 @@ namespace BeDesignerSCADA.Controls | |||
if (languageResDic.Contains("image右1")) | |||
lachuStyle.Style = languageResDic["image右1"] as Style; | |||
} | |||
} | |||
private void MenuSmall() | |||
{ | |||
DoubleAnimation da = new DoubleAnimation(); | |||
da.From = menuWidth; | |||
da.To = menuWidthDefault; | |||
da.Duration = TimeSpan.FromSeconds(0.2); | |||
da.Duration = TimeSpan.FromSeconds(0.1); | |||
if (menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.左边 || menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.右边) | |||
{ | |||
if (languageResDic.Contains("image右1")) | |||
@@ -198,54 +198,64 @@ | |||
<!--#region 其他--> | |||
<DataTemplate x:Key="PageBoxStyle"> | |||
<Button x:Name="dsd" Background="Transparent" BorderBrush="DarkBlue" CommandParameter="{Binding .}" Command="{Binding DataContext.SelectPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"> | |||
<Grid x:Name="mains" Margin="2"> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="../Images/bj.png" Stretch="UniformToFill"/> | |||
</Grid.Background> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="auto"/> | |||
<RowDefinition Height="auto"/> | |||
</Grid.RowDefinitions> | |||
<Rectangle Height="100" Width="200" Stroke="Cyan" StrokeThickness="1"> | |||
<Rectangle.Fill> | |||
<VisualBrush Visual="{Binding visual,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> | |||
</Rectangle.Fill> | |||
</Rectangle> | |||
<StackPanel Grid.Row="1" Orientation="Horizontal"> | |||
<icon:PackIconModern x:Name="Sort" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,5,0" Foreground="#FFFFA500" Kind="Page" /> | |||
<TextBlock FontWeight="Bold" Margin="5,0,0,0" FontSize="14" Foreground="#FFFFA500" | |||
<Button x:Name="dsd" Background="#4818659B" BorderBrush="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.SelectPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"> | |||
<Button.Template> | |||
<ControlTemplate> | |||
<Grid x:Name="mains" Margin="0"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="auto"/> | |||
<RowDefinition Height="auto"/> | |||
</Grid.RowDefinitions> | |||
<Grid> | |||
<Grid.Background> | |||
<ImageBrush ImageSource="../Images/bj.png" Stretch="UniformToFill"/> | |||
</Grid.Background> | |||
</Grid> | |||
<Grid Grid.Row="1" Background="#010AA74D"> | |||
</Grid> | |||
<Rectangle Height="100" Width="200" StrokeThickness="0"> | |||
<Rectangle.Fill> | |||
<VisualBrush Visual="{Binding visual,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> | |||
</Rectangle.Fill> | |||
</Rectangle> | |||
<StackPanel Grid.Row="1" Orientation="Horizontal"> | |||
<icon:PackIconModern x:Name="Sort" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,5,0" Foreground="White" Kind="Page" /> | |||
<TextBlock Margin="5,0,0,0" FontSize="12" Foreground="White" | |||
x:Name="txt" | |||
Grid.Column="1" | |||
Grid.Column="1" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Bottom" | |||
Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> | |||
</StackPanel> | |||
<StackPanel x:Name="stack" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0"> | |||
<Button Width="24" Cursor="Hand" BorderBrush="Transparent" Background="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.AddPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" Padding="0" Margin="0,0,0,0" ToolTip="增加页"> | |||
<icon:PackIconModern ToolTip="增加页" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FFFFA500" Kind="Add" /> | |||
</Button> | |||
<Button Width="24" Cursor="Hand" BorderBrush="Transparent" Background="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.DeletePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" VerticalAlignment="Center" Padding="0" ToolTip="删除页"> | |||
<icon:PackIconModern ToolTip="删除页" Width="10" HorizontalAlignment="Center" Foreground="#FFFFA500" Kind="Delete" /> | |||
</Button> | |||
</StackPanel> | |||
</Grid> | |||
</StackPanel> | |||
<StackPanel x:Name="stack" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0"> | |||
<Button Width="24" Cursor="Hand" BorderBrush="Transparent" Background="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.AddPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" Padding="0" Margin="0,0,0,0" ToolTip="增加页"> | |||
<icon:PackIconModern ToolTip="增加页" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Kind="Add" /> | |||
</Button> | |||
<Button Width="24" Cursor="Hand" BorderBrush="Transparent" Background="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.DeletePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" VerticalAlignment="Center" Padding="0" ToolTip="删除页"> | |||
<icon:PackIconModern ToolTip="删除页" Width="10" HorizontalAlignment="Center" Foreground="White" Kind="Delete" /> | |||
</Button> | |||
</StackPanel> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter Property="Visibility" Value="Visible" TargetName="stack"></Setter> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="false"> | |||
<Setter Property="Visibility" Value="Collapsed" TargetName="stack"></Setter> | |||
</Trigger> | |||
<DataTrigger Binding="{Binding IsHome,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Value="True"> | |||
<Setter TargetName="Sort" Property="Kind" Value="Home" /> | |||
</DataTrigger> | |||
<DataTrigger Binding="{Binding IsHome,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Value="False"> | |||
<Setter TargetName="Sort" Property="Kind" Value="Page" /> | |||
</DataTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Button.Template> | |||
</Button> | |||
<DataTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter Property="Visibility" Value="Visible" TargetName="stack"></Setter> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="false"> | |||
<Setter Property="Visibility" Value="Collapsed" TargetName="stack"></Setter> | |||
</Trigger> | |||
<DataTrigger Binding="{Binding IsHome,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Value="True"> | |||
<Setter TargetName="Sort" Property="Kind" Value="Home" /> | |||
</DataTrigger> | |||
<DataTrigger Binding="{Binding IsHome,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Value="False"> | |||
<Setter TargetName="Sort" Property="Kind" Value="Page" /> | |||
</DataTrigger> | |||
</DataTemplate.Triggers> | |||
</DataTemplate> | |||
<DataTemplate x:Key="ToolBoxStyle"> | |||
@@ -610,7 +610,10 @@ namespace BeDesignerSCADA.ViewModel | |||
par.visual.Children.Add(item); | |||
}); | |||
}); | |||
if (MenuModel.pageModels != null && MenuModel.pageModels.Count > 0) | |||
{ | |||
SelectPageHeader(MenuModel.pageModels?.ToList()?[0]); | |||
} | |||
} | |||
} | |||
catch (Exception ex) | |||