RegisterValidation() public static method

public static RegisterValidation ( SparkleXrm.ValidationBinder binder ) : void
binder SparkleXrm.ValidationBinder
return void
        public ConnectionsViewModel(EntityReference parentRecordId, Dictionary <string, string> connectToTypes)
        {
            ParentRecordId = parentRecordId;
            ObservableConnection connection = new ObservableConnection(connectToTypes);

            connection.Record2Id.SetValue(ParentRecordId);
            ConnectionEdit = (Observable <ObservableConnection>)ValidatedObservableFactory.ValidatedObservable(connection);
            Connections.OnSelectedRowsChanged += Connections_OnSelectedRowsChanged;
            Connections.OnDataLoaded.Subscribe(Connections_OnDataLoaded);
            ConnectionEdit.GetValue().OnSaveComplete += ConnectionsViewModel_OnSaveComplete;
            ObservableConnection.RegisterValidation(Connections.ValidationBinder);
        }
Beispiel #2
0
        public ConnectionsViewModel(EntityReference parentRecordId, string[] connectToTypes, int pageSize, string viewFetchXml)
        {
            Connections = new EntityDataViewModel(pageSize, typeof(Connection), true);
            ParentRecordId.SetValue(parentRecordId);
            _viewFetchXml = viewFetchXml;
            ObservableConnection connection = new ObservableConnection(connectToTypes);

            connection.Record2Id.SetValue(parentRecordId);
            ConnectionEdit = (Observable <ObservableConnection>)ValidatedObservableFactory.ValidatedObservable(connection);

            Connections.OnDataLoaded.Subscribe(Connections_OnDataLoaded);
            ConnectionEdit.GetValue().OnSaveComplete += ConnectionsViewModel_OnSaveComplete;
            ObservableConnection.RegisterValidation(Connections.ValidationBinder);
            AllowAddNew = Knockout.DependentObservable <bool>(AllowAddNewComputed);
        }
Beispiel #3
0
        public ConnectionsViewModel(EntityReference parentRecordId, string[] connectToTypes, int pageSize, FetchQuerySettings view)
        {
            Connections = new EntityDataViewModel(pageSize, typeof(Connection), true);
            if (view != null)
            {
                _viewFetchXml = QueryParser.GetFetchXmlParentFilter(view, "record1id");
                // Set initial sort
                _defaultSortCol = new SortCol(view.OrderByAttribute, !view.OrderByDesending);
            }

            ParentRecordId.SetValue(parentRecordId);

            ObservableConnection connection = new ObservableConnection(connectToTypes);

            connection.Record2Id.SetValue(parentRecordId);
            ConnectionEdit = (Observable <ObservableConnection>)ValidatedObservableFactory.ValidatedObservable(connection);

            Connections.OnDataLoaded.Subscribe(Connections_OnDataLoaded);
            ConnectionEdit.GetValue().OnSaveComplete += ConnectionsViewModel_OnSaveComplete;
            ObservableConnection.RegisterValidation(Connections.ValidationBinder);
            AllowAddNew = Knockout.DependentObservable <bool>(AllowAddNewComputed);
        }
Beispiel #4
0
 public ObservableConnection(string[] types)
 {
     connectToTypes = types;
     ObservableConnection.RegisterValidation(new ObservableValidationBinder(this));
 }
 public ObservableConnection(Dictionary <string, string> types)
 {
     connectToTypes = types;
     ObservableConnection.RegisterValidation(new ObservableValidationBinder(this));
 }