修改为单屏
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"Time": "10:00:00",
|
||||
"TimeSize": 44,
|
||||
"Charger": "刘华强",
|
||||
"ChargerSize": 44,
|
||||
"RiskLevel": "高",
|
||||
"RiskLevelSize": 44,
|
||||
"Content": "1、 负责组织项目开工前的准备工作,按照施工图总平面布置确定所建建筑物位置,复合定位、标高。安排临时道路铺设工作。参与工程技术管理,配合总工程师编制项目部施工生产计划。\r\n2、认真会审施工图纸,掌握设计意图,严格按图施工。在实际施工中,发现设计图纸不能满足实用要求时,要及时向领导报告,按规定办理设计变更手续",
|
||||
"ContentSize": 44,
|
||||
"DangerPoint": "高空作业的安全风险\r\n化学品使用风险",
|
||||
"DangerPointSize": 44,
|
||||
"Measures": "1.佩戴个人防护装备:所有高空作业人员必须佩戴符合国家标准的安全帽、安全带、防滑鞋等个人防护装备,并定期检查这些设备的完好性。\r\n2.设置安全设施:在可能坠落的高度处安装安全网、护栏和踢脚板,以防止施工人员意外跌落,并避免小物件掉落伤人。\r\n3.进行安全技术交底:在施工前,必须进行针对性的书面安全交底,确保所有参与人员了解安全技术措施和个人防护要求。",
|
||||
"MeasuresSize": 44,
|
||||
"CPCMember1Path": "/Upload/0.jpg",
|
||||
"CPCMember1Name": "张三",
|
||||
"CPCMember2Path": "/Upload/0.jpg",
|
||||
"CPCMember2Name": "李四",
|
||||
"CPCMember3Path": "/Upload/0.jpg",
|
||||
"CPCMember3Name": "王五",
|
||||
"CPCMember4Path": "/Upload/0.jpg",
|
||||
"CPCMember4Name": "赵六",
|
||||
"CPCMemberSize": 44
|
||||
"Time": "10:00:00", /* 时间 */
|
||||
"TimeSize": 44, /* 时间字体大小 */
|
||||
"Charger": "刘华强", /* 负责人 */
|
||||
"ChargerSize": 44, /* 负责人字体大小 */
|
||||
"RiskLevel": "高", /* 风险等级 */
|
||||
"RiskLevelSize": 44, /* 风险等级字体大小 */
|
||||
"Content": "1、 负责组织项目开工前的准备工作,按照施工图总平面布置确定所建建筑物位置,复合定位、标高。安排临时道路铺设工作。参与工程技术管理,配合总工程师编制项目部施工生产计划;\r\n2、认真会审施工图纸,掌握设计意图,严格按图施工。在实际施工中,发现设计图纸不能满足实用要求时,要及时向领导报告,按规定办理设计变更手续", /* 工作内容 */
|
||||
"ContentSize": 35, /* 工作内容字体大小 */
|
||||
"DangerPoint": "高空作业的安全风险,化学品使用风险", /* 危险点 */
|
||||
"DangerPointSize": 35, /* 危险点字体大小 */
|
||||
"Measures": "1.佩戴个人防护装备:所有高空作业人员必须佩戴符合国家标准的安全帽、安全带、防滑鞋等个人防护装备,并定期检查这些设备的完好性;\r\n2.设置安全设施:在可能坠落的高度处安装安全网、护栏和踢脚板,以防止施工人员意外跌落,并避免小物件掉落伤人。\r\n3.进行安全技术交底:在施工前,必须进行针对性的书面安全交底,确保所有参与人员了解安全技术措施和个人防护要求。", /* 重点措施 */
|
||||
"MeasuresSize": 35, /* 重点措施字体大小 */
|
||||
"CPCMember1Path": "/Upload/0.jpg", /* 党员1图片路径 */
|
||||
"CPCMember1Name": "张三", /* 党员1姓名 */
|
||||
"CPCMember2Path": "/Upload/0.jpg", /* 党员2图片路径 */
|
||||
"CPCMember2Name": "李四", /* 党员2姓名 */
|
||||
"CPCMember3Path": "/Upload/0.jpg", /* 党员3图片路径 */
|
||||
"CPCMember3Name": "王五", /* 党员3姓名 */
|
||||
"CPCMember4Path": "/Upload/0.jpg", /* 党员4图片路径 */
|
||||
"CPCMember4Name": "赵六", /* 党员4姓名 */
|
||||
"CPCMemberSize": 35 /* 党员字体大小 */
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
<Application x:Class="电子展板.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:电子展板" >
|
||||
xmlns:local="clr-namespace:电子展板"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -14,15 +14,6 @@ namespace 电子展板
|
||||
public App()
|
||||
{
|
||||
}
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
MainWindow mainWindow = new MainWindow();
|
||||
mainWindow.Show();
|
||||
|
||||
MainWindow2 mainWindow2 = new MainWindow2();
|
||||
mainWindow2.Show();
|
||||
base.OnStartup(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
<div style="width: 132px;margin-left:100px">
|
||||
<div class="layui-upload-list">
|
||||
<img class="layui-upload-img" id="image1" style="width: 100%; height: 92px;" />
|
||||
<img class="layui-upload-img" id="image1" style="width: 100%; height: 150px;" />
|
||||
<div id="upload-text1"></div>
|
||||
</div>
|
||||
<!--<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="filter-progress1">
|
||||
@@ -175,7 +175,7 @@
|
||||
</div>
|
||||
<div style="width: 132px;margin-left:100px">
|
||||
<div class="layui-upload-list">
|
||||
<img class="layui-upload-img" id="image2" style="width: 100%; height: 92px;" />
|
||||
<img class="layui-upload-img" id="image2" style="width: 100%; height: 150px;" />
|
||||
<div id="upload-text2"></div>
|
||||
</div>
|
||||
<!--<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="filter-progress2">
|
||||
@@ -204,7 +204,7 @@
|
||||
</div>
|
||||
<div style="width: 132px;margin-left:100px">
|
||||
<div class="layui-upload-list">
|
||||
<img class="layui-upload-img" id="image3" style="width: 100%; height: 92px;" />
|
||||
<img class="layui-upload-img" id="image3" style="width: 100%; height: 150px;" />
|
||||
<div id="upload-text3"></div>
|
||||
</div>
|
||||
<!--<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="filter-progress3">
|
||||
@@ -233,7 +233,7 @@
|
||||
</div>
|
||||
<div style="width: 132px;margin-left:100px">
|
||||
<div class="layui-upload-list">
|
||||
<img class="layui-upload-img" id="image4" style="width: 100%; height: 92px;" />
|
||||
<img class="layui-upload-img" id="image4" style="width: 100%; height: 150px;" />
|
||||
<div id="upload-text4"></div>
|
||||
</div>
|
||||
<!--<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="filter-progress4">
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
xmlns:vm="clr-namespace:电子展板.ViewModels"
|
||||
ResizeMode="NoResize"
|
||||
WindowStyle="None"
|
||||
WindowState="Maximized"
|
||||
mc:Ignorable="d"
|
||||
x:Name="window"
|
||||
Title="MainWindow" Background="#E5E5E5">
|
||||
@@ -27,69 +28,82 @@
|
||||
<Viewbox Stretch="Uniform" >
|
||||
<Canvas Width="1920" Height="1080">
|
||||
<Grid Width="1920" Height="1080">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="80"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="140"/>
|
||||
<RowDefinition Height="80"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="6*"/>
|
||||
<ColumnDefinition Width="8*"/>
|
||||
<ColumnDefinition Width="6*"/>
|
||||
<ColumnDefinition Width="50"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Row="0" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="时间:" Grid.Column="0" FontSize="60" Foreground="#1F7572" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0"/>
|
||||
<Border Grid.Column="1" Background="#C0E3D9" CornerRadius="20" Height="140">
|
||||
<TextBlock Text="时间:" FontSize="50" Foreground="#1F7572" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="95,18,0,0"/>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" Height="80" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="250,12,0,0" Width="277">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{Binding Config.TimeSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.Time}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="0" Grid.Column="2" Margin="40,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="240"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="负责人:" Grid.Column="0" FontSize="60" Foreground="#1F7572" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0"/>
|
||||
<Border Grid.Column="1" Background="#C0E3D9" CornerRadius="20" Height="140">
|
||||
|
||||
<TextBlock Text="负责人:" FontSize="50" Foreground="#1F7572" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="718,18,0,0"/>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" Height="80" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="925,10,0,0" Width="263">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{Binding Config.ChargerSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.Charger}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Row="0" Grid.Column="3" Margin="40,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="270"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="风险等级:" Grid.Column="0" FontSize="60" Foreground="#1F7572" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0"/>
|
||||
<Border Grid.Column="1" Background="#C0E3D9" CornerRadius="20" Height="140">
|
||||
|
||||
<TextBlock Text="风险等级:" FontSize="50" Foreground="#1F7572" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1335,18,0,0"/>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" Height="85" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1620,7,0,0" Width="240">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="{Binding Config.RiskLevelSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.RiskLevel}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="工作内容:" FontSize="60" Foreground="#1F7572" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0"/>
|
||||
<Border Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Background="#C0E3D9" CornerRadius="20" Margin="0,40,0,40">
|
||||
<TextBlock Text="工作内容" FontSize="50" Foreground="#1F7572" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="145,116,0,0"/>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="35,205,0,0" Width="485" Height="820" >
|
||||
<TextBlock HorizontalAlignment="Left" Margin="10" VerticalAlignment="Top" FontSize="{Binding Config.ContentSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.Content}"/>
|
||||
</Border>
|
||||
|
||||
<TextBlock Text="危险点" FontSize="50" Foreground="#1F7572" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="636,116,0,0" Height="65" Width="164"/>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="541,205,0,0" Height="820" Width="394">
|
||||
<TextBlock Margin="10" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{Binding Config.DangerPointSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.DangerPoint}"/>
|
||||
</Border>
|
||||
<TextBlock Text="重点管控措施" FontSize="50" Foreground="#1F7572" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1005,130,0,0" Height="65" Width="339"/>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="960,205,0,0" Height="820" Width="455">
|
||||
<TextBlock Margin="10" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{Binding Config.MeasuresSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.Measures}"/>
|
||||
</Border>
|
||||
|
||||
<TextBlock Text="党员亮身份" FontSize="50" Foreground="#1F7572" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1540,130,0,0" Height="65" Width="320"/>
|
||||
|
||||
<Border Background="#C0E3D9" CornerRadius="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1452,205,0,0" Height="385" Width="223">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image1}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember1Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1687,205,0,0" Height="385" Width="223">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image2}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember2Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
|
||||
|
||||
<Border Background="#C0E3D9" CornerRadius="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1452,635,0,0" Height="385" Width="223">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image3}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember3Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Background="#C0E3D9" CornerRadius="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1687,635,0,0" Height="385" Width="223">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image4}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember4Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
<Window xmlns:hc="https://handyorg.github.io/handycontrol" x:Class="电子展板.MainWindow2"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:电子展板"
|
||||
xmlns:vm="clr-namespace:电子展板.ViewModels"
|
||||
ResizeMode="NoResize"
|
||||
WindowStyle="None"
|
||||
x:Name="window"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Background="#E5E5E5">
|
||||
<Window.DataContext>
|
||||
<vm:MainWindow2ViewModel/>
|
||||
</Window.DataContext>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Loaded">
|
||||
<i:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=window}"/>
|
||||
</i:EventTrigger>
|
||||
<i:EventTrigger EventName="Closing">
|
||||
<i:InvokeCommandAction Command="{Binding WindowClosingCommand}" PassEventArgsToCommand="True"/>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<Grid>
|
||||
<Viewbox Stretch="Uniform" >
|
||||
<Canvas Width="1920" Height="1080">
|
||||
<Grid Width="1920" Height="1080">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition Height="70"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="460"/>
|
||||
<ColumnDefinition Width="50"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="危险点" Grid.Row="1" Grid.Column="1" FontSize="60" Foreground="#1F7572" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
|
||||
<TextBlock Text="重点管控措施" Grid.Row="1" Grid.Column="2" FontSize="60" Foreground="#1F7572" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
|
||||
<TextBlock Text="党员亮身份" Grid.Row="1" Grid.Column="3" FontSize="60" Foreground="#1F7572" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="1" Background="#C0E3D9" CornerRadius="20" Margin="0,20,20,50">
|
||||
<TextBlock Margin="10" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{Binding Config.DangerPointSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.DangerPoint}"/>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Grid.Column="2" Background="#C0E3D9" CornerRadius="20" Margin="25,20,20,50">
|
||||
<TextBlock Margin="10" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="{Binding Config.MeasuresSize}" Foreground="Black" TextWrapping="Wrap" Text="{Binding Config.Measures}"/>
|
||||
</Border>
|
||||
<Grid Grid.Row="2" Grid.Column="3" Margin="20,20,0,50">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Grid.Column="0" Background="#C0E3D9" CornerRadius="20" Margin="10,0,5,5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image1}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember1Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="1" Background="#C0E3D9" CornerRadius="20" Margin="5,0,10,5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image2}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember2Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="0" Background="#C0E3D9" CornerRadius="20" Margin="10,5,5,0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image3}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember3Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Grid.Column="1" Background="#C0E3D9" CornerRadius="20" Margin="5,5,10,0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="80"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Margin="10" Source="{Binding Image4}" Stretch="Uniform" />
|
||||
<TextBlock Text="{Binding Config.CPCMember4Name}" Grid.Row="1" FontSize="{Binding Config.CPCMemberSize}" Foreground="Black" TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,28 +0,0 @@
|
||||
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.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace 电子展板
|
||||
{
|
||||
/// <summary>
|
||||
/// MainWindow2.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MainWindow2 : Window
|
||||
{
|
||||
public MainWindow2()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,44 +122,47 @@ namespace 电子展板.Models
|
||||
/// 转换成JSON字符串
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string ToJson()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("{");
|
||||
//得到所有的Property
|
||||
var properties = GetType().GetProperties();
|
||||
for (int i = 0; i < properties.Length; i++)
|
||||
{
|
||||
var property = properties[i];
|
||||
string endChar = ",";
|
||||
if (i == properties.Length - 1)
|
||||
{
|
||||
endChar = "";
|
||||
}
|
||||
var comment = property.GetCustomAttributes(typeof(CommentAttribute), false).FirstOrDefault() as CommentAttribute;
|
||||
string commentText = "";
|
||||
if (comment != null)
|
||||
{
|
||||
commentText = $" /* {comment.Comment} */";
|
||||
}
|
||||
string propertyName = property.Name;
|
||||
var value = property.GetValue(this, null);
|
||||
if (value != null)
|
||||
{
|
||||
var valueType = value.GetType();
|
||||
if (valueType == typeof(string))
|
||||
{
|
||||
sb.AppendLine($" \"{propertyName}\":\"{value}\"{endChar}{commentText}");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine($" \"{propertyName}\":{value}{endChar}{commentText}");
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.AppendLine("}");
|
||||
return sb.ToString();
|
||||
}
|
||||
//public string ToJson()
|
||||
//{
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.AppendLine("{");
|
||||
// //得到所有的Property
|
||||
// var properties = GetType().GetProperties();
|
||||
// for (int i = 0; i < properties.Length; i++)
|
||||
// {
|
||||
// var property = properties[i];
|
||||
// string endChar = ",";
|
||||
// if (i == properties.Length - 1)
|
||||
// {
|
||||
// endChar = "";
|
||||
// }
|
||||
// var comment = property.GetCustomAttributes(typeof(CommentAttribute), false).FirstOrDefault() as CommentAttribute;
|
||||
// string commentText = "";
|
||||
// if (comment != null)
|
||||
// {
|
||||
// commentText = $" /* {comment.Comment} */";
|
||||
// }
|
||||
// string propertyName = property.Name;
|
||||
// var value = property.GetValue(this, null);
|
||||
// if (value != null)
|
||||
// {
|
||||
// var valueType = value.GetType();
|
||||
// if (valueType == typeof(string))
|
||||
// {
|
||||
// string value1 = (string)value;
|
||||
// value1 = value1.Replace("\"", "\\\"");
|
||||
// value1 = value1.Replace("\r\n", "\\r\\n");
|
||||
// sb.AppendLine($" \"{propertyName}\":\"{value1}\"{endChar}{commentText}");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// sb.AppendLine($" \"{propertyName}\":{value}{endChar}{commentText}");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// sb.AppendLine("}");
|
||||
// return sb.ToString();
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using 电子展板.Base;
|
||||
using 电子展板.Utility;
|
||||
using 电子展板.Utility.Extension;
|
||||
|
||||
namespace 电子展板.ViewModels
|
||||
{
|
||||
public class MainWindow2ViewModel : ViewModelBase
|
||||
{
|
||||
private Window window;
|
||||
public DelegateCommand<Window> LoadedCommand { get; set; }
|
||||
public DelegateCommand<CancelEventArgs> WindowClosingCommand { get; set; }
|
||||
public ImageSource Image1 { get; set; }
|
||||
public ImageSource Image2 { get; set; }
|
||||
public ImageSource Image3 { get; set; }
|
||||
public ImageSource Image4 { get; set; }
|
||||
public MainWindow2ViewModel()
|
||||
{
|
||||
LoadedCommand = new DelegateCommand<Window>(Loaded);
|
||||
WindowClosingCommand = new DelegateCommand<CancelEventArgs>(WindowClosing);
|
||||
EventBus.Instance.Subscribe(this, "save", ReloadImage);
|
||||
InitImage();
|
||||
}
|
||||
|
||||
private void ReloadImage(string obj)
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
InitImage();
|
||||
});
|
||||
}
|
||||
|
||||
private void InitImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
BitmapImage image1 = new BitmapImage();
|
||||
image1.BeginInit();
|
||||
image1.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image1.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember1Path)));
|
||||
image1.EndInit();
|
||||
image1.Freeze();
|
||||
Image1 = image1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image1 = null;
|
||||
}
|
||||
try
|
||||
{
|
||||
BitmapImage image2 = new BitmapImage();
|
||||
image2.BeginInit();
|
||||
image2.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image2.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember2Path)));
|
||||
image2.EndInit();
|
||||
image2.Freeze();
|
||||
Image2 = image2;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image2 = null;
|
||||
|
||||
}
|
||||
try
|
||||
{
|
||||
BitmapImage image3 = new BitmapImage();
|
||||
image3.BeginInit();
|
||||
image3.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image3.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember3Path)));
|
||||
image3.EndInit();
|
||||
image3.Freeze();
|
||||
Image3 = image3;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image3 = null;
|
||||
}
|
||||
try
|
||||
{
|
||||
BitmapImage image4 = new BitmapImage();
|
||||
image4.BeginInit();
|
||||
image4.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image4.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember4Path)));
|
||||
image4.EndInit();
|
||||
image4.Freeze();
|
||||
Image4 = image4;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image4 = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Loaded(Window window)
|
||||
{
|
||||
this.window = window;
|
||||
Screen[] screens = Screen.AllScreens;
|
||||
if (screens.Length > 1)
|
||||
{
|
||||
int screenIndex = 1;
|
||||
this.window.Left = (int)(Screen.AllScreens[screenIndex].Bounds.Left / GetDpiScaleX());
|
||||
this.window.Top = (int)(Screen.AllScreens[screenIndex].Bounds.Top / GetDpiScaleX());
|
||||
this.window.Width = (int)(Screen.AllScreens[screenIndex].Bounds.Width / GetDpiScaleX());
|
||||
this.window.Height = (int)(Screen.AllScreens[screenIndex].Bounds.Height / GetDpiScaleX());
|
||||
}
|
||||
else
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 界面关闭时
|
||||
/// </summary>
|
||||
public void WindowClosing(CancelEventArgs args)
|
||||
{
|
||||
|
||||
GlobalVariable.WebServer?.Stop();
|
||||
GlobalVariable.WebServer?.Dispose();
|
||||
GlobalVariable.WebServer = null;
|
||||
Screen[] screens = Screen.AllScreens;
|
||||
if (screens.Length > 1)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public double GetDpiScaleX()
|
||||
{
|
||||
return VisualTreeHelper.GetDpi(this.window).DpiScaleX;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,25 +4,35 @@ using Nancy.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using 电子展板.Base;
|
||||
using 电子展板.Utility;
|
||||
using 电子展板.Utility.Extension;
|
||||
|
||||
namespace 电子展板.ViewModels
|
||||
{
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
private Window window;
|
||||
public ImageSource Image1 { get; set; }
|
||||
public ImageSource Image2 { get; set; }
|
||||
public ImageSource Image3 { get; set; }
|
||||
public ImageSource Image4 { get; set; }
|
||||
public DelegateCommand<Window> LoadedCommand { get; set; }
|
||||
public DelegateCommand<CancelEventArgs> WindowClosingCommand { get; set; }
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
LoadedCommand = new DelegateCommand<Window>(Loaded);
|
||||
WindowClosingCommand = new DelegateCommand<CancelEventArgs>(WindowClosing);
|
||||
EventBus.Instance.Subscribe(this, "save", ReloadImage);
|
||||
InitImage();
|
||||
}
|
||||
|
||||
private void Loaded(Window window)
|
||||
@@ -48,5 +58,75 @@ namespace 电子展板.ViewModels
|
||||
{
|
||||
return VisualTreeHelper.GetDpi(this.window).DpiScaleX;
|
||||
}
|
||||
|
||||
|
||||
private void ReloadImage(string obj)
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
InitImage();
|
||||
});
|
||||
}
|
||||
|
||||
private void InitImage()
|
||||
{
|
||||
try
|
||||
{
|
||||
BitmapImage image1 = new BitmapImage();
|
||||
image1.BeginInit();
|
||||
image1.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image1.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember1Path)));
|
||||
image1.EndInit();
|
||||
image1.Freeze();
|
||||
Image1 = image1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image1 = null;
|
||||
}
|
||||
try
|
||||
{
|
||||
BitmapImage image2 = new BitmapImage();
|
||||
image2.BeginInit();
|
||||
image2.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image2.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember2Path)));
|
||||
image2.EndInit();
|
||||
image2.Freeze();
|
||||
Image2 = image2;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image2 = null;
|
||||
|
||||
}
|
||||
try
|
||||
{
|
||||
BitmapImage image3 = new BitmapImage();
|
||||
image3.BeginInit();
|
||||
image3.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image3.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember3Path)));
|
||||
image3.EndInit();
|
||||
image3.Freeze();
|
||||
Image3 = image3;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image3 = null;
|
||||
}
|
||||
try
|
||||
{
|
||||
BitmapImage image4 = new BitmapImage();
|
||||
image4.BeginInit();
|
||||
image4.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image4.StreamSource = new MemoryStream(File.ReadAllBytes(MyEnvironment.Root(Config.CPCMember4Path)));
|
||||
image4.EndInit();
|
||||
image4.Freeze();
|
||||
Image4 = image4;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Image4 = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<!--<PackageReference Include="Costura.Fody" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>-->
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
||||
Reference in New Issue
Block a user