protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

            if (e.NavigationMode == NavigationMode.Back)
            {
                Collection.LocomotivesIDs.CollectionChanged -= CollectionItems_CollectionChanged;
                Collection.AccessoriesIDs.CollectionChanged -= CollectionItems_CollectionChanged;
                Collection = null;
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.NavigationMode == NavigationMode.New)
            {
                Collection = e.Parameter as EcosItemsCollection;

                isNew = Collection == null;
                if (isNew)
                    Collection = new EcosItemsCollection();

                Collection.LocomotivesIDs.CollectionChanged += CollectionItems_CollectionChanged;
                Collection.AccessoriesIDs.CollectionChanged += CollectionItems_CollectionChanged;

                SetUIVisibility();

                ValidateItems();
            }
        }