Hello,
I commented out the code in
selectcategory_label_PropertyChanged
event and label is working fine at that time.
You can move this PropertyChanged="selectcategory_label_PropertyChanged"
for label.
Then move this part code to a new method like following code.
public void CheckInPutValue()
{
if (!string.IsNullOrWhiteSpace(title_entry.Text) && !string.IsNullOrWhiteSpace(description_editor.Text) && selectcategory_label.Text != "Select a category")
{
submit_button.IsEnabled = true;
submit_button.BackgroundColor = Color.FromArgb("#f3872c");
}
else
{
submit_button.IsEnabled = false;
submit_button.BackgroundColor = Color.FromArgb("#d5d5d5");
}
}
Then add same textchange event for your Title (Entry), Description (Editor) like following code.
<Entry x:Name="title_entry" Text="" TextChanged="title_entry_TextChanged"></Entry>
<Editor x:Name="description_editor" Text="" TextChanged="title_entry_TextChanged"></Editor>
Next, check the input value in textchange event.
private void title_entry_TextChanged(object sender, TextChangedEventArgs e)
{
CheckInPutValue();
}
As note, please add CheckInPutValue method in the OnAppearing() method.
protected async override void OnAppearing()
{
CheckInPutValue();
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.