modifica abilitazione e disabilitazione pulsanti verify e reset

This commit is contained in:
Demetrio Cassarino
2024-01-09 11:26:13 +01:00
parent 1acf67aaa0
commit 804dee9236
3 changed files with 26 additions and 1 deletions
@@ -46,6 +46,16 @@ Public Class CALCPanelVM
End Set
End Property
Private m_VerifyAll_IsEnabled As Boolean = True
Public Property VerifyAll_IsEnabled As Boolean
Get
Return m_VerifyAll_IsEnabled
End Get
Set(value As Boolean)
m_VerifyAll_IsEnabled = value
End Set
End Property
Private m_ChooseMachineBtn_Visibility As Boolean = True
Public Property ChooseMachineBtn_Visibility As Visibility
Get
@@ -208,16 +218,25 @@ Public Class CALCPanelVM
Friend Sub SetCalcPanelIsEnabled(bIsEnabled As Boolean)
m_CALCPanel_IsEnabled = bIsEnabled
m_VerifyAll_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
NotifyPropertyChanged(NameOf(VerifyAll_IsEnabled))
NotifyPropertyChanged(NameOf(Verify_IsEnabled))
NotifyPropertyChanged(NameOf(Simulate_IsEnabled))
NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
Friend Sub SetIsEnabledForSelPart()
NotifyPropertyChanged(NameOf(Verify_IsEnabled))
m_VerifyAll_IsEnabled = False
NotifyPropertyChanged(NameOf(VerifyAll_IsEnabled))
NotifyPropertyChanged(NameOf(Simulate_IsEnabled))
NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
Friend Sub SetVerifyIsEnabled(bIsEnabled As Boolean)
m_CALCPanel_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
NotifyPropertyChanged(NameOf(Verify_IsEnabled))
End Sub
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
ProcessResults(e.m_Result)
@@ -18,7 +18,7 @@
ToolTip="{Binding VerifyAll_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding VerifyAll_Command}"
IsEnabled="{Binding CALCPanel_IsEnabled}">
IsEnabled="{Binding VerifyAll_IsEnabled}">
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ResetCalc_Command}"
@@ -90,6 +90,12 @@ Public Class MyMachGroupPanelVM
NotifyPropertyChanged(NameOf(SelectedMachGroup))
' imposto tipo di grid selezionata
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(value) Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.MACHGROUP)
' se MachGroup gia' mandato in produzione,disabilito pulsanti verify e reset
If Not IsNothing(SelectedMachGroup) AndAlso SelectedMachGroup.nProduction_State >= ItemState.Assigned Then
Map.refCALCPanelVM.SetVerifyIsEnabled(False)
Else
Map.refCALCPanelVM.SetCalcPanelIsEnabled(True)
End If
End Set
End Property