Quellcode durchsuchen

修改了部分bug

luo vor 9 Monaten
Ursprung
Commit
9768898391

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
AppResource/Resource.xaml


+ 2 - 3
ShakerControl/View/IOPage/IOPageView.xaml

@@ -77,11 +77,11 @@
                                                 <Style.Triggers>
                                                     <DataTrigger Binding="{Binding Value}" Value="True">
                                                         <Setter Property="Fill" Value="Red" />
-                                                        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border}, Path=DataContext.Name, StringFormat='{}{0}故障'}" />
+                                                        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Ellipse}, Path=DataContext.Name, StringFormat='{}{0}故障'}" />
                                                     </DataTrigger>
                                                     <DataTrigger Binding="{Binding Value}" Value="False">
                                                         <Setter Property="Fill" Value="Green" />
-                                                        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border}, Path=DataContext.Name, StringFormat='{}{0}正常'}" />
+                                                        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Ellipse}, Path=DataContext.Name, StringFormat='{}{0}正常'}" />
                                                     </DataTrigger>
                                                     <DataTrigger Binding="{Binding Source={StaticResource MainViewModel}, Path=Data.MainPage.ShakerControl.IsConnected}" Value="False">
                                                         <Setter Property="Fill" Value="Gray" />
@@ -108,7 +108,6 @@
                                 <Setter Property="Template">
                                     <Setter.Value>
                                         <ControlTemplate TargetType="ListViewItem">
-
                                             <ContentPresenter
                                                 Content="{TemplateBinding Content}"
                                                 ContentStringFormat="{TemplateBinding ContentStringFormat}"

+ 2 - 1
ShakerControl/ViewModel/CoolingWaterViewModel.cs

@@ -3,6 +3,7 @@ using PLCControl;
 using Shaker.ViewModel;
 using ShakerControl.Data;
 using System.Windows.Input;
+using System.Windows.Media;
 
 namespace ShakerControl.ViewModel
 {
@@ -31,7 +32,7 @@ namespace ShakerControl.ViewModel
         public ICommand ResetCommand => new DelegateCommand(ResetControl);
 
         public bool IsEnable { get => isEnable; set =>UpdateProperty(ref isEnable , value); }
-        public string IconPath{ get; } = App.Current.Resources["CoolingWaterIcon"].ToString()!;
+        public Geometry IconPath{ get; } = (Geometry)App.Current.Resources["CoolingWaterIcon"];
 
         public MainPageType MainPageType => MainPageType.CoolingWater;
 

+ 2 - 1
ShakerControl/ViewModel/DataManger/DataMangerViewModel.cs

@@ -9,6 +9,7 @@ using System.Collections.ObjectModel;
 using OxyPlot;
 using System.Windows;
 using Shaker.ViewModel;
+using System.Windows.Media;
 
 namespace ShakerControl.ViewModel.DataManger
 {
@@ -137,7 +138,7 @@ namespace ShakerControl.ViewModel.DataManger
 
         public bool IsEnable { get => isEnable; set => UpdateProperty(ref isEnable, value); }
 
-        public string IconPath { get; } = App.Current.Resources["DataIcon"].ToString()!;
+        public Geometry IconPath { get; } = (Geometry)App.Current.Resources["DataIcon"];
 
         public MainPageType MainPageType => MainPageType.Data;
         public string ShakerID 

+ 1 - 1
ShakerControl/ViewModel/IMainPageViewModel.cs

@@ -10,7 +10,7 @@ namespace ShakerControl.ViewModel
     internal interface IMainPageViewModel:IDisplayViewModel
     {
         public bool IsEnable { get; set; }
-        public string IconPath { get; }
+        public System.Windows.Media.Geometry IconPath { get; }
         public Data.MainPageType MainPageType { get; }
         
     }

+ 2 - 1
ShakerControl/ViewModel/IO/IOPageViewModel.cs

@@ -6,6 +6,7 @@ using System.Text;
 using System.Threading.Tasks;
 using Shaker.Model;
 using Shaker.ViewModel;
+using System.Windows.Media;
 
 namespace ShakerControl.ViewModel.IO
 {
@@ -14,7 +15,7 @@ namespace ShakerControl.ViewModel.IO
         private bool isEnable = true;
 
         public bool IsEnable { get => isEnable; set =>UpdateProperty(ref isEnable,value); }
-        public string IconPath { get; } = App.Current.Resources["IOIcon"].ToString()!;
+        public Geometry IconPath { get; } = (Geometry)App.Current.Resources["IOIcon"];
         public override Type View { get; } = typeof(View.IOPage.IOPageView);
 
         public MainPageType MainPageType =>  MainPageType.IO;

+ 2 - 1
ShakerControl/ViewModel/Log/LogViewModel.cs

@@ -8,6 +8,7 @@ using Shaker.Model;
 using System.Collections.ObjectModel;
 using System.Windows;
 using Shaker.ViewModel;
+using System.Windows.Media;
 
 namespace ShakerControl.ViewModel.Log
 {
@@ -36,7 +37,7 @@ namespace ShakerControl.ViewModel.Log
 
         public bool IsEnable { get => isEnable; set => UpdateProperty(ref isEnable, value); }
 
-        public string IconPath { get; } = App.Current.Resources["LogIcon"].ToString()!;
+        public Geometry IconPath { get; } = (Geometry)App.Current.Resources["LogIcon"];
 
         public MainPageType MainPageType => MainPageType.Log;
         public ObservableCollection<LogItemViewModel> Logs { get; } = new ObservableCollection<LogItemViewModel>();

+ 2 - 1
ShakerControl/ViewModel/MainPage/MainPageViewModel.cs

@@ -8,6 +8,7 @@ using ShakerControl.Tools;
 using System.Collections.ObjectModel;
 using System.Diagnostics.CodeAnalysis;
 using System.Windows;
+using System.Windows.Media;
 
 namespace ShakerControl.ViewModel.MainPage
 {
@@ -160,7 +161,7 @@ namespace ShakerControl.ViewModel.MainPage
         public override Type View { get; } = typeof(View.MainPage.MainPageView);
         public bool IsEnable { get => isEnable; set =>UpdateProperty(ref isEnable, value); }
 
-        public string IconPath { get; } = App.Current.FindResource("MainIcon")!.ToString()!;
+        public Geometry IconPath { get; } = (Geometry)App.Current.FindResource("MainIcon");
         public ShakerControlViewModel ShakerControl { get => shakerControl; set =>UpdateProperty(ref shakerControl, value); }
         public ObservableCollection<ShakerControlViewModel> Shakers { get; } = new ObservableCollection<ShakerControlViewModel>();
 

+ 2 - 1
ShakerControl/ViewModel/Setting/SettingViewModel.cs

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Media;
 
 namespace ShakerControl.ViewModel.Setting
 {
@@ -14,7 +15,7 @@ namespace ShakerControl.ViewModel.Setting
 
         public bool IsEnable { get => isEnable; set => UpdateProperty(ref isEnable, value); }
 
-        public string IconPath { get; } = App.Current.Resources["SettingIcon"].ToString()!;
+        public Geometry IconPath { get; } = (Geometry)App.Current.Resources["SettingIcon"];
 
         public MainPageType MainPageType => MainPageType.Settings;
         public override Type View { get; } = typeof(ShakerControl.View.ShakerConfig.ShakerConfigView);

+ 2 - 1
ShakerControl/ViewModel/Warn/WarningViewModel.cs

@@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Media;
 
 namespace ShakerControl.ViewModel.Warn
 {
@@ -22,7 +23,7 @@ namespace ShakerControl.ViewModel.Warn
 
         public bool IsEnable { get => isEnable; set => UpdateProperty(ref isEnable, value); }
 
-        public string IconPath { get; } = App.Current.Resources["WarnIcon"].ToString()!;
+        public Geometry IconPath { get; } = (Geometry)App.Current.Resources["WarnIcon"];
 
         public MainPageType MainPageType => MainPageType.Warning;
         public override Type View { get; } = typeof(View.Warn.WarnPageView);

+ 9 - 10
ShakerManger/MainWindow.xaml

@@ -4,7 +4,6 @@
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:data="clr-namespace:ShakerManger.Data"
-    xmlns:effect="clr-namespace:WpfDesignAndAnimationLab.Effects;assembly=WpfDesignAndAnimationLab.Effects"
     xmlns:hc="https://handyorg.github.io/handycontrol"
     xmlns:local="clr-namespace:ShakerManger"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -26,7 +25,7 @@
     WindowStyle="None"
     mc:Ignorable="d">
     <Window.Resources>
-        <Geometry x:Key="MainGeometry">M0,0 L1920,0 L1920,100 L1680,100 L1600,20 L500,20 L420,100 L0,100Z</Geometry>
+        <Geometry x:Key="MainGeometry">M0,0 L1920,0 L1920,100 L1680,100 L1610,20 L600,20 L530,100 L0,100Z</Geometry>
         <vm:BindingProxy x:Key="DeviceControl" Data="{x:Static system:Boolean.FalseString}" />
     </Window.Resources>
     <Window.Background>
@@ -79,14 +78,14 @@
             <Grid.RowDefinitions>
                 <RowDefinition Height="120" />
                 <RowDefinition Height="*" />
-                <RowDefinition Height="24" />
+                <RowDefinition Height="20" />
             </Grid.RowDefinitions>
             <StackPanel
                 Grid.Row="2"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Orientation="Horizontal">
-                <Viewbox Width="32" Height="32">
+                <Viewbox Width="28" Height="28">
                     <Path Data="{StaticResource CEAPGepmetry}" Fill="Red" />
                 </Viewbox>
                 <TextBlock
@@ -128,7 +127,7 @@
                     Text="{StaticResource Title}" />
                 <ListView
                     Height="60"
-                    Margin="460,40,320,0"
+                    Margin="560,40,320,0"
                     IsEnabled="{Binding IsEnabled}"
                     ItemsSource="{Binding MainPages}"
                     SelectedValue="{Binding CurrentMainPage}">
@@ -152,11 +151,11 @@
                                             HorizontalAlignment="Center"
                                             VerticalAlignment="Center"
                                             Background="Transparent"
-                                            IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
+                                            IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
                                             Orientation="Horizontal">
                                             <Grid>
-                                                <Viewbox Stretch="Fill">
-                                                    <Path x:Name="path" Data="M70,0 L270,0 L200,70 L00,70Z">
+                                                <Viewbox Stretch="Fill" Width="200">
+                                                    <Path Data="M70,0 L270,0 L200,70 L00,70Z">
                                                         <Path.Style>
                                                             <Style TargetType="Path">
                                                                 <Style.Triggers>
@@ -224,7 +223,7 @@
                                                         ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                         ContentTemplate="{TemplateBinding ContentTemplate}"
                                                         ContentTemplateSelector="{x:Null}"
-                                                        IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
+                                                        IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
 
                                                 </ControlTemplate>
                                             </Setter.Value>
@@ -1302,7 +1301,7 @@
                                                                         ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                                                         ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                         ContentTemplateSelector="{x:Null}"
-                                                                        IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
+                                                                        IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
 
                                                                 </ControlTemplate>
                                                             </Setter.Value>

+ 0 - 1
ShakerManger/ShakerManger.csproj

@@ -37,7 +37,6 @@
     <ProjectReference Include="..\HandyControl\HandyControl\HandyControl.csproj" />
     <ProjectReference Include="..\OxyPlot\OxyPlot.SkiaSharp.Wpf\OxyPlot.SkiaSharp.Wpf.csproj" />
     <ProjectReference Include="..\Shaker.Model\Shaker.csproj" />
-    <ProjectReference Include="..\WpfDesignAndAnimationLab.Effects\WpfDesignAndAnimationLab.Effects.csproj" />
   </ItemGroup>
 
   <ItemGroup>

+ 11 - 12
ShakerManger/View/TitleView.xaml

@@ -1,13 +1,12 @@
-<UserControl x:Class="ShakerManger.View.TitleView"
-             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:effect="clr-namespace:WpfDesignAndAnimationLab.Effects;assembly=WpfDesignAndAnimationLab.Effects"
-             xmlns:local="clr-namespace:ShakerManger.View"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-            
-    </Grid>
+<UserControl
+    x:Class="ShakerManger.View.TitleView"
+    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:ShakerManger.View"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+    <Grid />
 </UserControl>

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.