Commit 3992b9a4 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 删除下吹 多余文件

parent ce3f81a8
...@@ -71,10 +71,6 @@ ...@@ -71,10 +71,6 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Themes\DataGridStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\ToggleButtonOnOffStyle.xaml"> <Page Include="Themes\ToggleButtonOnOffStyle.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
...@@ -143,18 +139,10 @@ ...@@ -143,18 +139,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="UiModule\TempAreaPanel\UcTm.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\TempAreaPanel\UcTcSet.xaml"> <Page Include="UiModule\TempAreaPanel\UcTcSet.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="UiModule\TempAreaPanel\UcTc.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UiModule\TempAreaPanel\WdTempAreaSet.xaml"> <Page Include="UiModule\TempAreaPanel\WdTempAreaSet.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -266,15 +254,9 @@ ...@@ -266,15 +254,9 @@
<Compile Include="UiModule\TempAreaPanel\TempAreaPanel.xaml.cs"> <Compile Include="UiModule\TempAreaPanel\TempAreaPanel.xaml.cs">
<DependentUpon>TempAreaPanel.xaml</DependentUpon> <DependentUpon>TempAreaPanel.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UiModule\TempAreaPanel\UcTm.xaml.cs">
<DependentUpon>UcTm.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\TempAreaPanel\UcTcSet.xaml.cs"> <Compile Include="UiModule\TempAreaPanel\UcTcSet.xaml.cs">
<DependentUpon>UcTcSet.xaml</DependentUpon> <DependentUpon>UcTcSet.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UiModule\TempAreaPanel\UcTc.xaml.cs">
<DependentUpon>UcTc.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\TempAreaPanel\WdTempAreaSet.xaml.cs"> <Compile Include="UiModule\TempAreaPanel\WdTempAreaSet.xaml.cs">
<DependentUpon>WdTempAreaSet.xaml</DependentUpon> <DependentUpon>WdTempAreaSet.xaml</DependentUpon>
</Compile> </Compile>
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="DataGrid" x:Key="DataGridStyle01">
<!--网格线颜色-->
<Setter Property="Background" Value="#E6DBBB" />
<Setter Property="BorderBrush" Value="#d6c79b" />
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#d6c79b"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#d6c79b"/>
</Setter.Value>
</Setter>
</Style>
<!--标题栏样式-->
<!--<Style TargetType="DataGridColumnHeader" >
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="30"/>
<Setter Property="FontSize" Value="14" />
<Setter Property="Background" Value="White" />
<Setter Property="FontWeight" Value="Bold"/>
</Style>-->
<Style TargetType="DataGridColumnHeader">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="28" />
<Setter Property="Foreground" Value="#323433" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridColumnHeader">
<Border x:Name="BackgroundBorder" BorderThickness="0,1,0,1"
BorderBrush="#e6dbba"
Width="Auto">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" Grid.Column="2" Width="8" Height="6" Fill="White" Margin="0,0,50,0"
VerticalAlignment="Center" RenderTransformOrigin="1,1" />
<Rectangle Width="1" Fill="#d6c79b" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
<!--<TextBlock Background="Red">
<ContentPresenter></ContentPresenter></TextBlock>-->
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Height" Value="25"/>
</Style>
<!--行样式触发-->
<!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式-->
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="#F2F2F2" />
<Setter Property="Height" Value="25"/>
<Setter Property="Foreground" Value="Black" />
<Style.Triggers>
<!--隔行换色-->
<Trigger Property="AlternationIndex" Value="0" >
<Setter Property="Background" Value="#e7e7e7" />
</Trigger>
<Trigger Property="AlternationIndex" Value="1" >
<Setter Property="Background" Value="#f2f2f2" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="LightGray"/>
<!--<Setter Property="Foreground" Value="White"/>-->
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
<!--单元格样式触发-->
<Style TargetType="DataGridCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<TextBlock TextAlignment="Center" VerticalAlignment="Center" >
<ContentPresenter />
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<!--<Setter Property="Background" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>-->
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="DataGridCell" x:Key="DataGridCellStyle_Base">
<Setter Property="FontSize" Value="15"/>
</Style>
<Style TargetType="DataGridCell" x:Key="DataGridCellStyle_strong">
<Setter Property="FontSize" Value="15"/>
<Setter Property="Background" Value="Pink"/>
</Style>
<Style TargetType="DataGridCell" x:Key="DataGridCellStyle_Percent" BasedOn="{StaticResource DataGridCellStyle_Base}">
<Setter Property="Background" Value="Gray"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldHeader">
<Setter Property="Margin" Value="3,0" />
<Setter Property="Foreground" Value="#FF3B3B3B" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="18" />
<Setter Property="FontFamily" Value="YouYuan" />
<Setter Property="TextAlignment" Value="Left" />
</Style>
</ResourceDictionary>
<UserControl
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:FLY.DownBlowing.UI.Client.UiModule"
xmlns:p="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
x:Class="FLY.DownBlowing.UI.Client.UiModule.UcTc"
mc:Ignorable="d p" MinWidth="150" MinHeight="116"
x:Name="uc">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--加载 ResourceDictionary 会很慢,在TempAreaPanel中不能直接调用 UcTc,然后需要等3-4s才能启动 -->
<p:ResourceDictionary Source="UcTcStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!--资料内的数据不调用,是不会创建的,所以不用担心浪费内存-->
<local:UcTcVmUt x:Key="viewModel" PV="100" SV="99" IsRun="True" IsOT1="True" Number="M2"/>
</ResourceDictionary>
</UserControl.Resources>
<Grid d:DataContext="{StaticResource viewModel}" DataContext="{Binding ElementName=uc}">
<Border Background="{StaticResource DashBoardBrush}" BorderBrush="{StaticResource DashBoardBorderBrush}" BorderThickness="3" CornerRadius="3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<StackPanel>
<Grid Margin="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="PV" Foreground="{StaticResource PrintBrush}" Margin="2"/>
<TextBlock Grid.Column="1" Style="{StaticResource SegTextStyle}"
Text="{Binding PV,StringFormat={}{0:0.#}}" />
</Grid>
<Rectangle Height="2" Fill="{StaticResource PrintBrush}"/>
<Grid Margin="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="SV" Foreground="{StaticResource PrintBrush}" Margin="2"/>
<TextBlock Grid.Column="1" Style="{StaticResource SegTextStyle}" Foreground="{StaticResource SegOrangeBrush}"
Text="{Binding SV,StringFormat={}{0:0.#}}" />
</Grid>
<Rectangle Height="2" Fill="{StaticResource PrintBrush}"/>
<UniformGrid Margin="2,2,2,5" Columns="4">
<ToggleButton IsChecked="{Binding IsRun}" Content="Run" IsEnabled="False" Style="{StaticResource LedStyle}"/>
<ToggleButton IsChecked="{Binding IsOT1}" Content="OT1" IsEnabled="False" Style="{StaticResource LedStyle}"/>
<ToggleButton IsChecked="{Binding IsAT}" Content="AT" IsEnabled="False" Style="{StaticResource LedStyle}"/>
<ToggleButton IsChecked="{Binding IsOT2}" Content="OT2" IsEnabled="False" Style="{StaticResource LedStyle}"/>
</UniformGrid>
</StackPanel>
<TextBlock Background="{StaticResource BrandBrush}" Grid.Row="1" Height="8" Text="8888888" FontWeight="Bold" Padding="1" FontSize="5" Foreground="{StaticResource PrintBrush}"/>
</Grid>
</Border>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Top"
Background="{StaticResource Color_badgeBg}" Foreground="{StaticResource Color_badgeText}"
Padding="6,2"
FontSize="30"
Text="{Binding Number}" Margin="0,-5,-5,0"/>
</Grid>
</UserControl>
using System.Windows;
using System.Windows.Controls;
namespace FLY.DownBlowing.UI.Client.UiModule
{
/// <summary>
/// UcTc.xaml 的交互逻辑
/// 温度控制器
/// </summary>
public partial class UcTc : UserControl
{
public UcTc()
{
InitializeComponent();
}
public string Number
{
get { return (string)GetValue(NumberProperty); }
set { SetValue(NumberProperty, value); }
}
public static readonly DependencyProperty NumberProperty =
DependencyProperty.Register(nameof(Number), typeof(string), typeof(UcTc));
public double PV
{
get { return (double)GetValue(PVProperty); }
set { SetValue(PVProperty, value); }
}
public static readonly DependencyProperty PVProperty =
DependencyProperty.Register(nameof(PV), typeof(double), typeof(UcTc));
public double SV
{
get { return (double)GetValue(SVProperty); }
set { SetValue(SVProperty, value); }
}
public static readonly DependencyProperty SVProperty =
DependencyProperty.Register(nameof(SV), typeof(double), typeof(UcTc));
public bool IsRun
{
get { return (bool)GetValue(IsRunProperty); }
set { SetValue(IsRunProperty, value); }
}
public static readonly DependencyProperty IsRunProperty =
DependencyProperty.Register(nameof(IsRun), typeof(bool), typeof(UcTc));
public bool IsOT1
{
get { return (bool)GetValue(IsOT1Property); }
set { SetValue(IsOT1Property, value); }
}
public static readonly DependencyProperty IsOT1Property =
DependencyProperty.Register(nameof(IsOT1), typeof(bool), typeof(UcTc));
public bool IsOT2
{
get { return (bool)GetValue(IsOT2Property); }
set { SetValue(IsOT2Property, value); }
}
public static readonly DependencyProperty IsOT2Property =
DependencyProperty.Register(nameof(IsOT2), typeof(bool), typeof(UcTc));
public bool IsAT
{
get { return (bool)GetValue(IsATProperty); }
set { SetValue(IsATProperty, value); }
}
public static readonly DependencyProperty IsATProperty =
DependencyProperty.Register(nameof(IsAT), typeof(bool), typeof(UcTc));
}
public class UcTcVmUt
{
public string Number { get; set; }
public double PV { get; set; }
public double SV { get; set; }
public bool IsRun { get; set; }
public bool IsOT1 { get; set; }
public bool IsAT { get; set; }
public bool IsOT2 { get; set; }
}
}
...@@ -7,28 +7,25 @@ ...@@ -7,28 +7,25 @@
xmlns:local="clr-namespace:FLY.DownBlowing.UI.Client.UiModule" xmlns:local="clr-namespace:FLY.DownBlowing.UI.Client.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary" xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:ut="clr-namespace:FLY.DownBlowing.UI.Client.UnitTests"
mc:Ignorable="d" mc:Ignorable="d"
x:Name="uc"
> >
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="UcTcStyle.xaml"/> <ResourceDictionary Source="UcTcStyle.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<ut:DownBlowingSystemServiceUt x:Key="viewModel"/>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
<StackPanel> <StackPanel>
<ContentControl Width="140" ContentTemplate="{StaticResource TcSetTemplate}" <ContentControl Width="140" ContentTemplate="{StaticResource TcSetTemplate}"
Content="{ Binding Source={StaticResource viewModel}, Path=TAreas[0].Temperatures[0]}"/> Content="{ Binding Source={StaticResource downBlowingSystemUt}, Path=TAreas[0].Temperatures[0]}"/>
<ContentControl Width="240" ContentTemplate="{StaticResource TcAllSetTemplate}" <ContentControl Width="240" ContentTemplate="{StaticResource TcAllSetTemplate}"
Content="{ Binding Source={StaticResource viewModel}, Path=TAreas[0]}"/> Content="{ Binding Source={StaticResource downBlowingSystemUt}, Path=TAreas[0]}"/>
<ContentControl Width="116" Margin="{StaticResource ControlMargin}" ContentTemplate="{StaticResource TcTemplate}" <ContentControl Width="116" Margin="{StaticResource ControlMargin}" ContentTemplate="{StaticResource TcTemplate}"
Content="{ Binding Source={StaticResource viewModel}, Path=TAreas[0].Temperatures[0]}"/> Content="{ Binding Source={StaticResource downBlowingSystemUt}, Path=TAreas[0].Temperatures[0]}"/>
<ContentControl MinWidth="150" MinHeight="116" Margin="{StaticResource ControlMargin}" ContentTemplate="{StaticResource TmTemplate}" <ContentControl MinWidth="150" MinHeight="116" Margin="{StaticResource ControlMargin}" ContentTemplate="{StaticResource TmTemplate}"
Content="{ Binding Source={StaticResource viewModel}, Path=TAreas[1]}"/> Content="{ Binding Source={StaticResource downBlowingSystemUt}, Path=TAreas[1]}"/>
</StackPanel> </StackPanel>
</UserControl> </UserControl>
<UserControl
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:FLY.DownBlowing.UI.Client.UiModule"
x:Class="FLY.DownBlowing.UI.Client.UiModule.UcTm"
mc:Ignorable="d" MinWidth="150" MinHeight="116"
x:Name="uc">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--加载 ResourceDictionary 会很慢,在TempAreaPanel中不能直接调用 UcTc,然后需要等3-4s才能启动 -->
<ResourceDictionary Source="UcTcStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!--资料内的数据不调用,是不会创建的,所以不用担心浪费内存-->
<local:UcTmVmUt x:Key="viewModel" PV="100.1" Number="熔温"/>
</ResourceDictionary>
</UserControl.Resources>
<Grid d:DataContext="{StaticResource viewModel}" DataContext="{Binding ElementName=uc}">
<Border Background="{StaticResource DashBoardBrush}" BorderBrush="{StaticResource DashBoardBorderBrush}" BorderThickness="3" CornerRadius="3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<StackPanel>
<Grid Height="30"/>
<Grid Margin="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="PV" Foreground="{StaticResource PrintBrush}" Margin="2"/>
<TextBlock Grid.Column="1" Style="{StaticResource SegTextStyle}"
Text="{Binding PV,StringFormat={}{0:0.#}}" />
</Grid>
</StackPanel>
<TextBlock Background="{StaticResource BrandBrush}" Grid.Row="1" Height="8" Text="8888888" FontWeight="Bold" Padding="1" FontSize="5" Foreground="{StaticResource PrintBrush}"/>
</Grid>
</Border>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Top"
Background="{StaticResource Color_badgeBg}" Foreground="{StaticResource Color_badgeText}"
Padding="6,2"
FontSize="30"
Text="{Binding Number}" Margin="0,-5,-5,0"/>
</Grid>
</UserControl>
using System.Windows;
using System.Windows.Controls;
namespace FLY.DownBlowing.UI.Client.UiModule
{
/// <summary>
/// UcTm.xaml 的交互逻辑
/// 温度测量器
/// </summary>
public partial class UcTm : UserControl
{
public UcTm()
{
InitializeComponent();
}
public string Number
{
get { return (string)GetValue(NumberProperty); }
set { SetValue(NumberProperty, value); }
}
public static readonly DependencyProperty NumberProperty =
DependencyProperty.Register(nameof(Number), typeof(string), typeof(UcTm));
public double PV
{
get { return (double)GetValue(PVProperty); }
set { SetValue(PVProperty, value); }
}
public static readonly DependencyProperty PVProperty =
DependencyProperty.Register(nameof(PV), typeof(double), typeof(UcTm));
}
public class UcTmVmUt
{
public string Number { get; set; }
public double PV { get; set; }
}
}
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.DownBlowing.UI.Client.UiModule" xmlns:local="clr-namespace:FLY.DownBlowing.UI.Client.UiModule"
xmlns:ut="clr-namespace:FLY.DownBlowing.UI.Client.UnitTests"
mc:Ignorable="d" mc:Ignorable="d"
Title="WdTempAreaSet" SizeToContent="WidthAndHeight" Title="WdTempAreaSet" SizeToContent="WidthAndHeight"
Unloaded="WindowBigClose_Unloaded" Unloaded="WindowBigClose_Unloaded"
...@@ -21,13 +20,11 @@ ...@@ -21,13 +20,11 @@
<Setter Property="Margin" Value="{StaticResource ControlMargin}"/> <Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
<Setter Property="Width" Value="140"/> <Setter Property="Width" Value="140"/>
</Style> </Style>
<ut:DownBlowingSystemServiceUt x:Key="viewModel"/>
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
<Grid Background="{StaticResource Color_bottom}"> <Grid Background="{StaticResource Color_bottom}">
<Grid Margin="10" <Grid Margin="10"
d:DataContext="{Binding Source={StaticResource viewModel},Path=TAreas[1]}"> d:DataContext="{Binding Source={StaticResource downBlowingSystemUt},Path=TAreas[2]}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment