浏览代码

增加一系列窗体界面 丰富界面等待开发,增加版本更新历史界面

样式分支
fyf 2 年前
父节点
当前提交
5b787a9abe
共有 19 个文件被更改,包括 607 次插入28 次删除
  1. +2
    -1
      BPASmartClient.CustomResource/Themes/GenricStyle.xaml
  2. +34
    -0
      BPASmartClient.CustomResource/Themes/MyStyle.xaml
  3. +204
    -0
      BPASmartClient.Helper/BrowserHelper.cs
  4. +5
    -3
      BPASmartClient.ViewModel/LogViewModel.cs
  5. +4
    -0
      BPASmartClient/BPASmartClient.csproj
  6. +17
    -0
      BPASmartClient/Control/BatchingAddView.xaml
  7. +28
    -0
      BPASmartClient/Control/BatchingAddView.xaml.cs
  8. +12
    -0
      BPASmartClient/Control/BusinessOrchestrationView.xaml
  9. +28
    -0
      BPASmartClient/Control/BusinessOrchestrationView.xaml.cs
  10. +13
    -0
      BPASmartClient/Control/DeviceMonitorView.xaml
  11. +28
    -0
      BPASmartClient/Control/DeviceMonitorView.xaml.cs
  12. +2
    -4
      BPASmartClient/Control/LogView.xaml
  13. +3
    -1
      BPASmartClient/Control/LogView.xaml.cs
  14. +12
    -0
      BPASmartClient/Control/SystemSetView.xaml
  15. +28
    -0
      BPASmartClient/Control/SystemSetView.xaml.cs
  16. +34
    -0
      BPASmartClient/Control/VersionView.xaml
  17. +122
    -0
      BPASmartClient/Control/VersionView.xaml.cs
  18. +18
    -18
      BPASmartClient/MainWindow.xaml
  19. +13
    -1
      BPASmartClient/MainWindow.xaml.cs

+ 2
- 1
BPASmartClient.CustomResource/Themes/GenricStyle.xaml 查看文件

@@ -1832,7 +1832,8 @@
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Height" Value="24"/>

<Setter Property="CaretBrush" Value="White"></Setter>
<Setter Property="Padding" Value="10"></Setter>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>


+ 34
- 0
BPASmartClient.CustomResource/Themes/MyStyle.xaml 查看文件

@@ -13,6 +13,30 @@
<ImageBrush x:Key="image1" ImageSource="/BPASmartClient.CustomResource;component/Image/shape.png"/>
<ImageBrush x:Key="image2" ImageSource="/BPASmartClient.CustomResource;component/Image/shape1.png"/>
<!--#region Label-->
<Style TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="#FF00EEF3"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
<!--#region Color-->
<SolidColorBrush x:Key="foreground" Color="#FFA2C2E8"/>
@@ -295,6 +319,16 @@
</Style.Setters>
</Style>

<Style x:Key="border阴影边框扩展" TargetType="Border">
<Style.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/阴影边框.png"/>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>

<Style x:Key="border边角" TargetType="Border">
<Style.Setters>
<Setter Property="Background">


+ 204
- 0
BPASmartClient.Helper/BrowserHelper.cs 查看文件

@@ -0,0 +1,204 @@
using System;
using System.Diagnostics;
using System.IO;
using Microsoft.Win32;

namespace BPASmartClient.Helper
{
public class BrowserHelper
{
/// <summary>
/// 调用系统浏览器打开网页
/// http://m.jb51.net/article/44622.htm
/// http://www.2cto.com/kf/201412/365633.html
/// </summary>
/// <param name="url">打开网页的链接</param>
public static void OpenBrowserUrl(string url)
{
try
{
// 64位注册表路径
var openKey = @"SOFTWARE\Wow6432Node\Google\Chrome";
if (IntPtr.Size == 4)
{
// 32位注册表路径
openKey = @"SOFTWARE\Google\Chrome";
}
RegistryKey appPath = Registry.LocalMachine.OpenSubKey(openKey);
// 谷歌浏览器就用谷歌打开,没找到就用系统默认的浏览器
// 谷歌卸载了,注册表还没有清空,程序会返回一个"系统找不到指定的文件。"的bug
if (appPath != null)
{
var result = Process.Start("chrome.exe",url);
if (result == null)
{
OpenIe(url);
}
}
else
{
var result = Process.Start("chrome.exe",url);
if (result == null)
{
OpenDefaultBrowserUrl(url);
}
}
}
catch
{
// 出错调用用户默认设置的浏览器,还不行就调用IE
OpenDefaultBrowserUrl(url);
}
}

/// <summary>
/// 用IE打开浏览器
/// </summary>
/// <param name="url"></param>
public static void OpenIe(string url)
{
try
{
Process.Start("iexplore.exe",url);
}
catch (Exception ex)
{
//MessageBox.Show(ex.Message);
// IE浏览器路径安装:C:\Program Files\Internet Explorer
// at System.Diagnostics.process.StartWithshellExecuteEx(ProcessStartInfo startInfo)注意这个错误
try
{
if (File.Exists(@"C:\Program Files\Internet Explorer\iexplore.exe"))
{
ProcessStartInfo processStartInfo = new ProcessStartInfo
{
FileName = @"C:\Program Files\Internet Explorer\iexplore.exe",
Arguments = url,
UseShellExecute = false,
CreateNoWindow = true
};
Process.Start(processStartInfo);
}
else
{
if (File.Exists(@"C:\Program Files (x86)\Internet Explorer\iexplore.exe"))
{
ProcessStartInfo processStartInfo = new ProcessStartInfo
{
FileName = @"C:\Program Files (x86)\Internet Explorer\iexplore.exe",
Arguments = url,
UseShellExecute = false,
CreateNoWindow = true
};
Process.Start(processStartInfo);
}
else
{
//if (MessageBox.Show(@"系统未安装IE浏览器,是否下载安装?",null,MessageBoxButtons.YesNoCancel,MessageBoxIcon.Question) == DialogResult.Yes)
//{
// // 打开下载链接,从微软官网下载
// OpenDefaultBrowserUrl("http://windows.microsoft.com/zh-cn/internet-explorer/download-ie");
//}
}
}
}
catch (Exception exception)
{
// MessageBox.Show(exception.Message);
}
}
}

/// <summary>
/// 打开系统默认浏览器(用户自己设置了默认浏览器)
/// </summary>
/// <param name="url"></param>
public static void OpenDefaultBrowserUrl(string url)
{
try
{
// 方法1
//从注册表中读取默认浏览器可执行文件路径
RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command\");
if (key != null)
{
string s = key.GetValue("").ToString();
//s就是你的默认浏览器,不过后面带了参数,把它截去,不过需要注意的是:不同的浏览器后面的参数不一样!
//"D:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -- "%1"
var lastIndex = s.IndexOf(".exe",StringComparison.Ordinal);
if (lastIndex == -1)
{
lastIndex = s.IndexOf(".EXE",StringComparison.Ordinal);
}
var path = s.Substring(1,lastIndex + 3);
var result = Process.Start(path,url);
if (result == null)
{
// 方法2
// 调用系统默认的浏览器
var result1 = Process.Start("explorer.exe",url);
if (result1 == null)
{
// 方法3
Process.Start(url);
}
}
}
else
{
// 方法2
// 调用系统默认的浏览器
var result1 = Process.Start("explorer.exe",url);
if (result1 == null)
{
// 方法3
Process.Start(url);
}
}
}
catch
{
OpenIe(url);
}
}

/// <summary>
/// 火狐浏览器打开网页
/// </summary>
/// <param name="url"></param>
public static void OpenFireFox(string url)
{
try
{
// 64位注册表路径
var openKey = @"SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox";
if (IntPtr.Size == 4)
{
// 32位注册表路径
openKey = @"SOFTWARE\Mozilla\Mozilla Firefox";
}
RegistryKey appPath = Registry.LocalMachine.OpenSubKey(openKey);
if (appPath != null)
{
var result = Process.Start("firefox.exe",url);
if (result == null)
{
OpenIe(url);
}
}
else
{
var result = Process.Start("firefox.exe",url);
if (result == null)
{
OpenDefaultBrowserUrl(url);
}
}
}
catch
{
OpenDefaultBrowserUrl(url);
}
}
}
}

+ 5
- 3
BPASmartClient.ViewModel/LogViewModel.cs 查看文件

@@ -38,10 +38,12 @@ namespace BPASmartClient.ViewModel
OnPropertyChanged("LogDataGrid");
}
}

public LogViewModel()
private volatile static LogViewModel _Instance;
public static LogViewModel GetInstance() => _Instance ?? (_Instance = new LogViewModel());
private LogViewModel()
{
LogDataGrid = new ObservableCollection<LogModel>();
if(LogDataGrid==null)
LogDataGrid = new ObservableCollection<LogModel>();
MessageLog.GetInstance.InfoNotify = new Action<string>((s) =>
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>


+ 4
- 0
BPASmartClient/BPASmartClient.csproj 查看文件

@@ -9,6 +9,10 @@
<StartupObject>BPASmartClient.App</StartupObject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1185.39" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" />
</ItemGroup>


+ 17
- 0
BPASmartClient/Control/BatchingAddView.xaml 查看文件

@@ -0,0 +1,17 @@
<UserControl x:Class="BPASmartClient.Control.BatchingAddView"
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.Control"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<wv2:WebView2
Name="webView"
Width="{Binding RelativeSource={RelativeSource AncestorType=Grid}, Path=ActualWidth}"
Height="{Binding RelativeSource={RelativeSource AncestorType=Grid}, Path=ActualHeight}"
Source="http://1.14.74.54:8808/welcome" />
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient/Control/BatchingAddView.xaml.cs 查看文件

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Control
{
/// <summary>
/// BatchingAddView.xaml 的交互逻辑
/// </summary>
public partial class BatchingAddView :UserControl
{
public BatchingAddView()
{
InitializeComponent();
}
}
}

+ 12
- 0
BPASmartClient/Control/BusinessOrchestrationView.xaml 查看文件

@@ -0,0 +1,12 @@
<UserControl x:Class="BPASmartClient.Control.BusinessOrchestrationView"
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.Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Label FontSize="100" >业务流程编排界面</Label>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient/Control/BusinessOrchestrationView.xaml.cs 查看文件

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Control
{
/// <summary>
/// BusinessOrchestrationView.xaml 的交互逻辑
/// </summary>
public partial class BusinessOrchestrationView :UserControl
{
public BusinessOrchestrationView()
{
InitializeComponent();
}
}
}

+ 13
- 0
BPASmartClient/Control/DeviceMonitorView.xaml 查看文件

@@ -0,0 +1,13 @@
<UserControl x:Class="BPASmartClient.Control.DeviceMonitorView"
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.Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Label FontSize="100" >设备流程监视界面</Label>

</Grid>
</UserControl>

+ 28
- 0
BPASmartClient/Control/DeviceMonitorView.xaml.cs 查看文件

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Control
{
/// <summary>
/// DeviceMonitorView.xaml 的交互逻辑
/// </summary>
public partial class DeviceMonitorView :UserControl
{
public DeviceMonitorView()
{
InitializeComponent();
}
}
}

+ 2
- 4
BPASmartClient/Control/LogView.xaml 查看文件

@@ -15,11 +15,9 @@
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<UserControl.DataContext>
<vm:LogViewModel></vm:LogViewModel>
</UserControl.DataContext>

<!--底部窗体栏-->
<Grid >
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition/>


+ 3
- 1
BPASmartClient/Control/LogView.xaml.cs 查看文件

@@ -1,4 +1,5 @@
using System;
using BPASmartClient.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -23,6 +24,7 @@ namespace BPASmartClient.Control
public LogView()
{
InitializeComponent();
this.DataContext= LogViewModel.GetInstance();
}
}
}

+ 12
- 0
BPASmartClient/Control/SystemSetView.xaml 查看文件

@@ -0,0 +1,12 @@
<UserControl x:Class="BPASmartClient.Control.SystemSetView"
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.Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Label FontSize="100" >系统参数设置界面</Label>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient/Control/SystemSetView.xaml.cs 查看文件

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Control
{
/// <summary>
/// SystemSetView.xaml 的交互逻辑
/// </summary>
public partial class SystemSetView :UserControl
{
public SystemSetView()
{
InitializeComponent();
}
}
}

+ 34
- 0
BPASmartClient/Control/VersionView.xaml 查看文件

@@ -0,0 +1,34 @@
<UserControl x:Class="BPASmartClient.Control.VersionView"
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.Control"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml"/>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1.5*"></RowDefinition>
<RowDefinition Height="10*"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Row="0" Style="{DynamicResource border阴影边框扩展}"></Border>
<Border x:Name="border" Grid.Row="1" Style="{DynamicResource border阴影边框扩展}"></Border>
<Border Grid.Row="2" Style="{DynamicResource border阴影边框扩展}"></Border>
<Button Grid.Row="0" Content="保存本地" Width="75" Style="{DynamicResource CommonBtn_返回}" Margin="100,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Center" Click="Button_Click" Cursor="Hand"/>
<Label HorizontalAlignment="Left" VerticalAlignment="Center" x:Name="label_currentver" Margin="10,0,0,0">1.0</Label>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<TextBox FontSize="16" x:Name="memoEdit1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" UseLayoutRounding="True" AcceptsReturn="True" TextWrapping="Wrap" UndoLimit="200" Height="{Binding Height, ElementName=border}" />
</ScrollViewer>
<Label Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" Content="四川黑菠萝科技有限公司 ● 成都"></Label>
<Label Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="10,0,10,0" Content="©HBL 2021-2022"></Label>
</Grid>
</UserControl>

+ 122
- 0
BPASmartClient/Control/VersionView.xaml.cs 查看文件

@@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.IO;
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.Control
{
/// <summary>
/// VersionView.xaml 的交互逻辑
/// </summary>
public partial class VersionView :UserControl
{
public VersionView()
{
InitializeComponent();
}
ReaderWriterLockSlim m_lock = new ReaderWriterLockSlim();
string path = $"{System.AppDomain.CurrentDomain.BaseDirectory}/whatnew.txt";

/// <summary>
/// 加载文件
/// </summary>
private void UserControl_Loaded(object sender,RoutedEventArgs e)
{
try
{
//通过一体化启动时 路径为
if (File.Exists(path))
{
try
{
m_lock.EnterReadLock();
using (StreamReader sr = new StreamReader(path,Encoding.Default))
{
string str = sr.ReadToEnd();
if (!string.IsNullOrEmpty(str))
{
string[] content = str.Split(new char[] { '\r','\n' });

this.memoEdit1.Text = str;
if (content.Length > 3)
label_currentver.Content = "当前版本:" + content[0];
else
{
this.label_currentver.Content = "当前版本:N/A";
}
}
else
{
this.memoEdit1.Text = "没有任何内容";
label_currentver.Content = "当前版本:N/A";
}
}
m_lock.ExitReadLock();
}
catch
{
this.memoEdit1.Text = "版本文件加载错误";
label_currentver.Content = "当前版本:N/A";
}
finally
{
if (m_lock.IsReadLockHeld) m_lock.ExitReadLock();
}
}
else
{
WriteFile(path,this.memoEdit1.Text);
this.memoEdit1.Text = "无版本描述文件";
label_currentver.Content = "当前版本:N/A";
}

}
catch (Exception)
{

}
}

/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender,RoutedEventArgs e)
{
WriteFile(path,this.memoEdit1.Text);
}

/// <summary>
/// 写文件
/// </summary>
/// <param name="Path">文件路径</param>
/// <param name="Strings">文件内容</param>
public static void WriteFile(string Path,string Strings)
{
if (!System.IO.File.Exists(Path))
{
//Directory.CreateDirectory(Path);
System.IO.FileStream f = System.IO.File.Create(Path);
f.Close();
f.Dispose();
}
System.IO.StreamWriter f2 = new System.IO.StreamWriter(Path,true,System.Text.Encoding.UTF8);
f2.WriteLine(Strings);
f2.Close();
f2.Dispose();
}
}
}

+ 18
- 18
BPASmartClient/MainWindow.xaml 查看文件

@@ -44,41 +44,41 @@
<Border Style="{DynamicResource bordertopL}"></Border>
<Image Margin="20,0,0,0" VerticalAlignment="Center" Style="{DynamicResource imagetop_Title}" ></Image>
<Grid Grid.Column="1">
<Menu >
<Menu>
<MenuItem Header="功能列表">
<MenuItem Header="加盟商管理" FontSize="12" Click="MenuItem_Click" Tag="BatchingAddView"/>
<Separator/>
<MenuItem Header="业务编排" FontSize="12" Click="MenuItem_Click" Tag="BusinessOrchestrationView" />
<Separator/>
<MenuItem Header="大屏导航" FontSize="12" Click="MenuItem_Click" Tag="IOT" />
</MenuItem>
<MenuItem Header="状态监视" >
<MenuItem Header="日志监视" FontSize="12" Click="MenuItem_Click" Tag="LogView" />
<Separator/>
<MenuItem Header="订单监视" FontSize="12" Click="MenuItem_Click" Tag="OrderStatusView" />
<Separator/>
<MenuItem Header="设备监视" FontSize="12" Click="MenuItem_Click" Tag="RealTimeDataControl" />
<MenuItem Header="设备监视" FontSize="12" Click="MenuItem_Click" Tag="DeviceMonitorView" />
<Separator/>
<MenuItem Header="告警监视" FontSize="12" Click="MenuItem_Click" Tag="RealTimeDataControl" />
<MenuItem Header="告警监视" FontSize="12" Click="MenuItem_Click" Tag="LogView" />
<Separator/>
<MenuItem Header="IOT监视" FontSize="12" Click="MenuItem_Click" Tag="RealTimeDataControl" />
<MenuItem Header="IOT监视" FontSize="12" Click="MenuItem_Click" Tag="LogView" />
</MenuItem>
<MenuItem Header="综合查询">
<MenuItem Header="告警查询" FontSize="12" Click="MenuItem_Click" Tag="HistoryFaultControl"/>
<Separator/>
<MenuItem Header="日志查询" FontSize="12" Click="MenuItem_Click" Tag="MaintenanceNotificationControl"/>
<MenuItem Header="告警查询" FontSize="12" Click="MenuItem_Click" Tag="LogOrAlarmView"/>
<Separator/>
<MenuItem Header="维护查询" FontSize="12" Click="MenuItem_Click" Tag="WorkorderManagementControl"/>
</MenuItem>
<MenuItem Header="功能列表">
<MenuItem Header="加盟商管理" FontSize="12" Click="MenuItem_Click" Tag="OnOffControl"/>
<MenuItem Header="日志查询" FontSize="12" Click="MenuItem_Click" Tag="LogOrAlarmView"/>
<Separator/>
<MenuItem Header="功能列表2" FontSize="12" Click="MenuItem_Click" Tag="SystemParameterControl" />
<MenuItem Header="维护查询" FontSize="12" Click="MenuItem_Click" Tag="LogOrAlarmView"/>
</MenuItem>
<MenuItem Header="参数配置">
<MenuItem Header="参数设置" FontSize="12" Click="MenuItem_Click" Tag="OnOffControl"/>
<Separator/>
<MenuItem Header="系统设置" FontSize="12" Click="MenuItem_Click" Tag="SystemParameterControl" />
<Separator/>
<MenuItem Header="退出程序" FontSize="12" Click="MenuItem_Click" Tag="RealTimevideoControl"/>
<MenuItem Header="参数设置" FontSize="12" Click="MenuItem_Click" Tag="SystemSetView"/>
</MenuItem>
<MenuItem Header="系统帮助">
<MenuItem Header="版本更新历史" FontSize="12" Click="MenuItem_Click" Tag="OnOffControl"/>
<MenuItem Header="版本更新历史" FontSize="12" Click="MenuItem_Click" Tag="VersionView"/>
<Separator/>
<MenuItem Header="帮助文档" FontSize="12" Click="MenuItem_Click" Tag="SystemParameterControl" />
<Separator/>
<MenuItem Header="退出程序" FontSize="12" Click="MenuItem_Click" Tag="Close"/>
</MenuItem>
</Menu>
</Grid>


+ 13
- 1
BPASmartClient/MainWindow.xaml.cs 查看文件

@@ -80,7 +80,19 @@ namespace BPASmartClient
if (sender is MenuItem)
{
Type type = Type.GetType($"BPASmartClient.Control.{(sender as MenuItem).Tag?.ToString()}");
if (type == null) return;
if (type == null)
{
switch ((sender as MenuItem).Tag?.ToString())
{
case "Close":
this.Close();
break;
case "IOT":
BrowserHelper.OpenDefaultBrowserUrl("http://iot.black-pa.com");
break;
}
return;
}
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
contentRegion.Content = (FrameworkElement)cti.Invoke(null);
Title.Text = (sender as MenuItem).Header?.ToString()+"界面";


正在加载...
取消
保存