Bläddra i källkod

更新可视化控件显示列表

样式分支
fyf 2 år sedan
förälder
incheckning
173b24adde
15 ändrade filer med 520 tillägg och 67 borttagningar
  1. +24
    -0
      BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
  2. +48
    -0
      BPASmartClient.SCADAControl/CustomerControls/DateTimeUI.xaml
  3. +56
    -0
      BPASmartClient.SCADAControl/CustomerControls/DateTimeUI.xaml.cs
  4. Binär
     
  5. Binär
     
  6. Binär
     
  7. Binär
     
  8. Binär
     
  9. Binär
     
  10. +179
    -25
      BPASmartClient.SCADAControl/Themes/Generic.xaml
  11. +11
    -6
      BeDesignerSCADA/Controls/CanvasPanelNew.xaml
  12. +48
    -10
      BeDesignerSCADA/Controls/MenuRunCanvas.xaml
  13. +136
    -24
      BeDesignerSCADA/Controls/MenuRunCanvas.xaml.cs
  14. +1
    -0
      BeDesignerSCADA/View/RunWindows.xaml
  15. +17
    -2
      BeDesignerSCADA/View/RunWindows.xaml.cs

+ 24
- 0
BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj Visa fil

@@ -9,7 +9,9 @@

<ItemGroup>
<None Remove="Fonts\ds-digib.ttf" />
<None Remove="Fonts\Quartz Regular.ttf" />
<None Remove="Images\03.png" />
<None Remove="Images\1.png" />
<None Remove="Images\2609.png" />
<None Remove="Images\api.png" />
<None Remove="Images\biogebj.png" />
@@ -50,9 +52,13 @@
<None Remove="Images\左2.png" />
<None Remove="Images\拉出.png" />
<None Remove="Images\收缩.png" />
<None Remove="Images\日期1.png" />
<None Remove="Images\矩形边框.png" />
<None Remove="Images\矩形边框1.png" />
<None Remove="Images\系统名称.png" />
<None Remove="Images\返回按钮1.png" />
<None Remove="Images\返回按钮2.png" />
<None Remove="Images\返回按钮图标.png" />
<None Remove="Images\退出.png" />
<None Remove="Images\顶部线条.png" />
</ItemGroup>
@@ -85,9 +91,15 @@

<ItemGroup>
<Resource Include="Fonts\ds-digib.ttf" />
<Resource Include="Fonts\Quartz Regular.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\03.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\2609.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
@@ -208,6 +220,9 @@
<Resource Include="Images\收缩.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\日期1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\矩形边框.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
@@ -217,6 +232,15 @@
<Resource Include="Images\系统名称.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\返回按钮1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\返回按钮2.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\返回按钮图标.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\退出.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>


+ 48
- 0
BPASmartClient.SCADAControl/CustomerControls/DateTimeUI.xaml Visa fil

@@ -0,0 +1,48 @@
<UserControl x:Class="BPASmartClient.SCADAControl.CustomerControls.DateTimeUI"
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:BPASmartClient.SCADAControl.CustomerControls"
mc:Ignorable="d"
x:Name="main"
d:DesignHeight="30" d:DesignWidth="100">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.SCADAControl;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<TextBlock
x:Name="time"
FontFamily="../Fonts/#Quartz M"
FontSize="16" Foreground="{Binding Foreground, ElementName=main}">
14:48:30
</TextBlock>
<Image Margin="10,0,0,0" Style="{DynamicResource timeImage}" />
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock
x:Name="dateRL" Foreground="{Binding Foreground, ElementName=main}"
FontFamily="../Fonts/#Quartz M"
FontSize="10">
星期一
</TextBlock>

<TextBlock
x:Name="date"
Margin="10,0,0,0" Foreground="{Binding Foreground, ElementName=main}"
FontFamily="../Fonts/#Quartz M"
FontSize="10">
2021-11-13
</TextBlock>
</StackPanel>
</Grid>
</UserControl>

+ 56
- 0
BPASmartClient.SCADAControl/CustomerControls/DateTimeUI.xaml.cs Visa fil

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BPASmartClient.SCADAControl.CustomerControls
{
/// <summary>
/// DateTimeUI.xaml 的交互逻辑
/// </summary>
public partial class DateTimeUI : UserControl
{
public DateTimeUI()
{
InitializeComponent();
Task.Run(new Action(() =>
{
while (true)
{
this.Dispatcher.Invoke(new Action(() =>
{
time.Text = DateTime.Now.ToString("HH:mm:ss");
date.Text = DateTime.Now.ToString("yyyy-MM-dd");
if (DateTime.Now.DayOfWeek == DayOfWeek.Monday)
dateRL.Text = "星期一";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Tuesday)
dateRL.Text = "星期二";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday)
dateRL.Text = "星期三";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Thursday)
dateRL.Text = "星期四";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
dateRL.Text = "星期五";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
dateRL.Text = "星期六";
else if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
dateRL.Text = "星期天";

}));
Thread.Sleep(500);
}
}));
}
}
}

Binär
Visa fil


Binär
Visa fil


Binär
Visa fil


Binär
Visa fil


Binär
Visa fil


Binär
Visa fil


+ 179
- 25
BPASmartClient.SCADAControl/Themes/Generic.xaml Visa fil

@@ -3065,35 +3065,40 @@

<DataTemplate x:Key="X_PageBoxStyle">
<Button x:Name="dsd" HorizontalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" CommandParameter="{Binding .}" Command="{Binding DataContext.MenSelectPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Height="50" Width="100" >
<Grid.Background>
<ImageBrush ImageSource="../Images/bj.png" Stretch="UniformToFill"/>
</Grid.Background>
</Grid>
<Rectangle Height="50" Width="100" Stroke="CadetBlue" StrokeThickness="1">
<Rectangle.Fill>
<VisualBrush Visual="{Binding visual,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</Rectangle.Fill>
</Rectangle>
<Rectangle Width="100" Height="20" Grid.Row="1" Fill="Transparent" Stroke="CadetBlue" StrokeThickness="1,0,1,1"/>
<TextBlock FontWeight="Bold" Margin="5,0,0,0" FontSize="14" Foreground="#FFFFA500"
<Button.Template>
<ControlTemplate>
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid Height="50" Width="100" >
<Grid.Background>
<ImageBrush ImageSource="../Images/bj.png" Stretch="UniformToFill"/>
</Grid.Background>
</Grid>
<Rectangle Height="50" Width="100" Stroke="#4818659B" StrokeThickness="1">
<Rectangle.Fill>
<VisualBrush Visual="{Binding visual,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</Rectangle.Fill>
</Rectangle>
<Rectangle Width="100" Height="20" Grid.Row="1" Fill="Transparent" Stroke="#4818659B" StrokeThickness="1,0,1,1"/>
<TextBlock FontWeight="Normal" Margin="5,0,0,0" FontSize="12" Foreground="#a2c2e8"
x:Name="txt"
Grid.Row="2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
VerticalAlignment="Center"
FontFamily="../Fonts/#Quartz M"
Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />

<TextBlock FontWeight="Bold" Margin="5,0,5,0" FontSize="14" Foreground="#FFFFA500"
<TextBlock FontWeight="Bold" Margin="5,0,5,0" FontSize="8" Foreground="{TemplateBinding Foreground}"
Grid.Row="2"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
VerticalAlignment="Bottom" Visibility="Collapsed"
Text="{Binding Sort,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</Grid>
</ControlTemplate>
</Button.Template>
</Button>

@@ -3103,7 +3108,49 @@
</DataTemplate>


<Style x:Key="ItemContainerStyle1" TargetType="ListBoxItem">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Border"
Margin="5"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="1"
SnapsToDevicePixels="True">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Background" Value="#EA18659B"/>
<Setter TargetName="Border" Property="BorderBrush" Value="#EA18659B"/>
<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 Property="Foreground" Value="#a2c2e8"/>
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="Border" Property="Background" Value="#EA18979B"/>
<Setter TargetName="Border" Property="BorderBrush" Value="#EA18979B"/>
<Setter Property="Foreground" Value="#a2c2e8"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="LightGray"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!--#endregion-->
<Style x:Key="image矩阵框" TargetType="Image">
<Style.Setters>
@@ -3121,8 +3168,7 @@
</Style.Setters>
</Style>


<Style x:Key="image矩阵框1" TargetType="WrapPanel">
<Style x:Key="image矩阵框1" TargetType="Grid">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
@@ -3162,7 +3208,6 @@
</Style.Setters>
</Style>


<Style x:Key="image右1" TargetType="Image">
<Style.Setters>
<Setter Property="VerticalAlignment" Value="Stretch" />
@@ -3195,4 +3240,113 @@
</Style.Setters>
</Style>

<Style x:Key="borderSplider" TargetType="Border">
<Style.Setters>
<Setter Property="Height" Value="1" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="../Images/1.png" ></ImageBrush>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="CommonBtn_返回" TargetType="Button">
<Style.Setters>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="{DynamicResource ButtonSelectForeground}" />
<Setter Property="Width" Value="68" />
<Setter Property="Height" Value="25" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="BD" Cursor="Hand">
<StackPanel
Margin="5,0,10,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Border Width="16" Margin="5">
<Border.Background>
<ImageBrush ImageSource="../Images/返回按钮图标.png" />
</Border.Background>
</Border>
<TextBlock
x:Name="textBlock"
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource ButtonSelectForeground}"
Text="{TemplateBinding Content}" />
<!-- Text="{TemplateBinding Content}" -->
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="BD" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="../Images/返回按钮2.png" />
</Setter.Value>
</Setter>
<Setter TargetName="textBlock" Property="Foreground" Value="{DynamicResource ButtonSelectForeground}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter TargetName="BD" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="../Images/返回按钮1.png" />
</Setter.Value>
</Setter>
<Setter TargetName="textBlock" Property="Foreground" Value="{DynamicResource ButtonSelectForeground}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="BD" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="../Images/返回按钮1.png" />
</Setter.Value>
</Setter>
<Setter TargetName="textBlock" Property="Foreground" Value="{DynamicResource ButtonUnSelectForeground}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="BtnNull" TargetType="Button">
<Style.Setters>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonSelectForeground}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="BD" Cursor="Hand"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="BD" Property="Background" Value="Transparent"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter TargetName="BD" Property="Background" Value="Transparent"/>

</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="BD" Property="Background" Value="Transparent"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="timeImage" TargetType="Image">
<Style.Setters>
<Setter Property="Width" Value="20" />
<Setter Property="Source" Value="../Images/日期1.png" />
</Style.Setters>
</Style>

</ResourceDictionary>

+ 11
- 6
BeDesignerSCADA/Controls/CanvasPanelNew.xaml Visa fil

@@ -34,6 +34,11 @@
<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" />
@@ -49,22 +54,22 @@
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Download" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="删除该页" Command="{Binding DeletePageCommand}">
<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 SaveAllPageCommand}">
<MenuItem Header="(加载)页面" Command="{Binding LoadAllPageCommand}">
<MenuItem.Icon>
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Save" />
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="加载页面文件" Command="{Binding LoadAllPageCommand}">
<MenuItem Header="(保存)页面" Command="{Binding SaveAllPageCommand}">
<MenuItem.Icon>
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" />
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Save" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="加载变量文件" Command="{Binding LoadValuesCommand}">
<MenuItem Header="变量管理器" Command="{Binding LoadValuesCommand}">
<MenuItem.Icon>
<icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" />
</MenuItem.Icon>


+ 48
- 10
BeDesignerSCADA/Controls/MenuRunCanvas.xaml Visa fil

@@ -4,6 +4,7 @@
xmlns:con="clr-namespace:BeDesignerSCADA.Converters"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="clr-namespace:BPASmartClient.SCADAControl.CustomerControls;assembly=BPASmartClient.SCADAControl"
xmlns:local="clr-namespace:BeDesignerSCADA.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
@@ -16,22 +17,59 @@
</UserControl.Resources>
<Grid>
<Border x:Name="main" >
</Border>

<StackPanel x:Name="waibustack" Orientation="Horizontal" MouseMove="wrapanl_main_MouseMove" MouseLeave="wrapanl_main_MouseLeave" >
<WrapPanel Style="{DynamicResource image矩阵框1}" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Stretch" x:Name="wrapanl_main" Orientation="Vertical">
<TextBlock x:Name="TitleName" Style="{DynamicResource imageTextBlock}" Padding="10" Foreground="#FFFFA500" FontSize="18" TextWrapping="Wrap" MaxWidth="118" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding MenuModel.Name}" FontFamily="{DynamicResource Digital}"></TextBlock>
<ListBox x:Name="PageList" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Bottom"
SelectedItem="{Binding MenuModel.SelectPageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding MenuModel.pageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Background="Transparent"
<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>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF08A1E0"/>
<GradientStop Color="#FF08A1E0" Offset="0.25"/>
<GradientStop Color="#FF08A1E0" Offset="0.5"/>
<GradientStop Color="#FF7FCEEF" Offset="0.75"/>
<GradientStop Color="#FF08A1E0" Offset="1"/>
</LinearGradientBrush>
</TextBlock.Foreground>
</TextBlock>
<Border x:Name="border0" Margin="0,60,0,0" Style="{DynamicResource borderSplider}"></Border>
<ListBox x:Name="PageList" Margin="0,60,0,100" Padding="10,0,0,0" BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Top"
SelectedItem="{Binding MenuModel.SelectPageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding MenuModel.pageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Background="Transparent"
ItemContainerStyle="{StaticResource ItemContainerStyle1}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ItemTemplate="{DynamicResource X_PageBoxStyle}" FontSize="14" BorderThickness="0" >
ItemTemplate="{DynamicResource X_PageBoxStyle}" >
</ListBox>
</WrapPanel>
<Border x:Name="lachu" Background="Transparent" Width="30" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,0,0,25" BorderBrush="Aqua" BorderThickness="0,0,1,0">

<Border x:Name="border1" Margin="0,0,0,80" VerticalAlignment="Bottom" Style="{DynamicResource borderSplider}"/>
<StackPanel x:Name="closeGrid" Height="80" Background="Transparent" Margin="0,0,0,0" Width="100" VerticalAlignment="Bottom" HorizontalAlignment="Center">
<controls:DateTimeUI Foreground="#a2c2e8" HorizontalAlignment="Center" Margin="5,5,5,5"></controls:DateTimeUI>
<Border x:Name="border2" Style="{DynamicResource borderSplider}"></Border>
<Button
x:Name="ButClose"
Margin="0,5,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Content="退出程序"
Cursor="Hand"
Width="90"
Style="{DynamicResource CommonBtn_返回}"
ToolTip="退出程序" />
</StackPanel>
</Grid>
<Border x:Name="lachu" Background="Transparent" Width="30" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,0,0,25" BorderThickness="1,0,0,0">
<Border.BorderBrush>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Transparent"/>
<GradientStop Color="#FF21B7B7" Offset="0.25"/>
<GradientStop Color="Aqua" Offset="0.5"/>
<GradientStop Color="#FF21B7B7" Offset="0.75"/>
<GradientStop Color="Transparent" Offset="1"/>
</LinearGradientBrush>
</Border.BorderBrush>
<Image x:Name="lachuStyle" Style="{DynamicResource image右1}" Width="70" Height="30"></Image>
</Border>
</StackPanel>


+ 136
- 24
BeDesignerSCADA/Controls/MenuRunCanvas.xaml.cs Visa fil

@@ -83,7 +83,6 @@ namespace BeDesignerSCADA.Controls
{
RunMenu(BinaryFile.ReadBinary<MenuModel>(path) as MenuModel);
}

/// <summary>
/// 运行菜单
/// </summary>
@@ -95,70 +94,156 @@ namespace BeDesignerSCADA.Controls
switch (canvas.Alignment)
{
case MenuAlignment.左边:
PageList.HorizontalAlignment = HorizontalAlignment.Left;
int k = (canvas.Name.Length / 5 -1+ (canvas.Name.Length % 5 > 0 ? 1 : 0))*15;
//左边菜单栏
PageList.HorizontalAlignment = HorizontalAlignment.Stretch;
PageList.VerticalAlignment = VerticalAlignment.Top;
PageList.Margin = new Thickness(10,70+ k, 10,110);
PageList.Padding = new Thickness(0,0,0,0);
_StackPanel.SetValue(StackPanel.OrientationProperty, Orientation.Vertical);
wrapanl_main.Orientation = Orientation.Vertical;
//标题栏
TitleName.Margin = new Thickness(0, 10, 0, 10);
TitleName.HorizontalAlignment = HorizontalAlignment.Stretch;
TitleName.VerticalAlignment = VerticalAlignment.Top;
border0.Margin = new Thickness(0, 60+k, 0, 0);
border0.LayoutTransform = new RotateTransform() { Angle = 0 };
border0.HorizontalAlignment = HorizontalAlignment.Stretch;
border0.VerticalAlignment = VerticalAlignment.Top;
border1.Margin = new Thickness(0, 0, 0, 100);
border1.LayoutTransform = new RotateTransform() { Angle = 0 };
border1.HorizontalAlignment = HorizontalAlignment.Stretch;
border1.VerticalAlignment = VerticalAlignment.Bottom;
//内部Grid
wrapanl_main.HorizontalAlignment = HorizontalAlignment.Left;
wrapanl_main.VerticalAlignment = VerticalAlignment.Stretch;
wrapanl_main.Margin = new Thickness(0, 0, 0, 25);
TitleName.Margin = new Thickness(0, 10, 0, 10);
//外部Stackpanl
waibustack.Orientation = Orientation.Horizontal;
waibustack.HorizontalAlignment = HorizontalAlignment.Left;
//拉出按钮
lachu.HorizontalAlignment = HorizontalAlignment.Left;
lachu.VerticalAlignment = VerticalAlignment.Stretch;
lachu.BorderThickness = new Thickness(1, 0, 0, 0);
//closeGrid
closeGrid.HorizontalAlignment = HorizontalAlignment.Center;
closeGrid.VerticalAlignment = VerticalAlignment.Bottom;
closeGrid.Margin = new Thickness(10);
ButClose.Margin = new Thickness(0, 5, 0, 0);
break;
case MenuAlignment.顶部:
PageList.HorizontalAlignment = HorizontalAlignment.Left;
//左边菜单栏
PageList.HorizontalAlignment = HorizontalAlignment.Stretch;
PageList.VerticalAlignment = VerticalAlignment.Top;
PageList.Margin = new Thickness(140,0 , 120, 0);
PageList.Padding = new Thickness(0, 0, 0, 0);
_StackPanel.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal);
wrapanl_main.Orientation = Orientation.Horizontal;
//标题栏
TitleName.LayoutTransform = new RotateTransform() { Angle = 0 };
TitleName.Margin = new Thickness(10, 10, 10, 10);
TitleName.HorizontalAlignment = HorizontalAlignment.Left;
TitleName.VerticalAlignment = VerticalAlignment.Center;
TitleName.Width = 110;
border0.Margin = new Thickness(130, 0, 0, 0);
border0.HorizontalAlignment = HorizontalAlignment.Left;
border0.VerticalAlignment = VerticalAlignment.Stretch;
border0.LayoutTransform = new RotateTransform() { Angle = 90 };
border1.Margin = new Thickness(0, 0, 110,0 );
border1.HorizontalAlignment = HorizontalAlignment.Right;
border1.VerticalAlignment = VerticalAlignment.Stretch;
border1.LayoutTransform = new RotateTransform() { Angle = 90 };
//内部Grid
wrapanl_main.HorizontalAlignment = HorizontalAlignment.Stretch;
wrapanl_main.VerticalAlignment = VerticalAlignment.Top;
wrapanl_main.Margin = new Thickness(0, 0, 0, 0);
TitleName.LayoutTransform = new RotateTransform(){ Angle = 0 };
TitleName.Margin = new Thickness(10, 0,10, 0);
//外部Stackpanl
waibustack.Orientation = Orientation.Vertical;
waibustack.VerticalAlignment = VerticalAlignment.Top;
//拉出按钮
lachu.HorizontalAlignment = HorizontalAlignment.Stretch;
lachu.VerticalAlignment = VerticalAlignment.Top;
lachu.LayoutTransform = new RotateTransform() { Angle = 270 };
lachu.BorderThickness = new Thickness(0, 0, 1, 0);
//closeGrid
closeGrid.HorizontalAlignment = HorizontalAlignment.Right;
closeGrid.VerticalAlignment = VerticalAlignment.Center;
closeGrid.Margin = new Thickness(10, 0, 10, 0);
ButClose.Margin = new Thickness(0,5, 0, 0);
break;
case MenuAlignment.右边:
k = (canvas.Name.Length / 5 - 1 + (canvas.Name.Length % 5 > 0 ? 1 : 0)) * 15;
//左边菜单栏
PageList.HorizontalAlignment = HorizontalAlignment.Right;
PageList.VerticalAlignment = VerticalAlignment.Top;
PageList.VerticalAlignment = VerticalAlignment.Stretch;
PageList.Margin = new Thickness(10, 70 + k, 10, 110);
PageList.Padding = new Thickness(0, 0, 0, 0);
_StackPanel.SetValue(StackPanel.OrientationProperty, Orientation.Vertical);
wrapanl_main.Orientation = Orientation.Vertical;
//标题栏
TitleName.Margin = new Thickness(0, 10, 0, 10);
TitleName.HorizontalAlignment = HorizontalAlignment.Stretch;
TitleName.VerticalAlignment = VerticalAlignment.Top;
border0.Margin = new Thickness(0, 60 + k, 0, 0);
border0.LayoutTransform = new RotateTransform() { Angle = 0 };
border0.HorizontalAlignment = HorizontalAlignment.Stretch;
border0.VerticalAlignment = VerticalAlignment.Top;
border1.Margin = new Thickness(0, 0, 0, 100);
border1.LayoutTransform = new RotateTransform() { Angle = 0 };
border1.HorizontalAlignment = HorizontalAlignment.Stretch;
border1.VerticalAlignment = VerticalAlignment.Bottom;
//内部Grid
wrapanl_main.HorizontalAlignment = HorizontalAlignment.Right;
wrapanl_main.VerticalAlignment = VerticalAlignment.Stretch;
wrapanl_main.Margin = new Thickness(0, 0, 0, 25);
TitleName.Margin = new Thickness(0, 10, 0, 10);
menuWidth = wrapanl_main.ActualWidth;
//外部Stackpanl
waibustack.Orientation = Orientation.Horizontal;
waibustack.HorizontalAlignment = HorizontalAlignment.Right;
//拉出按钮
lachu.HorizontalAlignment = HorizontalAlignment.Right;
lachu.VerticalAlignment = VerticalAlignment.Stretch;
lachu.BorderThickness = new Thickness(0, 0,0, 0);
lachu.BorderThickness = new Thickness(1, 0, 0, 0);
//closeGrid
closeGrid.HorizontalAlignment = HorizontalAlignment.Center;
closeGrid.VerticalAlignment = VerticalAlignment.Bottom;
closeGrid.Margin = new Thickness(10);
ButClose.Margin = new Thickness(0, 5, 0, 0);
break;
case MenuAlignment.底部:
PageList.HorizontalAlignment = HorizontalAlignment.Left;
//左边菜单栏
PageList.HorizontalAlignment = HorizontalAlignment.Stretch;
PageList.VerticalAlignment = VerticalAlignment.Bottom;
PageList.Margin = new Thickness(140, 0, 120, 0);
PageList.Padding = new Thickness(0, 0, 0, 0);
_StackPanel.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal);
wrapanl_main.Orientation = Orientation.Horizontal;
//标题栏
TitleName.LayoutTransform = new RotateTransform() { Angle = 0 };
TitleName.Margin = new Thickness(10, 10, 10, 10);
TitleName.HorizontalAlignment = HorizontalAlignment.Left;
TitleName.VerticalAlignment = VerticalAlignment.Center;
TitleName.Width = 110;
border0.Margin = new Thickness(130, 0, 0, 0);
border0.HorizontalAlignment = HorizontalAlignment.Left;
border0.VerticalAlignment = VerticalAlignment.Stretch;
border0.LayoutTransform = new RotateTransform() { Angle = 90 };
border1.Margin = new Thickness(0, 0, 110, 0);
border1.HorizontalAlignment = HorizontalAlignment.Right;
border1.VerticalAlignment = VerticalAlignment.Stretch;
border1.LayoutTransform = new RotateTransform() { Angle = 90 };
//内部Grid
wrapanl_main.HorizontalAlignment = HorizontalAlignment.Stretch;
wrapanl_main.VerticalAlignment = VerticalAlignment.Bottom;
wrapanl_main.Margin = new Thickness(0, 0, 0, 0);
TitleName.LayoutTransform = new RotateTransform() { Angle = 0 };
TitleName.Margin = new Thickness(10, 0, 10, 0);
menuWidth = wrapanl_main.ActualHeight;
//外部Stackpanl
waibustack.Orientation = Orientation.Vertical;
waibustack.VerticalAlignment = VerticalAlignment.Bottom;
//拉出按钮
lachu.HorizontalAlignment = HorizontalAlignment.Stretch;
lachu.VerticalAlignment = VerticalAlignment.Bottom;
lachu.LayoutTransform = new RotateTransform() { Angle = 270 };
lachu.BorderThickness= new Thickness(0, 0, 0, 0);
lachu.BorderThickness = new Thickness(0, 0, 1, 0);
//closeGrid
closeGrid.HorizontalAlignment = HorizontalAlignment.Right;
closeGrid.VerticalAlignment = VerticalAlignment.Center;
closeGrid.Margin = new Thickness(10, 0, 10, 0);
ButClose.Margin = new Thickness(0, 5, 0, 0);
break;
default:
break;
@@ -193,6 +278,34 @@ namespace BeDesignerSCADA.Controls
menuRunCanvasModel.MenuModel.SelectPageModels.runCanvas.RunSelect();
}
}
/// <summary>
/// 父窗体控制事件
/// </summary>
/// <param name="obj"></param>
public void PandClick(Window obj)
{
this.ButClose.Click += (o, e) =>
{
MessageBoxResult res = MessageBox.Show("确定关闭上位机软件?", "警告", MessageBoxButton.OKCancel);
if (res == MessageBoxResult.OK)
{
obj.Close();
}

};
this.waibustack.MouseLeftButtonDown += (o, e) =>
{
if (e.ClickCount > 1)
{
if (obj.WindowState == WindowState.Maximized)
obj.WindowState = WindowState.Normal;
else if (obj.WindowState == WindowState.Normal)
obj.WindowState = WindowState.Maximized;
}
if (e.LeftButton == MouseButtonState.Pressed) obj.DragMove();
};
}

bool ismove = true;
int times = 0;
/// <summary>
@@ -229,6 +342,8 @@ namespace BeDesignerSCADA.Controls
}
times = 0;
}
private int menuWidthDefault = 0;
private double menuWidth = 86;
private void MenuBig()
@@ -237,7 +352,7 @@ namespace BeDesignerSCADA.Controls
DoubleAnimation da = new DoubleAnimation();
da.From = menuWidthDefault;
da.To = menuWidth;
da.Duration = TimeSpan.FromSeconds(0.5);
da.Duration = TimeSpan.FromSeconds(0.2);
if (menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.左边 || menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.右边)
{
wrapanl_main.BeginAnimation(WidthProperty, da);
@@ -259,7 +374,7 @@ namespace BeDesignerSCADA.Controls
DoubleAnimation da = new DoubleAnimation();
da.From = menuWidth;
da.To = menuWidthDefault;
da.Duration = TimeSpan.FromSeconds(0.5);
da.Duration = TimeSpan.FromSeconds(0.2);
if (menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.左边 || menuRunCanvasModel.MenuModel.Alignment == MenuAlignment.右边)
{
if (languageResDic.Contains("image右1"))
@@ -273,9 +388,6 @@ namespace BeDesignerSCADA.Controls
lachuStyle.Style = languageResDic["image左1"] as Style;
}
}

}

/// <summary>


+ 1
- 0
BeDesignerSCADA/View/RunWindows.xaml Visa fil

@@ -6,6 +6,7 @@
xmlns:local="clr-namespace:BeDesignerSCADA.View"
xmlns:ctl="clr-namespace:BeDesignerSCADA.Controls"
mc:Ignorable="d"
WindowStyle="None"
WindowState="Maximized"
Title="模拟运行器" Height="450" Width="800">
<Window.Resources>


+ 17
- 2
BeDesignerSCADA/View/RunWindows.xaml.cs Visa fil

@@ -25,9 +25,24 @@ namespace BeDesignerSCADA.View
InitializeComponent();
}

public void LoadingData(MenuModel frameworks)
/// <summary>
/// 1.根据菜单Model加载界面
/// </summary>
/// <param name="frameworks"></param>
public void LoadingData(MenuModel menuModel)
{
runCanvas.RunMenu(frameworks);
runCanvas.RunMenu(menuModel);
runCanvas.PandClick(this);
}

/// <summary>
/// 2.根据路径加载界面
/// </summary>
/// <param name="frameworks"></param>
public void LoadingData(string _path)
{
runCanvas.LoadingData(_path);
runCanvas.PandClick(this);
}
}
}

Laddar…
Avbryt
Spara