The PhotoSharingApp solution consists of two projects for the client app (PhotoSharingApp.Universal and PhotoSharingApp.Universal.Tests) and three projects for the service (PhotoSharingApp.MobileService, PhotoSharingApp.MobileService.Shared, and PhotoSharingApp.MobileService.Tests). Both client and service implementations make use of a portable library which contains interfaces and shared data models for communication.
The app and service are separated in the project structure as shown in this diagram:
List of projects with individual notes:
- PhotoSharingApp.Universal: The UWP (Universal Windows Platform) project that contains the app
- PhotoSharingApp.Universal.Tests: Contains unit tests for the UWP app
- PhotoSharingApp.Portable: Contains classes that act as data contracts between app and service
- PhotoSharingApp.AppService: The Azure Mobile App project
- PhotoSharingApp.AppService.Shared: Contains data models & data storage layer
- PhotoSharingApp.AppService.Tests: Contains tests for the Azure Mobile App
The following namespaces exist in the UWP project:
- Actions: Contains UI actions such as the OpenMenuFlyoutAction.cs
- Assets: Contains icons, app logos and image assets for the introduction screens
- Camera: Code that encapsulates the camera API
- Commands: Contains implementations of the ICommand interface for binding commands to user controls
- ComponentModel: Contains ObservableObjectBase.cs, which provides an implementation of INotifyPropertyChanged to support data binding. Also contains IncrementalLoadingCollection.cs which allows incremental loading of data using ISupportIncrementalLoading
- ContractModelConverterExtensions: Extension methods that help with converting between data contracts which are used for service communication and local data models used for data binding.
- Controls: Contains reusable UI controls
- Editing: Editing tools for cropping, resizing and rotating photos
- Extensions: Extension methods for data models and native types
- Facades: Encapsulates in-app purchase handling & page navigation (see Facade pattern).
- Lifecycle: Contains code that does initial work on app launch
- Models: Contains data models (such as Photo, Category, and User)
- NavigationBar: Contains all navigation bar menu items and the interface definition INavigationBarMenuItem.cs
- Registries: Contains classes that register dependencies to the Unity dependency container
- Serialization: Helper methods for serialization and de-serialization that are used for page navigation
- ServiceEnvironments: Contains an abstracted and defined service environment that the app can connect to. The ServiceEnvironment.cs consists of the endpoint of the Azure Mobile App
- Services: Contains code that encapsulates communication and authentication with the service. Service communication is defined by the IPhotoService.cs interface. Currently, there are two implementations of this interface, PhotoDummyService.cs (which provides static dummy data for testing purposes) and ServiceClient.cs (which connects to a running Azure Mobile App).
- StateTriggers: Additional UI state triggers that derive from StateTriggerBase
- Storage: Contains helper code for file pickers
- Store: Contains a proxy class for CurrentApp and other helper classes, which allow simulating in-app purchases at runtime
- Strings: String resources
- Styles: ResourceDictionary with styles, templates and color presets
- Unity: Contains the UnityBootstrapper.cs for initializing the Unity dependency container and some other helpers for Unity
- ValueConverters: Class implementations for IValueConverter
- ViewModels: Contains ViewModel classes based on the MVVM pattern
- ViewModels.Design: Design-time ViewModels that provide static data for design purposes. The design-time ViewModels allow the user to preview the UI filled with test data without having the app running
- Views: Contains UI pages, such as CategoriesPage.xaml, StreamPage.xaml or PhotoDetailsPage.xaml.
- App.xaml.cs: App entry point
- AppShareTarget.cs: App entry point when used as share target
This test project contains unit tests for code in the PhotoSharingApp.Universal project. Test classes are located in equivalent namespaces as the code that is tested.
- DataContracts: Contains data contracts that are being used for communication between the app and service
- Extensions: Extension methods for data contracts
- Controllers: ApiControllers that handle service requests
- Models: NotificationsHubModel.cs helper class
- Helpers: Contains user validation helpers
- Notifications: NotificationHandler.cs that handles push notifications
- ServiceCore: Helper classes for exception handling
- Context: Service environment definitions
- Models: DocumentDB models
- Repositories: The repository interface definition and implementations
- Validation: Helper classes for data model and in-app purchase validation
This test project contains unit tests for code in the PhotoSharingApp.AppService project. Test classes are located in equivalent namespaces as the code that is tested.