在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → 跨平台聊天应用开发教程:基于Xamarin.Forms与DDD+MVVM架构

跨平台聊天应用开发教程:基于Xamarin.Forms与DDD+MVVM架构

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:2.18M
  • 下载次数:1
  • 浏览次数:9
  • 发布时间:2024-03-25
  • 实例类别:一般编程问题
  • 发 布 人:chenxiaolan
  • 文件格式:.zip
  • 所需积分:2
 相关标签:

实例介绍

【实例简介】
CrossChat是一个允许用户在全球聊天室内交流(甚至发送图片!)的应用,支持WP8、iOS或Android智能手机。
服务器端采用DDD(领域驱动设计)方法构建,数据使用Entity Framework Code First存储在SQL数据库中,并通过自主创建的低级套接字(类似WCF)进行传输。
客户端则采用了令人惊叹的Xamarin.Forms框架并结合MVVM(模型-视图-视图模型)设计模式进行构建。
如果你想学习新的技术、框架、语言等,编写聊天应用无疑是一个绝佳的选择。通过本教程,你将深入了解如何利用Xamarin.Forms和DDD MVVM架构来开发一个功能完善的跨平台聊天应用。

【实例截图】

from clipboard

【核心代码】
文件清单
└── CrossChat-Xamarin.Forms-0946b4d08b481ee98eb04df9930a07835c8ca309
    ├── Client
    │   ├── Crosschat.Client
    │   │   ├── App.cs
    │   │   ├── Crosschat.Client.csproj
    │   │   ├── Model
    │   │   │   ├── Contracts
    │   │   │   │   ├── IContactInvitationSender.cs
    │   │   │   │   ├── IContactsRepository.cs
    │   │   │   │   ├── IDeviceInfo.cs
    │   │   │   │   ├── IPhotoPicker.cs
    │   │   │   │   ├── IStorage.cs
    │   │   │   │   └── ITransportResource.cs
    │   │   │   ├── CountriesRepository.cs
    │   │   │   ├── Entities
    │   │   │   │   ├── Contact.cs
    │   │   │   │   ├── Country.cs
    │   │   │   │   └── Messages
    │   │   │   │       ├── BanNotificationEvent.cs
    │   │   │   │       ├── DevoiceNotificationEvent.cs
    │   │   │   │       ├── Event.cs
    │   │   │   │       ├── GrantedModershipNotificationEvent.cs
    │   │   │   │       ├── RemovedModershipNotificationEvent.cs
    │   │   │   │       ├── SubjectEvent.cs
    │   │   │   │       └── TextMessage.cs
    │   │   │   ├── Helpers
    │   │   │   │   └── AutoMapper.cs
    │   │   │   ├── Managers
    │   │   │   │   ├── AccountManager.cs
    │   │   │   │   ├── ApplicationManager.cs
    │   │   │   │   ├── ChatManager.cs
    │   │   │   │   ├── FriendsManager.cs
    │   │   │   │   ├── ManagerBase.cs
    │   │   │   │   └── SearchManager.cs
    │   │   │   └── Proxies
    │   │   │       ├── AppServicesProxyGenerator.cs
    │   │   │       ├── AppServicesProxyGenerator.tt
    │   │   │       ├── ConnectionManager.cs
    │   │   │       └── ServiceProxyBase.cs
    │   │   ├── packages.config
    │   │   ├── Properties
    │   │   │   ├── Annotations.cs
    │   │   │   └── AssemblyInfo.cs
    │   │   ├── Seedwork
    │   │   │   ├── Controls
    │   │   │   │   ├── BindableListView.cs
    │   │   │   │   ├── BindablePicker.cs
    │   │   │   │   ├── MvvmableContentPage.cs
    │   │   │   │   └── MvvmableTabbedPage.cs
    │   │   │   ├── Extensions
    │   │   │   │   ├── NamedObservableCollection.cs
    │   │   │   │   └── ObservableCollectionExtensions.cs
    │   │   │   └── ViewModelBase.cs
    │   │   ├── SplashscreenPage.xaml
    │   │   ├── SplashscreenPage.xaml.cs
    │   │   ├── ViewModels
    │   │   │   ├── ContactViewModel.cs
    │   │   │   ├── EventViewModel.cs
    │   │   │   ├── EventViewModelFactory.cs
    │   │   │   ├── HomeViewModel.cs
    │   │   │   ├── InviteToAppViewModel.cs
    │   │   │   ├── RegistrationViewModel.cs
    │   │   │   ├── TextMessageViewModel.cs
    │   │   │   └── UserViewModel.cs
    │   │   └── Views
    │   │       ├── ChatPage.cs
    │   │       ├── Controls
    │   │       │   ├── ChatListView.cs
    │   │       │   └── MessageViewCell.cs
    │   │       ├── HomePage.cs
    │   │       ├── InviteToAppPage.cs
    │   │       ├── OnlineUsersPage.cs
    │   │       ├── RegistrationPage.cs
    │   │       ├── SettingsPage.cs
    │   │       ├── SplashscreenPage.cs
    │   │       └── ValueConverters
    │   │           └── InverterConverter.cs
    │   ├── Crosschat.Client.Android
    │   │   ├── Assets
    │   │   │   └── AboutAssets.txt
    │   │   ├── Crosschat.Client.Android.csproj
    │   │   ├── CustomRenderers
    │   │   │   └── MessageRenderer.cs
    │   │   ├── Infrastructure
    │   │   │   ├── ContactsRepository.cs
    │   │   │   ├── DeviceInfo.cs
    │   │   │   ├── InvitationSender.cs
    │   │   │   ├── ProtobufDtoSerializer.cs
    │   │   │   ├── Storage.cs
    │   │   │   └── TransportResource.cs
    │   │   ├── MainActivity.cs
    │   │   ├── packages.config
    │   │   ├── Properties
    │   │   │   ├── AndroidManifest.xml
    │   │   │   └── AssemblyInfo.cs
    │   │   └── Resources
    │   │       ├── AboutResources.txt
    │   │       ├── Drawable
    │   │       │   ├── bubble_green.9.png
    │   │       │   ├── bubble_yellow.9.png
    │   │       │   ├── empty_contact.jpg
    │   │       │   └── Icon.png
    │   │       ├── layout
    │   │       │   ├── image_item_opponent.axml
    │   │       │   ├── image_item_owner.axml
    │   │       │   ├── item_row.axml
    │   │       │   ├── message_item_opponent.axml
    │   │       │   └── message_item_owner.axml
    │   │       └── Resource.Designer.cs
    │   ├── Crosschat.Client.iOS
    │   │   ├── AppDelegate.cs
    │   │   ├── chat.png
    │   │   ├── Crosschat.Client.iOS.csproj
    │   │   ├── CustomRenderers
    │   │   │   ├── BubbleCell.cs
    │   │   │   ├── ChatBubble.cs
    │   │   │   ├── ChatListViewRenderer.cs
    │   │   │   └── MessageRenderer.cs
    │   │   ├── empty_contact.jpg
    │   │   ├── green.png
    │   │   ├── grey.png
    │   │   ├── group.png
    │   │   ├── Info.plist
    │   │   ├── Infrastructure
    │   │   │   ├── ContactsRepository.cs
    │   │   │   ├── DeviceInfo.cs
    │   │   │   ├── InvitationSender.cs
    │   │   │   ├── ProtobufDtoSerializer.cs
    │   │   │   ├── Storage.cs
    │   │   │   └── TransportResource.cs
    │   │   ├── Main.cs
    │   │   ├── packages.config
    │   │   ├── Properties
    │   │   │   └── AssemblyInfo.cs
    │   │   └── settings.png
    │   └── Crosschat.Client.WinPhone
    │       ├── appbar.image.beach.png
    │       ├── appbar.user.add.png
    │       ├── App.xaml
    │       ├── App.xaml.cs
    │       ├── Assets
    │       │   ├── AlignmentGrid.png
    │       │   ├── ApplicationIcon.png
    │       │   ├── empty_contact.jpg
    │       │   └── Tiles
    │       │       ├── FlipCycleTileLarge.png
    │       │       ├── FlipCycleTileMedium.png
    │       │       ├── FlipCycleTileSmall.png
    │       │       ├── IconicTileMediumLarge.png
    │       │       └── IconicTileSmall.png
    │       ├── Crosschat.Client.WinPhone.csproj
    │       ├── CustomRenderers
    │       │   ├── ChatListRenderer.cs
    │       │   └── MessageRenderer.cs
    │       ├── Infrastructure
    │       │   ├── ContactsRepository.cs
    │       │   ├── DeviceInfo.cs
    │       │   ├── InvitationSender.cs
    │       │   ├── PhotoPicker.cs
    │       │   ├── ProtobufDtoSerializer.cs
    │       │   ├── Storage.cs
    │       │   └── TransportResource.cs
    │       ├── LocalizedStrings.cs
    │       ├── MainPage.xaml
    │       ├── MainPage.xaml.cs
    │       ├── MessageDataTemplateSelector.cs
    │       ├── packages.config
    │       ├── Properties
    │       │   ├── AppManifest.xml
    │       │   ├── AssemblyInfo.cs
    │       │   └── WMAppManifest.xml
    │       ├── README_FIRST.txt
    │       ├── Resources
    │       │   ├── AppResources.Designer.cs
    │       │   └── AppResources.resx
    │       └── Toolkit.Content
    │           ├── ApplicationBar.Add.png
    │           ├── ApplicationBar.Cancel.png
    │           ├── ApplicationBar.Check.png
    │           ├── ApplicationBar.Delete.png
    │           └── ApplicationBar.Select.png
    ├── LICENSE
    ├── packages.static
    │   ├── ServiceStack.Text
    │   │   └── ServiceStack.Text.dll
    │   └── Supersocket
    │       ├── log4net.dll
    │       ├── Microsoft.Scripting.dll
    │       ├── Microsoft.Scripting.xml
    │       ├── SuperSocket.Common.dll
    │       ├── SuperSocket.Common.xml
    │       ├── SuperSocket.Dlr.dll
    │       ├── SuperSocket.Dlr.xml
    │       ├── SuperSocket.Facility.dll
    │       ├── SuperSocket.Facility.xml
    │       ├── SuperSocket.SocketBase.dll
    │       ├── SuperSocket.SocketBase.xml
    │       ├── SuperSocket.SocketEngine.dll
    │       └── SuperSocket.SocketEngine.xml
    ├── README.md
    ├── Screenshots
    │   ├── Android_chat.png
    │   ├── Android_participants.png
    │   ├── Android_registration.png
    │   ├── general.png
    │   ├── IOS_chat.png
    │   ├── IOS_registration.png
    │   ├── WP8_chat.png
    │   ├── WP8_invite.png
    │   ├── WP8_participants.png
    │   └── WP8_registration.png
    ├── Server
    │   ├── Crosschat.Server.Application
    │   │   ├── Agents
    │   │   │   ├── AgentManager.cs
    │   │   │   └── ScheduledAgentBase.cs
    │   │   ├── ApplicationModule.cs
    │   │   ├── Contracts
    │   │   │   ├── IFileStorage.cs
    │   │   │   ├── IInfrastructureInitializator.cs
    │   │   │   └── ISettings.cs
    │   │   ├── Crosschat.Server.Application.csproj
    │   │   ├── Mapping
    │   │   │   └── CommonProfile.cs
    │   │   ├── packages.config
    │   │   ├── Properties
    │   │   │   └── AssemblyInfo.cs
    │   │   ├── Seedwork
    │   │   │   ├── AppService.cs
    │   │   │   ├── AutomapperTypeAdapter.cs
    │   │   │   ├── AutomapperTypeAdapterFactory.cs
    │   │   │   ├── ProjectionsExtensionMethods.cs
    │   │   │   └── ServiceLocator.cs
    │   │   ├── Services
    │   │   │   ├── AuthenticationService.cs
    │   │   │   ├── ChatService.cs
    │   │   │   ├── FriendsService.cs
    │   │   │   ├── Helpers
    │   │   │   │   └── ProfileChangesNotificator.cs
    │   │   │   ├── ProfileService.cs
    │   │   │   ├── RegistrationService.cs
    │   │   │   └── UsersSearchService.cs
    │   │   └── Sessions
    │   │       ├── ISession.cs
    │   │       ├── ISessionManager.cs
    │   │       └── SessionEventArgs.cs
    │   ├── Crosschat.Server.ConsoleHost
    │   │   ├── App.config
    │   │   ├── Bootstrapper.cs
    │   │   ├── Crosschat.Server.ConsoleHost.csproj
    │   │   ├── packages.config
    │   │   ├── Program.cs
    │   │   └── Properties
    │   │       └── AssemblyInfo.cs
    │   ├── Crosschat.Server.Domain
    │   │   ├── Crosschat.Server.Domain.csproj
    │   │   ├── Entities
    │   │   │   ├── PublicMessage.cs
    │   │   │   ├── PublicMessageSpecification.cs
    │   │   │   ├── User.cs
    │   │   │   ├── UserRole.cs
    │   │   │   └── UserSpecification.cs
    │   │   ├── Exceptions
    │   │   │   ├── InvalidUserRegistrationDataException.cs
    │   │   │   └── ModeratorsRightsRequiredException.cs
    │   │   ├── Properties
    │   │   │   └── AssemblyInfo.cs
    │   │   ├── Repositories
    │   │   │   ├── IPublicMessageRepository.cs
    │   │   │   ├── IRepository.cs
    │   │   │   └── IUserRepository.cs
    │   │   └── Seedwork
    │   │       ├── Entity.cs
    │   │       ├── IUnitOfWork.cs
    │   │       ├── IUnitOfWorkFactory.cs
    │   │       ├── Specifications
    │   │       │   ├── AndSpecification.cs
    │   │       │   ├── CompositeSpecification.cs
    │   │       │   ├── DirectSpecification.cs
    │   │       │   ├── ExpressionBuilder.cs
    │   │       │   ├── NotSpecification.cs
    │   │       │   ├── OrSpecification.cs
    │   │       │   ├── ParametersRebinder.cs
    │   │       │   ├── Specification.cs
    │   │       │   └── TrueSpecification.cs
    │   │       ├── Utils
    │   │       │   ├── DateTimeApproximateComparer.cs
    │   │       │   └── IdentityGenerator.cs
    │   │       └── ValueObject.cs
    │   └── Crosschat.Server.Infrastructure
    │       ├── Abo.Server.Infrastructure.csproj
    │       ├── App.config
    │       ├── Crosschat.Server.Infrastructure.csproj
    │       ├── FileSystem
    │       │   └── FileStorage.cs
    │       ├── GlobalConfig.cs
    │       ├── HardcodedSettings.cs
    │       ├── InfrastructureInitializator.cs
    │       ├── InfrastructureModule.cs
    │       ├── Logging
    │       │   └── ConsoleLogger.cs
    │       ├── packages.config
    │       ├── Persistence
    │       │   └── EF
    │       │       ├── DatabaseInitializer.cs
    │       │       ├── Mappings
    │       │       │   ├── PublicMessageEntityConfiguration.cs
    │       │       │   └── UserEntityConfiguration.cs
    │       │       ├── Repositories
    │       │       │   ├── PublicMessageRepository.cs
    │       │       │   └── UserRepository.cs
    │       │       ├── UnitOfWork.cs
    │       │       └── UnitOfWorkFactory.cs
    │       ├── Properties
    │       │   └── AssemblyInfo.cs
    │       ├── Serialization
    │       │   ├── BinaryFormatterDtoSerializer.cs
    │       │   ├── JsonDtoSerializer.cs
    │       │   ├── ProtobufDtoSerializer.cs
    │       │   ├── XmlDtoSerializer.cs
    │       │   └── ZippedProtobufDtoSerializer.cs
    │       └── Transport
    │           ├── Commands
    │           │   ├── PingCommand.cs
    │           │   ├── RequestCommand.cs
    │           │   └── ResponseCommand.cs
    │           ├── CrosschatCommandBase.cs
    │           ├── CrosschatReceiveFilter.cs
    │           ├── CrosschatSession.cs
    │           ├── CrosschatSocketServer.cs
    │           └── TransportPerformanceMeasurer.cs
    ├── Shared
    │   ├── Crosschat.Server.Application.DataTransferObjects
    │   │   ├── Crosschat.Server.Application.DataTransferObjects.csproj
    │   │   ├── Enums
    │   │   │   ├── AuthenticationResponseType.cs
    │   │   │   ├── BanResponseType.cs
    │   │   │   ├── DevoiceResponseType.cs
    │   │   │   ├── RegistrationResponseType.cs
    │   │   │   └── UserRoleEnum.cs
    │   │   ├── Messages
    │   │   │   ├── BanNotification.cs
    │   │   │   ├── BaseDto.cs
    │   │   │   ├── DevoiceNotification.cs
    │   │   │   ├── JoinedUserInfo.cs
    │   │   │   ├── ModershipGrantedInfo.cs
    │   │   │   ├── ModershipRemovedInfo.cs
    │   │   │   ├── PropertyValuePair.cs
    │   │   │   ├── PublicMessageDto.cs
    │   │   │   ├── UserDto.cs
    │   │   │   ├── UserPropertiesChangedInfo.cs
    │   │   │   └── YouAreDevoicedNotification.cs
    │   │   ├── Properties
    │   │   │   └── AssemblyInfo.cs
    │   │   ├── Requests
    │   │   │   ├── 1.request-response.snippet
    │   │   │   ├── AddToBlacklistRequest.cs
    │   │   │   ├── AddToFriendsRequest.cs
    │   │   │   ├── AuthenticationRequest.cs
    │   │   │   ├── BanRequest.cs
    │   │   │   ├── ChangePhotoRequest.cs
    │   │   │   ├── DeactivationRequest.cs
    │   │   │   ├── DevoiceRequest.cs
    │   │   │   ├── GetOnlineUsersRequest.cs
    │   │   │   ├── GetUserDetailsRequest.cs
    │   │   │   ├── GrantModershipRequest.cs
    │   │   │   ├── LastMessageRequest.cs
    │   │   │   ├── PublicMessageRequest.cs
    │   │   │   ├── RegistrationRequest.cs
    │   │   │   ├── RemoveFromBlacklistRequest.cs
    │   │   │   ├── RemoveFromFriendsRequest.cs
    │   │   │   ├── RemoveModershipRequest.cs
    │   │   │   ├── RequestBase.cs
    │   │   │   ├── ResetPhotoRequest.cs
    │   │   │   ├── ResponseBase.cs
    │   │   │   ├── SendImageRequest.cs
    │   │   │   ├── UserBlacklistRequest.cs
    │   │   │   ├── UserFriendsRequest.cs
    │   │   │   └── UsersSearchRequest.cs
    │   │   └── Utils
    │   │       └── RequestsHandler.cs
    │   ├── Crosschat.Server.Infrastructure.Protocol
    │   │   ├── CommandBuffer.cs
    │   │   ├── Command.cs
    │   │   ├── CommandNames.cs
    │   │   ├── CommandParser.cs
    │   │   ├── Crosschat.Server.Infrastructure.Protocol.csproj
    │   │   ├── IDtoSerializer.cs
    │   │   └── Properties
    │   │       └── AssemblyInfo.cs
    │   └── Crosschat.Utils
    │       ├── Crosschat.Utils.csproj
    │       ├── Extensions
    │       │   ├── EnumerableExtensions.cs
    │       │   ├── PrimitiveTypeExtensions.cs
    │       │   └── StringExtensions.cs
    │       ├── IThreadDispatcher.cs
    │       ├── Logging
    │       │   ├── ILogger.cs
    │       │   ├── LogFactory.cs
    │       │   └── LoggerStub.cs
    │       ├── Properties
    │       │   └── AssemblyInfo.cs
    │       └── Tasking
    │           └── TaskExtensions.cs
    ├── Solution.Client.sln
    └── Solution.Server.sln

87 directories, 320 files

标签:

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警