मैं आदेश के बाद किया है:RelayCommand CanExecute व्यवहार
<Button x:Name="bOpenConnection" Content="Start Production"
Grid.Row="0" Grid.Column="0"
Height="30" Width="120" Margin="10"
HorizontalAlignment="Left" VerticalAlignment="Top"
Command="{Binding Path=StartProductionCommand}"/>
StartProductionCommand = new RelayCommand(OpenConnection, CanStartProduction);
private bool CanStartProduction()
{
return LogContent != null && !_simulationObject.Connected;
}
CanStartProduction
केवल जब मैं फिर से आकार यूआई चेक किया गया है और मक्खी पर अद्यतन नहीं। कोई विचार क्यों हर बार जब वे मूल्य बदलते हैं तो इसे अपडेट नहीं किया जाता है?
क्या आप इसका उदाहरण कैसे उपयोग कर सकते हैं या पोस्ट लिंक कर सकते हैं? मेरा मतलब है कि आप इसे कहां कहते हैं? – batmaci
@batmaci, आप केवल 'CommandManager.InvalidateRequerySuggested' को कॉल करते हैं जब आप अपने आदेश का 'CanExecute' पुन: मूल्यांकन करना चाहते हैं –