protected override void InitializeInternal()
        {
            var application  = CreateApplication();
            var iocContainer = CreateIocContainer();

            application.Initialize(_platform, iocContainer, GetAssemblies().ToArrayEx(), InitializationContext ?? DataContext.Empty);
            FrameStateManager.RegisterFrame(_rootFrame);
            var service = CreateNavigationService(_rootFrame);

            if (service != null)
            {
                iocContainer.BindToConstant(service);
            }
            Should.PropertyNotBeNull(PhoneApplicationService.Current, "PhoneApplicationService.Current");
        }
Ejemplo n.º 2
0
        public IList <IEntityStateEntry> ApplyChanges()
        {
            EnsureNotDisposed();
            if (!IsEntityInitialized)
            {
                throw ExceptionManager.EditorNotInitialized(this);
            }
            T entity;
            IList <IEntityStateEntry> result = ApplyChangesInternal(out entity) ??
                                               Empty.Array <IEntityStateEntry>();

            Entity = entity;
            Should.PropertyNotBeNull(Entity, nameof(Entity));
            OnChangesApplied(result);
            RaiseChangesApplied(result);
            InvalidateProperties();
            return(result);
        }
Ejemplo n.º 3
0
        private void OnBeginEdit()
        {
            Should.PropertyNotBeNull(Entity, nameof(Entity));
            object oldInstance = _initializedEntity;

            if (oldInstance != null)
            {
                RemoveInstance(oldInstance);
                ClearErrors();
            }
            _initializedEntity = Entity;
            AddInstance(_initializedEntity);
            if (oldInstance == null)
            {
                AddInstance(this);
            }
            ValidateAsync();
            HasChanges = IsNewRecord;
            InvalidateProperties();
        }