Beispiel #1
0
		private static void Init()
		{
			IocBootstrapper.RegisterTypes(IocContainer.GetContainer());
			AutoMapperBootstrapper.MapTypes ();

			_locator = new ViewModelLocator();
			_store = new ViewModelStore ();

			IocContainer.GetContainer().RegisterInstance<ILogger> (new Logger ());
			IocContainer.GetContainer().RegisterInstance<ISecureDatabase>(new iOSSecureDatabase());
            IocContainer.GetContainer().RegisterType<IHttpClientHelper, HttpClientHelper>();
			IocContainer.GetContainer().RegisterInstance<IExtendedNavigationService> (ConfigureNav());
			IocContainer.GetContainer().RegisterType<IExtendedDialogService, ExtendedDialogService>();
			IocContainer.GetContainer().RegisterInstance<IHudService> (new HudService());
			IocContainer.GetContainer().RegisterType<IBrowserService, iOSBrowserService> ();
			IocContainer.GetContainer().RegisterInstance<IPhoneService> (new PhoneService());
			IocContainer.GetContainer().RegisterInstance<IMapService> (new MapService());
            IocContainer.GetContainer().RegisterInstance<IGeolocator>(new Geolocator());
            IocContainer.GetContainer().RegisterInstance<IConnectivityService>(new ConnectivityService());
			IocContainer.GetContainer().RegisterInstance<IDispatcherService>( new DispatcherService(new NSObject()));
			IocContainer.GetContainer().RegisterInstance<IEmailService> (new EmailService());
			IocContainer.GetContainer().RegisterInstance<ITwitterHelper> (new iOSTwitterHelper ());
			IocContainer.GetContainer().RegisterInstance<IFacebookHelper> (new iOSFacebookHelper ());
            IocContainer.GetContainer().RegisterInstance<IFileReader> (new FileReader ());
		}
Beispiel #2
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="searchResult">Search result.</param>
 public SearchResultItemViewModel(ViewModelStore viewModelStore, SearchResult searchResult)
     : base(viewModelStore, searchResult.Source)
 {
     this.searchResult = searchResult;
 }
Beispiel #3
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 public DateTemplateSelectorViewModel(ViewModelStore viewModelStore)
     : base(viewModelStore)
 {
     templateVMs = new ObservableCollection <DataTemplateViewModel>();
 }
Beispiel #4
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="serializationAttributeElement">SerializationAttributeElement.</param>
 /// <param name="referencedElement">Element that is referenced by the serialization element. Can be null.</param>
 protected SerializationAttributeElementViewModel(ViewModelStore viewModelStore, SerializationAttributeElement serializationAttributeElement, ModelElement referencedElement, SerializationClassViewModel parent)
     : base(viewModelStore, serializationAttributeElement, referencedElement)
 {
     this.parent = parent;
 }
Beispiel #5
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 protected BaseWindowViewModel(ViewModelStore viewModelStore)
     : base(viewModelStore)
 {
     closeCommand            = new DelegateCommand(OnWindowClose);
     closeActivePopUpCommand = new DelegateCommand <object>(OnCloseActivePopUp);
 }
Beispiel #6
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 protected HtmlEditorViewModelBase(ViewModelStore viewModelStore)
     : base(viewModelStore)
 {
 }
Beispiel #7
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 protected BaseHostingViewModel(ViewModelStore viewModelStore)
     : this(viewModelStore, true)
 {
 }
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 protected PropertyGridEditorViewModel(ViewModelStore viewModelStore)
     : base(viewModelStore)
 {
     elements = new List <object>();
 }
Beispiel #9
0
        private static CategorizedAdvSelectableViewModel CreateCategorizedAdvSelectableVM(MetaModel model, string categoryName, ViewModelStore store, SelectionHelperTarget target)
        {
            List <CategorizedSelectableViewModel> vms = new List <CategorizedSelectableViewModel>();

            foreach (BaseModelContext m in model.ModelContexts)
            {
                if (m is LibraryModelContext)
                {
                    vms.Add(CreateCategorizedSelectableVM(m as LibraryModelContext, m.Name, store, target));
                }
            }
            return(new CategorizedAdvSelectableViewModel(store, categoryName, vms));
        }
Beispiel #10
0
        public static CategorizedSelectionViewModel CreateCategorizedVM(MetaModel model, ViewModelStore store, SelectionHelperTarget target)
        {
            // categories for main meta model as well as imported ones
            List <MetaModel> handledMetaModels = new List <MetaModel>();
            List <CategorizedAdvSelectableViewModel> modelCategoryVMs = new List <CategorizedAdvSelectableViewModel>();

            CreateCategorizedVM(model, store, target, handledMetaModels, modelCategoryVMs);

            return(new CategorizedSelectionViewModel(store, modelCategoryVMs));
        }
Beispiel #11
0
        public static CategorizedSelectionViewModel CreateCategorizedVMWithoutImported(MetaModel model, ViewModelStore store, SelectionHelperTarget target)
        {
            // categories for main meta model as well as imported ones
            List <CategorizedAdvSelectableViewModel> modelCategoryVMs = new List <CategorizedAdvSelectableViewModel>();
            CategorizedAdvSelectableViewModel        modelCategoryVM  = CreateCategorizedAdvSelectableVM(model, model.Name, store, target);

            modelCategoryVMs.Add(modelCategoryVM);

            return(new CategorizedSelectionViewModel(store, modelCategoryVMs));
        }
Beispiel #12
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="embeddingNode">Embedding node.</param>
 /// <param name="parent">Parent.</param>
 public EmbeddingNodeViewModel(ViewModelStore viewModelStore, EmbeddingNode embeddingNode, EmbeddingRSNodeViewModel parent)
     : base(viewModelStore, embeddingNode, parent.Parent)
 {
     this.parentTreeNode = parent;
 }
Beispiel #13
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 public CategorizedSelectionViewModel(ViewModelStore viewModelStore, List <CategorizedAdvSelectableViewModel> selectableCategories)
     : base(viewModelStore)
 {
     this.selectableAdvCategories = selectableCategories;
 }
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="text">Text of the menu item.</param>
 public MenuItemViewModel(ViewModelStore viewModelStore, string text)
     : this(viewModelStore, text, null)
 {
 }
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 public MenuItemViewModel(ViewModelStore viewModelStore)
     : this(viewModelStore, "")
 {
 }
Beispiel #16
0
        private static CategorizedSelectableViewModel CreateCategorizedSelectableVM(LibraryModelContext model, string categoryName, ViewModelStore store, SelectionHelperTarget target)
        {
            List <SelectableViewModel> vms = new List <SelectableViewModel>();

            if ((target & SelectionHelperTarget.DomainClass) > 0)
            {
                foreach (DomainClass d in model.Classes)
                {
                    vms.Add(new SelectableViewModel(store, d));
                }
            }


            if ((target & SelectionHelperTarget.EmbeddingRelationship) > 0 ||
                (target & SelectionHelperTarget.ReferenceRelationship) > 0)
            {
                foreach (DomainRelationship r in model.Relationships)
                {
                    if ((target & SelectionHelperTarget.EmbeddingRelationship) > 0 && r is EmbeddingRelationship)
                    {
                        vms.Add(new SelectableViewModel(store, r));
                    }

                    if ((target & SelectionHelperTarget.ReferenceRelationship) > 0 && r is ReferenceRelationship)
                    {
                        vms.Add(new SelectableViewModel(store, r));
                    }
                }
            }

            if ((target & SelectionHelperTarget.DiagramClass) > 0 ||
                (target & SelectionHelperTarget.DiagramClassWithoutDerived) > 0)
            {
                foreach (DiagramClass d in model.DiagramClasses)
                {
                    if ((target & SelectionHelperTarget.DiagramClassWithoutDerived) > 0)
                    {
                        if (!(d is DesignerDiagramClass))
                        {
                            vms.Add(new SelectableViewModel(store, d));
                        }
                    }
                    else
                    {
                        vms.Add(new SelectableViewModel(store, d));
                    }
                }
            }

            if ((target & SelectionHelperTarget.ShapeClass) > 0 ||
                (target & SelectionHelperTarget.RSShapeClass) > 0 ||
                (target & SelectionHelperTarget.MappingShapeClass) > 0)
            {
                foreach (DiagramClass d in model.DiagramClasses)
                {
                    foreach (PresentationElementClass p in d.PresentationElements)
                    {
                        if (p is ShapeClass && (target & SelectionHelperTarget.ShapeClass) > 0)
                        {
                            vms.Add(new SelectableViewModel(store, p));
                        }
                        if (p is RelationshipShapeClass && (target & SelectionHelperTarget.RSShapeClass) > 0)
                        {
                            vms.Add(new SelectableViewModel(store, p));
                        }
                        if (p is MappingRelationshipShapeClass && (target & SelectionHelperTarget.MappingShapeClass) > 0)
                        {
                            vms.Add(new SelectableViewModel(store, p));
                        }
                    }
                }
            }

            vms.Sort(CompareByName);
            return(new CategorizedSelectableViewModel(store, categoryName, vms));
        }
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 public SelectElementViewModel(ViewModelStore viewModelStore)
     : this(viewModelStore, null)
 {
 }
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 public MainSearchViewModel(ViewModelStore viewModelStore)
     : base(viewModelStore)
 {
 }
Beispiel #19
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="description">Description explaining why the error occured.</param>
 protected BaseErrorListItemViewModel(ViewModelStore viewModelStore, string description)
     : this(viewModelStore, ErrorListItemCategory.Error, description)
 {
 }
Beispiel #20
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 public NullDockingViewModel(ViewModelStore viewModelStore)
     : base(viewModelStore, false)
 {
     this.Initialize();
 }
Beispiel #21
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 public HtmlEditorViewModel(ViewModelStore viewModelStore)
     : base(viewModelStore)
 {
 }
Beispiel #22
0
 /// <summary>
 /// Constructor. This view model constructed with 'bHookUpEvents=true' does react on model changes.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="element">Element represented by this view model.</param>
 public SelectableViewModel(ViewModelStore viewModelStore, ModelElement element)
     : base(viewModelStore, element, false)
 {
 }
 public GraphicalDependencyMainItemViewModel(ViewModelStore viewModelStore, GraphicalDependenciesViewModel diagram, GraphicalDependencyMainShape shapeElement)
     : base(viewModelStore, diagram, shapeElement)
 {
 }
Beispiel #24
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="viewModelStore">The store this view model belongs to.</param>
 /// <param name="dependencyItem">The model element that is hosted by this view model.</param>
 public DependencyItemViewModel(ViewModelStore viewModelStore, DependencyItem dependencyItem)
     : this(viewModelStore, dependencyItem, false)
 {
     this.dependencyItem = dependencyItem;
 }