-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Design DiscussionOngoing discussion about design without consensusOngoing discussion about design without consensusEnhancement RequestedProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additions
Description
- .NET Core Version: (3.0.0-preview-27122-01)
- Windows version: (
windows 10) - Does the bug reproduce also in WPF for .NET Framework 4.6.1?: Yes
Problem description:
I have a TestCommand as below:
public class TestCommand : ICommand
{
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{
return true;
}
public void Execute(object parameter)
{
}
}and then I use it in a xaml file:
<Button Content="Test" Command="{StaticResource testCommand}" CommandParameter="abcdef"/>Actual behavior:
At first time the CanExecute method is called, the parameter's value is null。
If I change the XAML property's order as below, the parameter's value is abcdef (that's ok):
<Button Content="Test" CommandParameter="abcdef" Command="{StaticResource testCommand}"/>Expected behavior:
The parameter's value is not null at each time, regardless of the XAML order
Minimal repro:
h82258652, MichaelVach, kronic, swythan, Brubning and 11 more
Metadata
Metadata
Assignees
Labels
Design DiscussionOngoing discussion about design without consensusOngoing discussion about design without consensusEnhancement RequestedProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additions