<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Input;
using MvvmCross.Core.ViewModels;
using Newtonsoft.Json.Linq;
using PropertyManager.Models;
using PropertyManager.Services;

namespace PropertyManager.ViewModels
{
    public class DetailsViewModel
        : MvxViewModel
    {
        private readonly IGraphService _graphService;
        private readonly IConfigService _configService;

        private bool _isLoading;

        public bool IsLoading
        {
            get { return _isLoading; }
            set
            {
                _isLoading = value;
                RaisePropertyChanged(() => IsLoading);
                RaisePropertyChanged(() => IsValid);
            }
        }

        private bool _isValid;

        public bool IsValid
        {
            get { return !_isLoading && _isValid; }
            set
            {
                _isValid = value;
                RaisePropertyChanged(() => IsValid);
            }
        }

        private string _title;

        public string Title
        {
            get { return _title; }
            set
            {
                _title = value;
                RaisePropertyChanged(() => Title);
            }
        }

        private string _streetName;

        public string StreetName
        {
            get { return _streetName; }
            set
            {
                _streetName = value;
                RaisePropertyChanged(() => StreetName);
                Validate();
            }
        }

        public PropertyTableRowModel Details { get; set; }

        public bool IsExisting { get; set; }

        public ICommand GoBackCommand => new MvxCommand(() => Close(this));

        public ICommand SaveDetailsCommand => new MvxCommand(SaveDetailsAsync);

        public DetailsViewModel(IGraphService graphService, IConfigService configService)
        {
            _graphService = graphService;
            _configService = configService;
        }

        public void Init(string id)
        {
            // Get details.
            Details = _configService.DataFile.PropertyTable
                .Rows.FirstOrDefault(r => r.Id == id);
            IsExisting = Details != null;

            // Set title.
            Title = (IsExisting ? "Add" : "Edit") + " a property";
            if (Details == null)
            {
                Details = new PropertyTableRowModel();
            }<commit_msg>Fixed DetailsView Validation Bug (On Start)<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Input;
using MvvmCross.Core.ViewModels;
using Newtonsoft.Json.Linq;
using PropertyManager.Models;
using PropertyManager.Services;

namespace PropertyManager.ViewModels
{
    public class DetailsViewModel
        : MvxViewModel
    {
        private readonly IGraphService _graphService;
        private readonly IConfigService _configService;

        private bool _isLoading;

        public bool IsLoading
        {
            get { return _isLoading; }
            set
            {
                _isLoading = value;
                RaisePropertyChanged(() => IsLoading);
                RaisePropertyChanged(() => IsValid);
            }
        }

        private bool _isValid;

        public bool IsValid
        {
            get { return !_isLoading && _isValid; }
            set
            {
                _isValid = value;
                RaisePropertyChanged(() => IsValid);
            }
        }

        private string _title;

        public string Title
        {
            get { return _title; }
            set
            {
                _title = value;
                RaisePropertyChanged(() => Title);
            }
        }

        private string _streetName;

        public string StreetName
        {
            get { return _streetName; }
            set
            {
                _streetName = value;
                RaisePropertyChanged(() => StreetName);
            }
        }

        public PropertyTableRowModel Details { get; set; }

        public bool IsExisting { get; set; }

        public ICommand GoBackCommand => new MvxCommand(() => Close(this));

        public ICommand SaveDetailsCommand => new MvxCommand(SaveDetailsAsync);

        public DetailsViewModel(IGraphService graphService, IConfigService configService)
        {
            _graphService = graphService;
            _configService = configService;
        }

        public void Init(string id)
        {
            // Get details.
            Details = _configService.DataFile.PropertyTable
                .Rows.FirstOrDefault(r => r.Id == id);
            IsExisting = Details != null;

            // Set title.
            Title = (IsExisting ? "Add" : "Edit") + " a property";
            if (Details == null)
            {
                Details = new PropertyTableRowModel();
            }
            Validate();
{'fraction_non_alphanumeric': 0.07746478873239436, 'fraction_numerical': 0.0, 'mean_word_length': 1.5667670682730923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3024387', 'n_tokens_mistral': 1267, 'n_tokens_neox': 1204, 'n_words': 309}