Exemplo n.º 1
0
        //private void _ValidateName(string prop, string value)
        //{
        //    ClearErrors(prop);

        //    if (string.IsNullOrEmpty(value) || string.IsNullOrWhiteSpace(value))
        //    {
        //        SetError(prop, "Name cannot be empty.");
        //    }

        //    AddNewTopicCommand.RaiseCanExecuteChanged();
        //}

        //private void _ValidateUnique(string prop, string value)
        //{
        //    //if (string.IsNullOrEmpty(value) || string.IsNullOrWhiteSpace(value)) return;

        //    //ClearErrors(prop);

        //    //if (MeasureService.EntityTopics.Any(x => x.Name == value))
        //    //{
        //    //    SetError(prop, "Topic title must be unique.");
        //    //}

        //    //AddNewTopicCommand.RaiseCanExecuteChanged();
        //}

        //protected override void ValidateAll()
        //{
        //    _ValidateName(ExtractPropertyName(() => NewTopicName), NewTopicName);
        //    _ValidateUnique(ExtractPropertyName(() => NewTopicName), NewTopicName);
        //}

        #endregion

        #region Methods

        public override void OnImportsSatisfied()
        {
            InitData();
            EventAggregator.GetEvent <TopicsUpdatedEvent>().Subscribe(RefreshTopicsCollection);
            new TopicsFilter(this);
            base.OnImportsSatisfied();
            DeleteTopicCommand.RaiseCanExecuteChanged();
        }