@@ -14,11 +14,11 @@ | |||||
Background="{TemplateBinding Background}" | Background="{TemplateBinding Background}" | ||||
BorderBrush="{TemplateBinding BorderBrush}" | BorderBrush="{TemplateBinding BorderBrush}" | ||||
BorderThickness="{TemplateBinding BorderThickness}" /> | BorderThickness="{TemplateBinding BorderThickness}" /> | ||||
<Grid> | |||||
<Grid.ColumnDefinitions> | |||||
<Grid HorizontalAlignment="Center"> | |||||
<!--<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
<ColumnDefinition /> | <ColumnDefinition /> | ||||
</Grid.ColumnDefinitions> | |||||
</Grid.ColumnDefinitions>--> | |||||
<TextBlock | <TextBlock | ||||
Name="PART_icoText" | Name="PART_icoText" | ||||
Margin="0,0,10,0" | Margin="0,0,10,0" | ||||
@@ -106,7 +106,7 @@ namespace BPASmartClient.MorkF | |||||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | ||||
{ | { | ||||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { DeviceId = DeviceId, Status = oRDER_STATUS, SubOrderId = subid }); | |||||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid }); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -67,7 +67,7 @@ namespace BPASmartClient.MorkS | |||||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | ||||
{ | { | ||||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { DeviceId = DeviceId, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); | |||||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType }); | |||||
} | } | ||||
private void ReadData(string address, ushort len = 1, Action<bool[]> action = null) | private void ReadData(string address, ushort len = 1, Action<bool[]> action = null) | ||||
@@ -0,0 +1,124 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.ObjectModel; | |||||
namespace BPASmartClient.ViewModel.Model | |||||
{ | |||||
/// <summary> | |||||
/// 店铺设备 | |||||
/// </summary> | |||||
public class DeviceConfigModel : ObservableObject | |||||
{ | |||||
/// <summary> | |||||
/// 店铺名称 | |||||
/// </summary> | |||||
public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } } | |||||
private string _mShopName = string.Empty; | |||||
/// <summary> | |||||
/// 店铺ID | |||||
/// </summary> | |||||
public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } } | |||||
private string _mShopId = string.Empty; | |||||
/// <summary> | |||||
/// 设备集合 | |||||
/// </summary> | |||||
public ObservableCollection<DeviceModel> deviceModels = new ObservableCollection<DeviceModel>(); | |||||
} | |||||
/// <summary> | |||||
/// 启动模块 | |||||
/// </summary> | |||||
public class DeviceModel : ObservableObject | |||||
{ | |||||
/// <summary> | |||||
/// 设备名称 | |||||
/// </summary> | |||||
public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } } | |||||
private string _mDeviceName = string.Empty; | |||||
/// <summary> | |||||
/// 启动设备模块 | |||||
/// </summary> | |||||
public string DeviceModule { get { return _mDeviceModule; } set { _mDeviceModule = value; OnPropertyChanged(); } } | |||||
private string _mDeviceModule = string.Empty; | |||||
/// <summary> | |||||
/// 设备ID | |||||
/// </summary> | |||||
public string DeviceId { get { return _mDeviceId; } set { _mDeviceId = value; OnPropertyChanged(); } } | |||||
private string _mDeviceId = string.Empty; | |||||
/// <summary> | |||||
/// 通讯模块 | |||||
/// </summary> | |||||
public ObservableCollection<CommunicationModel> communicationDevcies = new ObservableCollection<CommunicationModel>(); | |||||
} | |||||
/// <summary> | |||||
/// 通讯模块 | |||||
/// </summary> | |||||
public class CommunicationModel : ObservableObject | |||||
{ | |||||
/// <summary> | |||||
/// 通讯启动模块 | |||||
/// </summary> | |||||
public string CommunicationModule { get { return _mCommunicationModule; } set { _mCommunicationModule = value; OnPropertyChanged(); } } | |||||
private string _mCommunicationModule = string.Empty; | |||||
} | |||||
/// <summary> | |||||
/// 通讯参数 | |||||
/// </summary> | |||||
public class CommunicationPar : ObservableObject | |||||
{ | |||||
public CommunicationParType communicationType { get { return _mcommunicationType; } set { _mcommunicationType = value; OnPropertyChanged(); } } | |||||
private CommunicationParType _mcommunicationType; | |||||
public string CommunicationValue { get { return _mCommunicationValue; } set { _mCommunicationValue = value; OnPropertyChanged(); } } | |||||
private string _mCommunicationValue = string.Empty; | |||||
} | |||||
public enum CommunicationParType | |||||
{ | |||||
/// <summary> | |||||
/// IP地址 | |||||
/// </summary> | |||||
IPAddress, | |||||
/// <summary> | |||||
/// 端口号 | |||||
/// </summary> | |||||
Port, | |||||
/// <summary> | |||||
/// 串口端口号 | |||||
/// </summary> | |||||
SerialPort, | |||||
/// <summary> | |||||
/// 波特率 | |||||
/// </summary> | |||||
BaudRate, | |||||
/// <summary> | |||||
/// 数据位 | |||||
/// </summary> | |||||
DataBits, | |||||
/// <summary> | |||||
/// 停止位 | |||||
/// </summary> | |||||
StopBits, | |||||
/// <summary> | |||||
/// 校验位 | |||||
/// </summary> | |||||
Parity, | |||||
} | |||||
} |
@@ -0,0 +1,17 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
namespace BPASmartClient.ViewModel | |||||
{ | |||||
public class NewShopWindowModel : ObservableObject | |||||
{ | |||||
public NewShopWindowModel() | |||||
{ | |||||
} | |||||
} | |||||
} |
@@ -9,5 +9,11 @@ namespace BPASmartClient.ViewModel | |||||
{ | { | ||||
public class ShopDeviceConfigViewModel : ObservableObject | public class ShopDeviceConfigViewModel : ObservableObject | ||||
{ | { | ||||
public ShopDeviceConfigViewModel() | |||||
{ | |||||
//NewCommand = new Action(() => {ActionManager }); | |||||
} | |||||
public Action NewCommand { get; set; } | |||||
} | } | ||||
} | } |
@@ -76,7 +76,10 @@ | |||||
<RowDefinition /> | <RowDefinition /> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<StackPanel x:Name="sp" HorizontalAlignment="Right" Orientation="Horizontal"> | |||||
<StackPanel | |||||
x:Name="sp" | |||||
HorizontalAlignment="Right" | |||||
Orientation="Horizontal"> | |||||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="请选择店铺:" /> | <TextBlock Style="{StaticResource TextBlockStyle}" Text="请选择店铺:" /> | ||||
@@ -95,13 +98,22 @@ | |||||
Style="{StaticResource ComboBoxStyle}" | Style="{StaticResource ComboBoxStyle}" | ||||
Text="{Binding ClientDeviceType}" /> | Text="{Binding ClientDeviceType}" /> | ||||
<!--<Button Content="aaaa"/>--> | |||||
<pry:IcoButton | <pry:IcoButton | ||||
Width="100" | |||||
Content="新建" | |||||
Width="140" | |||||
Content="新建店铺" | |||||
FontSize="16" | FontSize="16" | ||||
Foreground="{StaticResource TextBlockForeground}" | Foreground="{StaticResource TextBlockForeground}" | ||||
IcoText="" | IcoText="" | ||||
MouseLeftButtonDown="IcoButton_MouseLeftButtonDown" | |||||
Style="{StaticResource NewButtonStyle}" /> | |||||
<pry:IcoButton | |||||
Width="140" | |||||
Content="保存" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TextBlockForeground}" | |||||
IcoText="" | |||||
MouseLeftButtonDown="IcoButton_MouseLeftButtonDown" | |||||
Style="{StaticResource NewButtonStyle}" /> | Style="{StaticResource NewButtonStyle}" /> | ||||
<!--<Button | <!--<Button | ||||
@@ -142,7 +154,225 @@ | |||||
Margin="0,10,0,0" | Margin="0,10,0,0" | ||||
HorizontalScrollBarVisibility="Hidden" | HorizontalScrollBarVisibility="Hidden" | ||||
VerticalScrollBarVisibility="Hidden"> | VerticalScrollBarVisibility="Hidden"> | ||||
<ItemsControl ItemsSource="{Binding communicationSets}"> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="100" /> | |||||
<RowDefinition Height="200" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<!-- 店铺信息 --> | |||||
<Grid Grid.Row="0"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
</Grid.RowDefinitions> | |||||
<Grid> | |||||
<pry:TitleTextBlock /> | |||||
<TextBlock | |||||
Margin="5" | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Center" | |||||
FontFamily="雅黑" | |||||
FontSize="20" | |||||
Foreground="Yellow" | |||||
Text="店铺信息" /> | |||||
</Grid> | |||||
<Grid Grid.Row="1"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入店铺名称:" /> | |||||
<TextBox | |||||
Grid.Column="1" | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入店铺ID:" /> | |||||
<TextBox | |||||
Grid.Column="3" | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
<pry:IcoButton | |||||
Grid.Column="4" | |||||
Width="140" | |||||
Content="新建设备" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TextBlockForeground}" | |||||
IcoText="" | |||||
MouseLeftButtonDown="IcoButton_MouseLeftButtonDown" | |||||
Style="{StaticResource NewButtonStyle}" /> | |||||
</Grid> | |||||
</Grid> | |||||
<!-- 设备信息 --> | |||||
<Grid Grid.Row="1"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
</Grid.RowDefinitions> | |||||
<Grid> | |||||
<pry:TitleTextBlock /> | |||||
<TextBlock | |||||
Margin="5" | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Center" | |||||
FontFamily="雅黑" | |||||
FontSize="20" | |||||
Foreground="Yellow" | |||||
Text="设备信息" /> | |||||
</Grid> | |||||
<!--#region 使用列表包裹--> | |||||
<Grid Grid.Row="1"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入设备名称:" /> | |||||
<TextBox | |||||
Grid.Column="1" | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入设备ID:" /> | |||||
<TextBox | |||||
Grid.Column="3" | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
</Grid> | |||||
<Grid Grid.Row="3"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请选择启动模块:" /> | |||||
<ComboBox | |||||
Grid.Column="5" | |||||
Margin="170,0,20,0" | |||||
VerticalAlignment="Center" | |||||
BorderBrush="#FF23CACA" | |||||
BorderThickness="1" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="#ff23caca" | |||||
IsEditable="False" | |||||
ItemsSource="{Binding Path=Device.PlcTypes}" | |||||
Style="{StaticResource ComboBoxStyle}" | |||||
Text="{Binding Path=Device.PlcType}" /> | |||||
</Grid> | |||||
<Grid Grid.Row="4"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请选择通讯模块:" /> | |||||
<ComboBox | |||||
Grid.Column="5" | |||||
Margin="170,0,20,0" | |||||
VerticalAlignment="Center" | |||||
BorderBrush="#FF23CACA" | |||||
BorderThickness="1" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="#ff23caca" | |||||
IsEditable="False" | |||||
ItemsSource="{Binding Path=Device.PlcTypes}" | |||||
Style="{StaticResource ComboBoxStyle}" | |||||
Text="{Binding Path=Device.PlcType}" /> | |||||
</Grid> | |||||
<!--#endregion--> | |||||
<!--<pry:IcoButton | |||||
Grid.Row="4" | |||||
Content="添加设备" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TextBlockForeground}" | |||||
IcoText="" | |||||
Style="{StaticResource NewButtonStyle}" />--> | |||||
</Grid> | |||||
</Grid> | |||||
<!--<ItemsControl ItemsSource="{Binding communicationSets}"> | |||||
<ItemsControl.ItemTemplate> | <ItemsControl.ItemTemplate> | ||||
<DataTemplate> | <DataTemplate> | ||||
<Grid Margin="0,0,0,30"> | <Grid Margin="0,0,0,30"> | ||||
@@ -153,7 +383,9 @@ | |||||
<RowDefinition /> | <RowDefinition /> | ||||
</Grid.RowDefinitions> | </Grid.RowDefinitions> | ||||
<!--#region 标题显示及操作--> | |||||
--> | |||||
<!--#region 标题显示及操作--> | |||||
<!-- | |||||
<Grid Margin="0,0,0,20"> | <Grid Margin="0,0,0,20"> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
<ColumnDefinition Width="0.5*" /> | <ColumnDefinition Width="0.5*" /> | ||||
@@ -172,9 +404,11 @@ | |||||
Foreground="Aqua" | Foreground="Aqua" | ||||
Text="{Binding DeviceName}" /> | Text="{Binding DeviceName}" /> | ||||
</Grid> | </Grid> | ||||
<!--#endregion--> | |||||
--> | |||||
<!--#endregion--> | |||||
<!--#region 西门子设备--> | |||||
<!--#region 西门子设备--> | |||||
<!-- | |||||
<Grid Grid.Row="1" Visibility="{Binding Path=deviceType, Converter={StaticResource VisibleConvert}, ConverterParameter=Siemens}"> | <Grid Grid.Row="1" Visibility="{Binding Path=deviceType, Converter={StaticResource VisibleConvert}, ConverterParameter=Siemens}"> | ||||
<Grid> | <Grid> | ||||
<Grid.ColumnDefinitions> | <Grid.ColumnDefinitions> | ||||
@@ -281,9 +515,11 @@ | |||||
Template="{StaticResource CbTemplate}" /> | Template="{StaticResource CbTemplate}" /> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
<!--#endregion--> | |||||
--> | |||||
<!--#endregion--> | |||||
<!--#region Modbus Tcp 设备--> | |||||
<!--#region Modbus Tcp 设备--> | |||||
<!-- | |||||
<Grid Grid.Row="2" Visibility="{Binding Path=deviceType, Converter={StaticResource VisibleConvert}, ConverterParameter=TCP}"> | <Grid Grid.Row="2" Visibility="{Binding Path=deviceType, Converter={StaticResource VisibleConvert}, ConverterParameter=TCP}"> | ||||
<Grid> | <Grid> | ||||
@@ -363,9 +599,11 @@ | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
<!--#endregion--> | |||||
--> | |||||
<!--#endregion--> | |||||
<!--#region Modbus RTU 设备--> | |||||
<!--#region Modbus RTU 设备--> | |||||
<!-- | |||||
<Grid Grid.Row="3" Visibility="{Binding Path=deviceType, Converter={StaticResource VisibleConvert}, ConverterParameter=Serial}"> | <Grid Grid.Row="3" Visibility="{Binding Path=deviceType, Converter={StaticResource VisibleConvert}, ConverterParameter=Serial}"> | ||||
<Grid> | <Grid> | ||||
@@ -500,12 +738,14 @@ | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
<!--#endregion--> | |||||
--> | |||||
<!--#endregion--> | |||||
<!-- | |||||
</Grid> | </Grid> | ||||
</DataTemplate> | </DataTemplate> | ||||
</ItemsControl.ItemTemplate> | </ItemsControl.ItemTemplate> | ||||
</ItemsControl> | |||||
</ItemsControl>--> | |||||
</ScrollViewer> | </ScrollViewer> | ||||
</Grid> | </Grid> | ||||
@@ -12,6 +12,7 @@ using System.Windows.Media; | |||||
using System.Windows.Media.Imaging; | using System.Windows.Media.Imaging; | ||||
using System.Windows.Navigation; | using System.Windows.Navigation; | ||||
using System.Windows.Shapes; | using System.Windows.Shapes; | ||||
using BPASmartClient.DialogWindow; | |||||
namespace BPASmartClient.Control | namespace BPASmartClient.Control | ||||
{ | { | ||||
@@ -24,5 +25,11 @@ namespace BPASmartClient.Control | |||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
} | } | ||||
private void IcoButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) | |||||
{ | |||||
NewShopWindow newShopWindow = new NewShopWindow(); | |||||
newShopWindow.ShowDialog(); | |||||
} | |||||
} | } | ||||
} | } |
@@ -0,0 +1,364 @@ | |||||
<Window | |||||
x:Class="BPASmartClient.DialogWindow.NewShopWindow" | |||||
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:BPASmartClient.DialogWindow" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||||
xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel" | |||||
Title="NewShopWindow" | |||||
Width="850" | |||||
Height="450" | |||||
AllowsTransparency="True" | |||||
Background="{x:Null}" | |||||
Opacity="0.8" | |||||
Topmost="True" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowStyle="None" | |||||
mc:Ignorable="d"> | |||||
<Window.DataContext> | |||||
<vm:NewShopWindowModel /> | |||||
</Window.DataContext> | |||||
<Window.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary> | |||||
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" /> | |||||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||||
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" /> | |||||
<SolidColorBrush x:Key="CursorColor" Color="Aqua" /> | |||||
<SolidColorBrush x:Key="TitleBorderColor" Color="#552AB2E7" /> | |||||
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" /> | |||||
<Style x:Key="buttonStyle" TargetType="Button"> | |||||
<Setter Property="FontFamily" Value="楷体" /> | |||||
<Setter Property="Width" Value="100" /> | |||||
<Setter Property="FontSize" Value="18" /> | |||||
<Setter Property="Foreground" Value="Aqua" /> | |||||
<Setter Property="Template"> | |||||
<Setter.Value> | |||||
<ControlTemplate TargetType="Button"> | |||||
<Grid x:Name="gr"> | |||||
<ContentControl | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Content="{TemplateBinding Content}" | |||||
Foreground="{TemplateBinding Foreground}" /> | |||||
<Polygon | |||||
x:Name="poly" | |||||
Points="0 0,80 0,100 30,20 30" | |||||
Stroke="#FF34F7F7" | |||||
StrokeThickness="2" /> | |||||
</Grid> | |||||
<ControlTemplate.Triggers> | |||||
<Trigger Property="IsMouseOver" Value="True"> | |||||
<Setter TargetName="poly" Property="Fill" Value="#2234F7F7" /> | |||||
</Trigger> | |||||
</ControlTemplate.Triggers> | |||||
</ControlTemplate> | |||||
</Setter.Value> | |||||
</Setter> | |||||
</Style> | |||||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||||
<Setter Property="FontFamily" Value="楷体" /> | |||||
<Setter Property="FontSize" Value="18" /> | |||||
<Setter Property="Background" Value="Transparent" /> | |||||
<Setter Property="Foreground" Value="Aqua" /> | |||||
<Setter Property="VerticalAlignment" Value="Center" /> | |||||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||||
</Style> | |||||
<!--<Style x:Key="TextBoxStyle" TargetType="TextBox"> | |||||
<Setter Property="" | |||||
</Style>--> | |||||
</ResourceDictionary> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</Window.Resources> | |||||
<Grid Background="#103153"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="35" /> | |||||
<RowDefinition /> | |||||
<RowDefinition Height="50" /> | |||||
</Grid.RowDefinitions> | |||||
<!--#region 标题栏设置--> | |||||
<Border | |||||
x:Name="MoveBorder" | |||||
Height="35" | |||||
VerticalAlignment="Top" | |||||
Background="#0C2349" | |||||
BorderBrush="#55ffffff" | |||||
BorderThickness="0,0,0,1"> | |||||
<StackPanel Orientation="Horizontal"> | |||||
<Image Margin="15,5,0,5" Source="pack://application:,,,/BPASmartClient.CustomResource;component/Image/HBL.png" /> | |||||
<TextBlock | |||||
Name="tbTitle" | |||||
Margin="10,0" | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Center" | |||||
FontSize="18" | |||||
Foreground="White" | |||||
Text="新建店铺设备" /> | |||||
</StackPanel> | |||||
</Border> | |||||
<UniformGrid | |||||
Width="150" | |||||
Height="30" | |||||
HorizontalAlignment="Right" | |||||
Columns="3"> | |||||
<Button | |||||
Name="ButMin" | |||||
Content="" | |||||
Style="{StaticResource TitleBarStyle}" | |||||
Visibility="Hidden" /> | |||||
<Button | |||||
Name="ButMax" | |||||
Content="" | |||||
Style="{StaticResource TitleBarStyle}" | |||||
Visibility="Hidden" /> | |||||
<Button | |||||
Name="ButClose" | |||||
Command="{Binding CloseCommand}" | |||||
Content="" | |||||
FontSize="30" | |||||
Style="{StaticResource TitleBarStyle}" /> | |||||
</UniformGrid> | |||||
<!--#endregion--> | |||||
<!--#region 表单数据--> | |||||
<Grid Grid.Row="1"> | |||||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||||
<Grid Margin="10"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="100" /> | |||||
<RowDefinition Height="200" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<!-- 店铺信息 --> | |||||
<Grid> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
</Grid.RowDefinitions> | |||||
<Grid> | |||||
<pry:TitleTextBlock /> | |||||
<TextBlock | |||||
Margin="5" | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Center" | |||||
FontFamily="雅黑" | |||||
FontSize="20" | |||||
Foreground="Yellow" | |||||
Text="店铺信息" /> | |||||
</Grid> | |||||
<Grid Grid.Row="1"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入店铺名称:" /> | |||||
<TextBox | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
</Grid> | |||||
<Grid Grid.Row="2"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入店铺ID:" /> | |||||
<TextBox | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
</Grid> | |||||
</Grid> | |||||
<!-- 设备信息 --> | |||||
<Grid Grid.Row="1"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
<RowDefinition Height="30" /> | |||||
</Grid.RowDefinitions> | |||||
<Grid> | |||||
<pry:TitleTextBlock /> | |||||
<TextBlock | |||||
Margin="5" | |||||
HorizontalAlignment="Left" | |||||
VerticalAlignment="Center" | |||||
FontFamily="雅黑" | |||||
FontSize="20" | |||||
Foreground="Yellow" | |||||
Text="设备信息" /> | |||||
</Grid> | |||||
<!--#region 使用列表包裹--> | |||||
<Grid Grid.Row="1"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入设备名称:" /> | |||||
<TextBox | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
</Grid> | |||||
<Grid Grid.Row="2"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请输入设备ID:" /> | |||||
<TextBox | |||||
Width="100" | |||||
Margin="10,0,0,0" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
BorderBrush="#FF23CACA" | |||||
CaretBrush="Aqua" | |||||
FontFamily="楷体" | |||||
FontSize="21" | |||||
Foreground="#ff34f7f7" | |||||
Text="{Binding Minute}" /> | |||||
</Grid> | |||||
<Grid Grid.Row="3"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请选择启动模块:" /> | |||||
<ComboBox | |||||
Grid.Column="5" | |||||
Margin="170,0,20,0" | |||||
VerticalAlignment="Center" | |||||
BorderBrush="#FF23CACA" | |||||
BorderThickness="1" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="#ff23caca" | |||||
IsEditable="False" | |||||
ItemsSource="{Binding Path=Device.PlcTypes}" | |||||
Style="{StaticResource ComboBoxStyle}" | |||||
Text="{Binding Path=Device.PlcType}" /> | |||||
</Grid> | |||||
<Grid Grid.Row="4"> | |||||
<TextBlock | |||||
HorizontalAlignment="Left" | |||||
Style="{StaticResource TextBlockStyle}" | |||||
Text="请选择通讯模块:" /> | |||||
<ComboBox | |||||
Grid.Column="5" | |||||
Margin="170,0,20,0" | |||||
VerticalAlignment="Center" | |||||
BorderBrush="#FF23CACA" | |||||
BorderThickness="1" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="#ff23caca" | |||||
IsEditable="False" | |||||
ItemsSource="{Binding Path=Device.PlcTypes}" | |||||
Style="{StaticResource ComboBoxStyle}" | |||||
Text="{Binding Path=Device.PlcType}" /> | |||||
</Grid> | |||||
<!--#endregion--> | |||||
<!--<pry:IcoButton | |||||
Grid.Row="4" | |||||
Content="添加设备" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TextBlockForeground}" | |||||
IcoText="" | |||||
Style="{StaticResource NewButtonStyle}" />--> | |||||
</Grid> | |||||
</Grid> | |||||
</ScrollViewer> | |||||
</Grid> | |||||
<!--#endregion--> | |||||
<!--#region 信息取--> | |||||
<Grid Grid.Row="2" Background="#11dddddd"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<!--<ColumnDefinition Width="0.2*" /> | |||||
<ColumnDefinition Width="0.2*" />--> | |||||
</Grid.ColumnDefinitions> | |||||
<!--<TextBlock | |||||
Margin="10,0,0,0" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="Yellow" | |||||
Text="请选择需要继续制作的订单,取消或关闭将删除所有订单。" />--> | |||||
<Button | |||||
Grid.Column="0" | |||||
VerticalAlignment="Center" | |||||
Command="{Binding CancelCommand}" | |||||
Content="取消" | |||||
Style="{StaticResource buttonStyle}" /> | |||||
<Button | |||||
Grid.Column="1" | |||||
VerticalAlignment="Center" | |||||
Command="{Binding ConfirmCommand}" | |||||
Content="确认" | |||||
Style="{StaticResource buttonStyle}" /> | |||||
</Grid> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</Window> |
@@ -0,0 +1,42 @@ | |||||
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.Shapes; | |||||
namespace BPASmartClient.DialogWindow | |||||
{ | |||||
/// <summary> | |||||
/// NewShopWindow.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class NewShopWindow : Window | |||||
{ | |||||
public NewShopWindow() | |||||
{ | |||||
InitializeComponent(); | |||||
this.MoveBorder.MouseLeftButtonDown += (o, e) => | |||||
{ | |||||
this.DragMove(); | |||||
}; | |||||
//WeakReferenceMessenger.Default.Register<string, string>(this, "Close", (o, e) => | |||||
//{ | |||||
// App.Current.Dispatcher.Invoke(new Action(() => | |||||
// { | |||||
// this.DialogResult = Convert.ToBoolean(e); | |||||
// this.Close(); | |||||
// })); | |||||
//}); | |||||
} | |||||
} | |||||
} |
@@ -184,7 +184,7 @@ | |||||
<ToggleButton | <ToggleButton | ||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
VerticalAlignment="Center" | VerticalAlignment="Center" | ||||
Cursor="Hand" | |||||
Cursor="Hand" | |||||
DataContext="{Binding IsAlarm}" | DataContext="{Binding IsAlarm}" | ||||
Style="{DynamicResource StatusBtnStyle告警}" | Style="{DynamicResource StatusBtnStyle告警}" | ||||
ToolTip="告警消息" /> | ToolTip="告警消息" /> | ||||