ソースを参照

更新主界面样式

样式分支
fyf 2年前
コミット
c40856cb16
5個のファイルの変更139行の追加92行の削除
  1. +85
    -23
      BPASmartClient.CustomResource/Themes/GenricStyle.xaml
  2. +3
    -3
      BPASmartClient.CustomResource/Themes/MyStyle.xaml
  3. +3
    -5
      BPASmartClient.KLMCoffee/CoffeeMachine.cs
  4. +8
    -6
      BPASmartClient/DeviceInfo.xml
  5. +40
    -55
      BPASmartClient/MainWindow.xaml

+ 85
- 23
BPASmartClient.CustomResource/Themes/GenricStyle.xaml ファイルの表示

@@ -22,6 +22,26 @@
<GradientStop Color="#E3E3E3" Offset="1"/>
</LinearGradientBrush>

<SolidColorBrush x:Key="Menu.Static.Background" Color="#FFF0F0F0"/>
<Style TargetType="{x:Type Menu}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
<Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Margin" Value="10,10,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Menu}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type DatePickerTextBox}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
@@ -1169,7 +1189,7 @@
<MultiTrigger.Setters>
<Setter TargetName="border2" Property="Background" >
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/leftImage.png" />
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/Tab/Tab4_Select.png" />
</Setter.Value>
</Setter>
</MultiTrigger.Setters>
@@ -1366,28 +1386,33 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border BorderBrush="#331068A3" BorderThickness="1"/>
<Border >
<Border.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" />
</Border.Background>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- TopLevelHeader -->
<ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
<Border Name="Border" Margin="30,0,0,0" >
<Grid>
<ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
<Border Name="Border" Cursor="Hand" >
<Grid Margin="30,10,30,5">
<ContentPresenter
ContentSource="Header"
RecognizesAccessKey="True"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<Popup
Name="Popup"
Name="Popup" VerticalOffset="10" HorizontalOffset="-30"
Placement="Bottom"
IsOpen="{TemplateBinding IsSubmenuOpen}"
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Slide">
PopupAnimation="Slide"
>
<Border
Name="SubmenuBorder"
SnapsToDevicePixels="True"
@@ -1408,14 +1433,34 @@
<Trigger Property="IsHighlighted" Value="true">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/leftImage.png"/>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/Tab/Tab4_Select.png" />
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="#8f723c"/>
<Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
<Setter TargetName="SubmenuBorder" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/内部背景.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsHighlighted" Value="false">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/Tab/Tab4_No.png" />
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="White"/>
<Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
<Setter TargetName="SubmenuBorder" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/From/内部背景.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
<Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="0,0,4,4"/>
<Setter TargetName="SubmenuBorder" Property="Padding" Value="0,0,0,3"/>
<Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="0"/>
<Setter TargetName="SubmenuBorder" Property="Padding" Value="5"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#ffffffff"/>
@@ -1455,8 +1500,8 @@
<ControlTemplate
x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}"
TargetType="{x:Type MenuItem}">
<Border Name="Border" >
<Grid >
<Border Name="Border" Margin="5" Cursor="Hand">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
<ColumnDefinition Width="*" />
@@ -1491,11 +1536,13 @@
Grid.Column="1"
ContentSource="Header"
RecognizesAccessKey="True"/>
<TextBlock x:Name="InputGestureText"
<TextBlock x:Name="InputGestureText" Cursor="Hand"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Grid.Column="2"
Background="#331068A3"
Background="Transparent"
Text="{TemplateBinding InputGestureText}"
Margin="5,2,0,2"
Margin="5,2,0,-5"
DockPanel.Dock="Right" />
</Grid>
</Border>
@@ -1514,13 +1561,22 @@
<Trigger Property="IsHighlighted" Value="true">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/leftImage.png"/>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/Tab/Tab4_Select.png"/>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="#8f723c"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="Yellow"/>
<Trigger Property="IsHighlighted" Value="false">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/Tab/Tab4_No.png"/>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="White"/>
</Trigger>
<!--<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="Yellow"/>
</Trigger>-->
</ControlTemplate.Triggers>
</ControlTemplate>

@@ -1570,8 +1626,7 @@
<Border
Name="SubmenuBorder"
SnapsToDevicePixels="True"
Background="#331068A3"
BorderBrush="#331068A3"
BorderBrush="Transparent"
BorderThickness="1" >
<StackPanel
IsItemsHost="True"
@@ -1587,7 +1642,14 @@
<Trigger Property="IsHighlighted" Value="true">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/leftImage.png"/>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/Tab/Tab4_No.png" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsHighlighted" Value="false">
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/窗体样式/Tab/Tab4_Select.png" />
</Setter.Value>
</Setter>
</Trigger>
@@ -1613,9 +1675,9 @@
<Trigger Property="Role" Value="TopLevelItem">
<Setter Property="Template" Value="{StaticResource {x:Static MenuItem.TopLevelItemTemplateKey}}"/>
</Trigger>
<Trigger Property="Role" Value="SubmenuHeader">
<!--<Trigger Property="Role" Value="SubmenuHeader">
<Setter Property="Template" Value="{StaticResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}"/>
</Trigger>
</Trigger>-->
<Trigger Property="Role" Value="SubmenuItem">
<Setter Property="Template" Value="{StaticResource {x:Static MenuItem.SubmenuItemTemplateKey}}"/>
</Trigger>


+ 3
- 3
BPASmartClient.CustomResource/Themes/MyStyle.xaml ファイルの表示

@@ -28,8 +28,8 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid>
<Border x:Name="bd1" Visibility="Collapsed" Width="25" Height="13" HorizontalAlignment="Right" Panel.ZIndex="100" VerticalAlignment="Top" Margin="0,-5,-5,0" CornerRadius="3" Background="#33FF0000" >
<Grid Cursor="Hand">
<Border x:Name="bd1" Cursor="Hand" Visibility="Collapsed" Width="25" Height="13" HorizontalAlignment="Right" Panel.ZIndex="100" VerticalAlignment="Top" Margin="0,-5,-5,0" CornerRadius="3" Background="#33FF0000" >
<TextBlock Text="{Binding ListNum}" Foreground="#FF2AA7D3" HorizontalAlignment="Center"></TextBlock>
</Border>
<Image x:Name="image1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Source="/BPASmartClient.CustomResource;component/Image/告警.png" Panel.ZIndex="0" Stretch="UniformToFill" ></Image>
@@ -736,7 +736,7 @@
</ColorAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>-->
<Border x:Name="BD">
<Border x:Name="BD" Cursor="Hand">
<TextBlock x:Name="textBlock" FontSize="12" Text="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="{DynamicResource foreground}" />
</Border>
<ControlTemplate.Triggers>


+ 3
- 5
BPASmartClient.KLMCoffee/CoffeeMachine.cs ファイルの表示

@@ -113,6 +113,8 @@ namespace BPASmartClient.KLMCoffee
if (Encoding.ASCII.GetString(data.ToArray()) == ":")
{
temp.Add(item);
while (dataStorage.GetSize() < 32) { Thread.Sleep(5); }

while (temp.Count < 32)
{
temp.Add(dataStorage.GetData());
@@ -125,6 +127,7 @@ namespace BPASmartClient.KLMCoffee
var package = Encoding.ASCII.GetString(temp.ToArray());
ProcessMsg(package);
}
temp.Clear();
}
continue;
}
@@ -174,11 +177,6 @@ namespace BPASmartClient.KLMCoffee
commProxy = new SerialPortClient(PortName,(BaudRates)Enum.Parse(typeof(BaudRates),BaudRate));
commProxy.SetDataStorage(dataStorage);

//string sdas = ":010510000000000000000000F3A\r\n";
//byte[] sdsd = new K95Command().ascii2Hex(sdas);
//dataStorage.PutData(sdsd);
//ResolveMsg();

//伽乐美咖啡机制作
EventBus.EventBus.GetInstance().Subscribe<KLMCoffee_MakeCoffeeEvent>(DeviceId,delegate (IEvent @event,EventCallBackHandle callBack)
{


+ 8
- 6
BPASmartClient/DeviceInfo.xml ファイルの表示

@@ -9,12 +9,7 @@
<OutputSingalValue>0</OutputSingalValue>
</Parameters>
</Peripheral>
<Peripheral Module="BPASmartClient.DRCoffee.CoffeeMachine">
<Parameters>
<PortName>COM5</PortName>
<BaudRate>9600</BaudRate>
</Parameters>
</Peripheral>
<Peripheral Module="BPASmartClient.SCChip.ICChipMachine">
<Parameters>
<PortName>COM5</PortName>
@@ -40,6 +35,13 @@
</Parameters>
</Peripheral>

<Peripheral Module="BPASmartClient.KLMCoffee.CoffeeMachine">
<Parameters>
<PortName>COM8</PortName>
<BaudRate>38400</BaudRate>
</Parameters>
</Peripheral>

</Peripherals>
</Device>



+ 40
- 55
BPASmartClient/MainWindow.xaml ファイルの表示

@@ -20,16 +20,16 @@
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Geometry x:Key="Icon_Desgin">M61.141068 400.532698L3.815672 725.688936l61.197513 74.337875 83.560965-473.80941H-0.067734zM79.169555 298.333642h74.315297l-61.208801-74.315297zM359.011862 660.653173l-13.095206 74.337875 53.566168 65.024474 13.095207-74.326586zM455.171319 484.138819v0.011289H287.959077l59.3687 72.068792L107.64034 716.398113 92.908233 800.015522l347.508401-232.259293 1.648189-9.302112h0.011289l13.106496-74.304009h-0.011289zM494.490806 261.181638H187.904926l-13.095207 74.315297 61.208802 74.315298 19.676677-111.478591h157.921418l-26.201702 148.641884h74.315297l32.771884-185.793888h-0.011289z M617.224501 400.543987l-57.359263 325.156238 61.23138 74.326586 83.527098-473.80941H556.00441zM635.23041 298.344931h74.315297L648.325616 224.018345zM982.783966 224.018345h-74.326586l-32.749306 185.805177H717.7415l30.626979 37.163293H869.137893l-62.224809 353.039996 87.410504-74.326586 49.140891-278.71341h74.315298l6.558892-37.163293h-74.326586z</Geometry>

</ResourceDictionary>
</Window.Resources>
<Border Style="{DynamicResource border主窗体背景}" x:Name="br" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--标题-->
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
@@ -40,15 +40,43 @@
<Border Style="{DynamicResource bordertopL}"></Border>
<Image Margin="10,0,0,0" VerticalAlignment="Center" Style="{DynamicResource imagetop_Title}" ></Image>
<Grid Grid.Column="1">
<TabControl>
<TabItem Header=" 状态监视 "></TabItem>
<TabItem Header=" 产品制作 "></TabItem>
<TabItem Header=" 综合查询 "></TabItem>
<TabItem Header=" 功能列表 "></TabItem>
<TabItem Header=" 参数配置 "></TabItem>
<TabItem Header=" 系统帮助 "></TabItem>
</TabControl>
<Menu >
<MenuItem Header="状态监视" >
<MenuItem Header="订单监视" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
<Separator/>
<MenuItem Header="设备监视" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
<Separator/>
<MenuItem Header="告警监视" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
<Separator/>
<MenuItem Header="IOT监视" Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataControl" />
</MenuItem>
<MenuItem Header="综合查询">
<MenuItem Header="告警查询" Command="{Binding NavChangedCommand}" CommandParameter="HistoryFaultControl"/>
<Separator/>
<MenuItem Header="日志查询" Command="{Binding NavChangedCommand}" CommandParameter="MaintenanceNotificationControl"/>
<Separator/>
<MenuItem Header="维护查询" Command="{Binding NavChangedCommand}" CommandParameter="WorkorderManagementControl"/>
</MenuItem>
<MenuItem Header="功能列表">
<MenuItem Header="加盟商管理" Command="{Binding NavChangedCommand}" CommandParameter="OnOffControl"/>
<Separator/>
<MenuItem Header="功能列表2" Command="{Binding NavChangedCommand}" CommandParameter="SystemParameterControl" />
</MenuItem>
<MenuItem Header="参数配置">
<MenuItem Header="参数设置" Command="{Binding NavChangedCommand}" CommandParameter="OnOffControl"/>
<Separator/>
<MenuItem Header="系统设置" Command="{Binding NavChangedCommand}" CommandParameter="SystemParameterControl" />
<Separator/>
<MenuItem Header="退出程序" Visibility="Collapsed" Command="{Binding NavChangedCommand}" CommandParameter="RealTimevideoControl"/>
</MenuItem>
<MenuItem Header="系统帮助">
<MenuItem Header="版本更新历史" Command="{Binding NavChangedCommand}" CommandParameter="OnOffControl"/>
<Separator/>
<MenuItem Header="帮助文档" Command="{Binding NavChangedCommand}" CommandParameter="SystemParameterControl" />
</MenuItem>
</Menu>
</Grid>

<StackPanel Grid.Column="4" Orientation="Horizontal" HorizontalAlignment="Right" Height="50" VerticalAlignment="Top">
<Border Style="{DynamicResource border竖线}" />
<ToggleButton VerticalAlignment="Center" ToolTip="告警消息" HorizontalAlignment="Center" Style="{DynamicResource StatusBtnStyle告警}" DataContext="{Binding GaoJingMessage}" Cursor="Hand"/>
@@ -74,52 +102,9 @@

<!--底部窗体-->
<Grid Grid.Row="1" Margin="10">
<Border Style="{DynamicResource border窗体背景1}" Visibility="Collapsed" Width="500" HorizontalAlignment="Left" VerticalAlignment="Stretch">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock HorizontalAlignment="Center" Margin="0,10,0,0">相关设备状态</TextBlock>

<DataGrid x:Name="datagrid" Margin="0,50,0,0" ItemsSource="{Binding EquiPment, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1">
<DataGrid.Columns>
<DataGridTemplateColumn Header=" " Width="24">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Ellipse Width="12" Height="12" ToolTip="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Fill="{Binding color, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="设备名称" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="设备状态" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Status, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Foreground="#00ccff"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="维护" Width="4.4*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Width="12" Height="12" ToolTip="设备维护" Style="{DynamicResource image个人信息}" Cursor="Hand" x:Name="ShowFromButton"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Border>
<Button Grid.Row="2" Content="测试" HorizontalAlignment="Center" Margin="153,123,0,0" VerticalAlignment="Top" Click="Button_Click"/>

<Button Grid.Row="2" Content="测试" HorizontalAlignment="Left" Margin="153,123,0,0" VerticalAlignment="Top" Click="Button_Click"/>
</Grid>


</Grid>
</Border>


読み込み中…
キャンセル
保存