浏览代码

no message

jangwon 4 年之前
父节点
当前提交
68b3295972

+ 1 - 1
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoView.xaml

@@ -453,7 +453,7 @@
                     </Button>
                 </StackPanel>
             </Grid>
-            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{DynamicResource ResourceKey=SettingView_DriveWarning}" TextAlignment="Center" Foreground="#DDFF0000" VerticalAlignment="Top" Margin="0,526,0,-132" Grid.Row="1" Height="100" Width="1126" FontSize="78" Grid.ColumnSpan="2"/>
+            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{DynamicResource ResourceKey=SettingView_DriveWarning}" TextAlignment="Center" Foreground="#DDFF0000" VerticalAlignment="Top" Margin="0,526,0,-132" Grid.Row="1" Height="100" Width="1126" FontSize="78" Grid.ColumnSpan="2" Visibility="{c:Binding 'OcsState == OHVCommonShareds:eOcsState.DisConnect'}" />
 
             <!--<xctk:BusyIndicator x:Name="MyProgress" Grid.RowSpan="2" Grid.ColumnSpan="2" IsBusy="{Binding IsBusy, FallbackValue=true}" BusyContent="{Binding BusyText}"/>-->
 

+ 17 - 9
Dev/OHV/OHV.Module.Interactivity/PopUp/DriveServoViewModel.cs

@@ -222,13 +222,19 @@ namespace OHV.Module.Interactivity.PopUp
             set { SetProperty(ref this.busyText, value); }
         }
 
-        private bool warningEnabled;
-        public bool WarningEnabled
+        //private bool warningEnabled;
+        //public bool WarningEnabled
+        //{
+        //    get { return warningEnabled; }
+        //    set { SetProperty(ref this.warningEnabled, value); }
+        //}
+
+        eOcsState ocsState = eOcsState.DisConnect;
+        public eOcsState OcsState
         {
-            get { return warningEnabled; }
-            set { SetProperty(ref this.warningEnabled, value); }
+            get { return this.ocsState; }
+            set { this.SetProperty(ref this.ocsState, value); }
         }
-
         #endregion
 
         VCSystem vcSystem;
@@ -283,7 +289,7 @@ namespace OHV.Module.Interactivity.PopUp
             var ezIO = this.vcSystem.IO as EzIO;
             ezIO.OnChangedIO += EzIO_OnChangedIO;
 
-            WarningEnabled = true;
+            //WarningEnabled = true;
         }
 
         private void ExecuteBreakOffCommand()
@@ -592,13 +598,15 @@ namespace OHV.Module.Interactivity.PopUp
         {
             var state = obj.State;
 
-            switch(state)
+            switch (state)
             {
                 case HostConnectedEventArgs.eConnectedState.Connected:
-                    WarningEnabled = false;
+                    this.OcsState = eOcsState.Connect;
+                    //WarningEnabled = false;
                     break;
                 case HostConnectedEventArgs.eConnectedState.Disconnected:
-                    WarningEnabled = true;
+                    this.OcsState = eOcsState.DisConnect;
+                    //WarningEnabled = true;
                     break;
             }
         }