Ich bin neu bei WPF (ich habe Erfahrung mit React). Ich möchte eine XAML-Taste für die zukünftige Wiederverwendung erstellen.
< /code>
Mein xaml.cs (Teil davon): < /p>
public static readonly DependencyProperty IsValidProperty = DependencyProperty.Register(
nameof(IsValid), typeof(bool), typeof(ValidityButton), new PropertyMetadata(false));
public bool IsValid
{
get => (bool)GetValue(IsValidProperty);
set => SetValue(IsValidProperty, value);
}
public static readonly DependencyProperty OnValidateClickProperty =
DependencyProperty.Register(
"OnValidateClick",
typeof(ICommand),
typeof(ValidityButton),
new PropertyMetadata());
public ICommand OnValidateClick
{
get => (ICommand)GetValue(OnValidateClickProperty);
set => SetValue(OnValidateClickProperty, value);
}
< /code>
Wenn ich es verwende, mache ich (Hauptansicht): < /pbr /> xmlns:controls="clr-namespace:AIValidatorPOC.Controls"
....
< /code>
Ich erhalte den Fehler: < /p>
Das Mitglied "OnvalidateClick" wird nicht erkannt oder nicht zugänglich. Ich habe überprüft, ob alles korrekt ist (auch Benennung). Isvalid wirft keinen solchen Fehler.
Was fehlt mir?
WPF -Benutzersteuerung - Taste [geschlossen] ⇐ C#
-
- Similar Topics
- Replies
- Views
- Last post