You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And here is code-behind:
using Avalonia.Controls;
using Avalonia.Media;
using Avalonia.Threading;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using static AvaloniaApplication1.ViewModel;
namespace AvaloniaApplication1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.DataContext= new TestVM();
}
}
}
As you see, no matter whether the value validates success or not, the HasErrors are always false.
There are some properties on a page. What I want to do is keep the IsEnabled of the Apply button to false when there is a validate error of the property.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here is my code:
The version of Community Toolkit.MVVM I am using is 8.2.2. And I test my code in Avalonia(a .Net crossplatform framework).
Here is my XAML:
As you see, no matter whether the value validates success or not, the HasErrors are always false.
There are some properties on a page. What I want to do is keep the IsEnabled of the Apply button to false when there is a validate error of the property.
What's wrong with my code?
Beta Was this translation helpful? Give feedback.
All reactions