Переглянути джерело

主界面frame更换为tabcontrol.
增加PLC监控界面连接按钮和监控按钮启用判断.

user_zyx 7 місяців тому
батько
коміт
3faa5e1142
37 змінених файлів з 147 додано та 116 видалено
  1. BIN
      B20UVLog/LogPcTask_Biz.cs
  2. 53 33
      B20UVLog/MainWindow.xaml
  3. BIN
      B20UVLog/MainWindow.xaml.cs
  4. 7 6
      B20UVLog/Pages/ANALogData.xaml
  5. BIN
      B20UVLog/Pages/ANALogData.xaml.cs
  6. 5 5
      B20UVLog/Pages/Alarm.xaml
  7. BIN
      B20UVLog/Pages/Alarm.xaml.cs
  8. 5 5
      B20UVLog/Pages/AxisData.xaml
  9. BIN
      B20UVLog/Pages/AxisData.xaml.cs
  10. 5 5
      B20UVLog/Pages/EQPStatus.xaml
  11. BIN
      B20UVLog/Pages/EQPStatus.xaml.cs
  12. 5 5
      B20UVLog/Pages/GlassInformation.xaml
  13. BIN
      B20UVLog/Pages/GlassInformation.xaml.cs
  14. 9 6
      B20UVLog/Pages/IO.xaml
  15. BIN
      B20UVLog/Pages/IO.xaml.cs
  16. 5 5
      B20UVLog/Pages/LampData.xaml
  17. BIN
      B20UVLog/Pages/LampData.xaml.cs
  18. 8 6
      B20UVLog/Pages/LampUseTime.xaml
  19. BIN
      B20UVLog/Pages/LampUseTime.xaml.cs
  20. 8 6
      B20UVLog/Pages/RecipeBody.xaml
  21. BIN
      B20UVLog/Pages/RecipeBody.xaml.cs
  22. 8 6
      B20UVLog/Pages/RecipeCount.xaml
  23. BIN
      B20UVLog/Pages/RecipeCount.xaml.cs
  24. 6 6
      B20UVLog/Pages/RobotInterfaceIn.xaml
  25. BIN
      B20UVLog/Pages/RobotInterfaceIn.xaml.cs
  26. 5 5
      B20UVLog/Pages/RobotInterfaceOut.xaml
  27. BIN
      B20UVLog/Pages/RobotInterfaceOut.xaml.cs
  28. 5 5
      B20UVLog/Pages/SYSPara.xaml
  29. BIN
      B20UVLog/Pages/SYSPara.xaml.cs
  30. 5 5
      B20UVLog/Pages/ServoAxisStatus.xaml
  31. BIN
      B20UVLog/Pages/ServoAxisStatus.xaml.cs
  32. 6 6
      B20UVLog/Pages/YMeasureData.xaml
  33. BIN
      B20UVLog/Pages/YMeasureData.xaml.cs
  34. BIN
      B20UVLog/ViewModels/MainWindowViewModel.cs
  35. 2 1
      B20UVLog/Windows/PLCSet.xaml
  36. BIN
      B20UVLog/Windows/PLCSet.xaml.cs
  37. BIN
      dll/MyWPFControl.dll

BIN
B20UVLog/LogPcTask_Biz.cs


+ 53 - 33
B20UVLog/MainWindow.xaml

@@ -1,12 +1,14 @@
 <My:MWindow  xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl"
-                   x:Class="B20UVLog.MainWindow"
-        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:local="clr-namespace:B20UVLog" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
+             x:Class="B20UVLog.MainWindow"
+             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:local="clr-namespace:B20UVLog"
+             xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels" 
+             xmlns:pages="clr-namespace:B20UVLog.Pages"
              mc:Ignorable="d"
-        Title="UV Log" Height="960" Width="1800"
+             Title="UV Log" Height="960" Width="1800"
              WindowState="Maximized"
              Loaded="MWindow_Loaded">
     <Window.DataContext>
@@ -33,32 +35,50 @@
                 </MenuItem.Icon>
             </MenuItem>
         </Menu>
-        <Grid Grid.Row="1">
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="200"/>
-                <ColumnDefinition Width="*"/>
-            </Grid.ColumnDefinitions>
-            <Grid Grid.Column="1">
-                <Frame x:Name="FrameContent" NavigationUIVisibility="Hidden" Margin="10" Source="Pages/AxisData.xaml"></Frame>
-            </Grid>
-            <TreeView Grid.Column="0" SelectedItemChanged="TreeView_SelectedItemChanged">
-                <My:MTreeViewItem Header="Axis Data" IsSelected="True"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Servo Axis Status"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Glass Information"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Lamp Use Time"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Recipe Body"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="SYS Para"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Robot Interface In"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Robot Interface Out"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Y Measure Data"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="EQP Status"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Recipe Count"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="ANALog Data"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Lamp Data"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="Alarm And Warning"></My:MTreeViewItem>
-                <My:MTreeViewItem Header="IO"></My:MTreeViewItem>
-            </TreeView>
-        </Grid>
+        <My:MTabControl Grid.Row="1" TabStripPlacement="Left">
+            <My:MTabItem Header="Axis Data">
+                <pages:AxisData/>
+            </My:MTabItem>
+            <My:MTabItem Header="Servo Axis Status">
+                <pages:ServoAxisStatus/>
+            </My:MTabItem>
+            <My:MTabItem Header="Glass Information">
+                <pages:GlassInformation/>
+            </My:MTabItem>
+            <My:MTabItem Header="Lamp Use Time">
+                <pages:LampUseTime/>
+            </My:MTabItem>
+            <My:MTabItem Header="Recipe Body">
+                <pages:RecipeBody/>
+            </My:MTabItem>
+            <My:MTabItem Header="SYS Para">
+                <pages:SYSPara/>
+            </My:MTabItem>
+            <My:MTabItem Header="Robot In">
+                <pages:RobotInterfaceIn/>
+            </My:MTabItem>
+            <My:MTabItem Header="Robot Out">
+                <pages:RobotInterfaceOut/>
+            </My:MTabItem>
+            <My:MTabItem Header="Y Measure Data">
+                <pages:YMeasureData/>
+            </My:MTabItem>
+            <My:MTabItem Header="EQP Status">
+                <pages:EQPStatus/>
+            </My:MTabItem>
+            <My:MTabItem Header="Recipe Count">
+                <pages:RecipeCount/>
+            </My:MTabItem>
+            <My:MTabItem Header="ANALog Data">
+                <pages:ANALogData/>
+            </My:MTabItem>
+            <My:MTabItem Header="Alarn &amp; Warn">
+                <pages:Alarm/>
+            </My:MTabItem>
+            <My:MTabItem Header="IO">
+                <pages:IO/>
+            </My:MTabItem>
+        </My:MTabControl>
         <StackPanel Grid.Row="2" Orientation="Horizontal" IsHitTestVisible="False">
             <!--<My:MCheckBox IsChecked="{Binding PLCStatus}">PLC连接状态</My:MCheckBox>
             <My:MCheckBox IsChecked="{Binding DBStatus}">数据库连接状态</My:MCheckBox>-->

BIN
B20UVLog/MainWindow.xaml.cs


+ 7 - 6
B20UVLog/Pages/ANALogData.xaml

@@ -1,15 +1,16 @@
-<Page x:Class="B20UVLog.Pages.ANALogData"
+<UserControl x:Class="B20UVLog.Pages.ANALogData"
       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:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
+      xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" 
+      xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="ANALogData">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:ANALogDataViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -90,4 +91,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/ANALogData.xaml.cs


+ 5 - 5
B20UVLog/Pages/Alarm.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.Alarm"
+<UserControl x:Class="B20UVLog.Pages.Alarm"
       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" 
@@ -6,10 +6,10 @@
       xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="Alarm">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:AlarmViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -56,4 +56,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/Alarm.xaml.cs


+ 5 - 5
B20UVLog/Pages/AxisData.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.AxisData"
+<UserControl x:Class="B20UVLog.Pages.AxisData"
       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" 
@@ -8,10 +8,10 @@
       xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels" 
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="AxisData">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:AxisDataViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -141,4 +141,4 @@
             </Border>
         </Popup>
     </Grid>
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/AxisData.xaml.cs


+ 5 - 5
B20UVLog/Pages/EQPStatus.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.EQPStatus"
+<UserControl x:Class="B20UVLog.Pages.EQPStatus"
       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" 
@@ -6,10 +6,10 @@
       xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="EQPStatus">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:EQPStatusViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -43,4 +43,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/EQPStatus.xaml.cs


+ 5 - 5
B20UVLog/Pages/GlassInformation.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.GlassInformation"
+<UserControl x:Class="B20UVLog.Pages.GlassInformation"
       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" 
@@ -6,10 +6,10 @@
       xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="GlassInformation">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:GlassInformationViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -95,4 +95,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/GlassInformation.xaml.cs


+ 9 - 6
B20UVLog/Pages/IO.xaml

@@ -1,15 +1,18 @@
-<Page x:Class="B20UVLog.Pages.IO"
+<UserControl x:Class="B20UVLog.Pages.IO"
       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:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels" xmlns:controls="clr-namespace:B20UVLog.Controls"
+      xmlns:local="clr-namespace:B20UVLog.Pages" 
+             xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" 
+             xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels" 
+             xmlns:controls="clr-namespace:B20UVLog.Controls"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="IO">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:IOViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -864,4 +867,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/IO.xaml.cs


+ 5 - 5
B20UVLog/Pages/LampData.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.LampData"
+<UserControl x:Class="B20UVLog.Pages.LampData"
       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" 
@@ -6,10 +6,10 @@
       xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="LampData">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:LampDataViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -124,4 +124,4 @@
         </Grid>
 
     </Grid>
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/LampData.xaml.cs


+ 8 - 6
B20UVLog/Pages/LampUseTime.xaml

@@ -1,15 +1,17 @@
-<Page x:Class="B20UVLog.Pages.LampUseTime"
+<UserControl x:Class="B20UVLog.Pages.LampUseTime"
       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:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
+      xmlns:local="clr-namespace:B20UVLog.Pages" 
+             xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" 
+             xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="LampUseTime">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:LampUseTimeViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -55,4 +57,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/LampUseTime.xaml.cs


+ 8 - 6
B20UVLog/Pages/RecipeBody.xaml

@@ -1,15 +1,17 @@
-<Page x:Class="B20UVLog.Pages.RecipeBody"
+<UserControl x:Class="B20UVLog.Pages.RecipeBody"
       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:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
+      xmlns:local="clr-namespace:B20UVLog.Pages" 
+             xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" 
+             xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="RecipeBody">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:RecipeBodyViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -123,4 +125,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/RecipeBody.xaml.cs


+ 8 - 6
B20UVLog/Pages/RecipeCount.xaml

@@ -1,15 +1,17 @@
-<Page x:Class="B20UVLog.Pages.RecipeCount"
+<UserControl x:Class="B20UVLog.Pages.RecipeCount"
       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:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
+      xmlns:local="clr-namespace:B20UVLog.Pages" 
+             xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl"
+             xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="RecipeCount">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded" >
+    <UserControl.DataContext>
         <viewmodels:RecipeCountViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -42,4 +44,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/RecipeCount.xaml.cs


+ 6 - 6
B20UVLog/Pages/RobotInterfaceIn.xaml

@@ -1,15 +1,15 @@
-<Page x:Class="B20UVLog.Pages.RobotInterfaceIn"
+<UserControl x:Class="B20UVLog.Pages.RobotInterfaceIn"
       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:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
-      d:DesignHeight="800" d:DesignWidth="1600"
-      Title="RobotInterface">
-    <Page.DataContext>
+      d:DesignHeight="800" d:DesignWidth="1600" 
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:RobotInterfaceInViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -132,4 +132,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/RobotInterfaceIn.xaml.cs


+ 5 - 5
B20UVLog/Pages/RobotInterfaceOut.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.RobotInterfaceOut"
+<UserControl x:Class="B20UVLog.Pages.RobotInterfaceOut"
       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" 
@@ -6,10 +6,10 @@
       xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="800" d:DesignWidth="1600"
-      Title="RobotInterface">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded" >
+    <UserControl.DataContext>
         <viewmodels:RobotInterfaceOutViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -132,4 +132,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/RobotInterfaceOut.xaml.cs


+ 5 - 5
B20UVLog/Pages/SYSPara.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.SYSPara"
+<UserControl x:Class="B20UVLog.Pages.SYSPara"
       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" 
@@ -6,10 +6,10 @@
       xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="SYSPara">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded" >
+    <UserControl.DataContext>
         <viewmodels:SysParaViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -625,4 +625,4 @@
         </WrapPanel>
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/SYSPara.xaml.cs


+ 5 - 5
B20UVLog/Pages/ServoAxisStatus.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.ServoAxisStatus"
+<UserControl x:Class="B20UVLog.Pages.ServoAxisStatus"
       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" 
@@ -6,10 +6,10 @@
       xmlns:local="clr-namespace:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
-      Title="ServoAxisStatus">
-    <Page.DataContext>
+             Loaded="UserControl_Loaded" >
+    <UserControl.DataContext>
         <viewmodels:ServoAxisStatusViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -46,4 +46,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/ServoAxisStatus.xaml.cs


+ 6 - 6
B20UVLog/Pages/YMeasureData.xaml

@@ -1,4 +1,4 @@
-<Page x:Class="B20UVLog.Pages.YMeasureData"
+<UserControl x:Class="B20UVLog.Pages.YMeasureData"
       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" 
@@ -8,11 +8,11 @@
       xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
       xmlns:sys="clr-namespace:System;assembly=mscorlib"
       mc:Ignorable="d" 
-      d:DesignHeight="450" d:DesignWidth="800"
-      Title="YMeasureData">
-    <Page.DataContext>
+      d:DesignHeight="450" d:DesignWidth="800" 
+             Loaded="UserControl_Loaded">
+    <UserControl.DataContext>
         <viewmodels:YMeasureDataViewModel/>
-    </Page.DataContext>
+    </UserControl.DataContext>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="auto"/>
@@ -86,4 +86,4 @@
 
     </Grid>
 
-</Page>
+</UserControl>

BIN
B20UVLog/Pages/YMeasureData.xaml.cs


BIN
B20UVLog/ViewModels/MainWindowViewModel.cs


+ 2 - 1
B20UVLog/Windows/PLCSet.xaml

@@ -30,7 +30,8 @@
             <My:MButton Type="Primary" x:Name="BtnChangeIpAndPort" Content="修改IP地址端口号"  Click="BtnChangeIpAndPort_Click" />
             <My:MButton Type="Primary" x:Name="BtnConnectPLC" Content="连接PLC"  Click="BtnConnectPLC_Click" />
             <My:MButton Type="Primary" x:Name="BtnStartPlcLogMonitor" Content="开启PLC监控"  Click="BtnStartPlcLogMonitor_Click" />
-            <My:MButton Type="Primary" x:Name="BtnDisConnectPLC" Content="断开PLC连接"  Click="BtnDisConnectPLC_Click" />
+            <My:MButton Type="Primary" x:Name="BtnDisConnectPLC" Content="断开PLC连接"  Click="BtnDisConnectPLC_Click"
+                        IsEnabled="{Binding ElementName=BtnConnectPLC,Path=IsEnabled,Converter={StaticResource ConverterInverseBool}}"/>
         </WrapPanel>
         <WrapPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
             <TextBlock Text="PLC地址:"/>

BIN
B20UVLog/Windows/PLCSet.xaml.cs


BIN
dll/MyWPFControl.dll