{"id":24498796,"url":"https://github.com/dotnet-ad/mwm","last_synced_at":"2025-03-15T07:14:07.391Z","repository":{"id":22798657,"uuid":"97059700","full_name":"dotnet-ad/Mwm","owner":"dotnet-ad","description":"MVVM \u0026 XAML for the web","archived":false,"fork":false,"pushed_at":"2022-12-07T18:30:47.000Z","size":527,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T22:12:20.775Z","etag":null,"topics":["aspnet","core","mvvm","websocket"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotnet-ad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-12T23:20:41.000Z","updated_at":"2023-02-15T06:52:04.000Z","dependencies_parsed_at":"2023-01-13T22:14:33.023Z","dependency_job_id":null,"html_url":"https://github.com/dotnet-ad/Mwm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FMwm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FMwm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FMwm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotnet-ad%2FMwm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotnet-ad","download_url":"https://codeload.github.com/dotnet-ad/Mwm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243695600,"owners_count":20332629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspnet","core","mvvm","websocket"],"created_at":"2025-01-21T22:12:27.943Z","updated_at":"2025-03-15T07:14:07.368Z","avatar_url":"https://github.com/dotnet-ad.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mwm\n\nBuild web interfaces with XAML markup language and bind it to the same view models than your mobile or desktop applications.\n\n## Disclaimer\n\n**Mwm** is purely **experimental**. It's absolutely not thought to be production-ready, this is more a proof-of-concept of a naïve implementation on top of [ASP.NET Core](https://www.asp.net/core/overview/aspnet-vnext) and [Websockets](https://developer.mozilla.org/fr/docs/WebSockets).\n\nTo sumarize : it's just me having fun with technologies I don't know yet! You can expect ugly code and bad architecture since all of this has been made in one go ... without a clean design phase.\n\nMoreover it's only been tested with **Google Chrome - Version 59.0.3071.115 (64-bit)** and **Firefox - Version 54.0**, running on **macOS 10.12**.\n\n## Quickstart\n\n![](Documentation/Counter.png)\n\n**Home.xaml**\n\n```xaml\n\u003cPage\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    x:Class=\"Mwm.Sample.Home\"\u003e\n    \u003cStackPanel Margin=\"10\"\u003e\n        \u003cTextBlock x:Name=\"title\" Margin=\"10\" Text=\"Count: 0\"  /\u003e\n        \u003cButton Margin=\"10\" Text=\"+1\" Click=\"Add\" /\u003e\n    \u003c/StackPanel\u003e\n\u003c/Page\u003e\n```\n\n**Home.xaml.cs**\n\n```csharp\nnamespace Mwm.Sample\n{\n\tusing System;\n\n\tpublic partial class Home\n\t{\n\t\tpublic Counter()\n\t\t{\n\t\t\tthis.Initialize();\n\t\t}\n\n\t\tprivate int count;\n\n\t\tprivate void Add(object sender, EventArgs args)\n\t\t{\n\t\t\tthis.title.Text = $\"Count: {++count}\";\n\t\t}\n\t}\n}\n```\n\n**Startup.cs**\n\n```csharp\npublic void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\n{\n\tloggerFactory.AddConsole(Configuration.GetSection(\"Logging\"));\n\tloggerFactory.AddDebug();\n\tapp.UseWebSockets();\n\tapp.UseMwm(new MwmOptions\n\t{\n\t\tUIBuilder = new FactoryBuilder().Register\u003cHome\u003e(),\n\t});\n}\n```\n\n## Samples\n\nClone the repository and start the Mwm.Sample project to preview three samples :\n\n* **Counter** : the quickstart with a simple web page interracting with the .NET backend.\n\n![](Documentation/Counter.png)\n\n* **Controls** : the list of available controls.\n\n![](Documentation/Controls.png)\n\n![](Documentation/Controls2.png)\n\n* **Weather (WIP)** : an example of a weather application based on MVVM architecture.\n\n*screenshot soon ...*\n\n## Roadmap\n\n- [ ] Improvements\n\t- [ ] Integrate Typescript\n\t- [ ] Integrate SignalR\n\t- [ ] Cleaner architecture  \n\t- [ ] Better browser compatibility\n- [X] Middleware\n\t- [X] Sending property changes\n\t- [X] Receiving events\n\t- [X] Navigation\n\t\t- [X] Forward\n\t\t- [ ] Backward \u0026 history \n- [X] XAML\n\t- [X] Generation \n- [ ] UI \n\t- [ ] User controls \n\t- [ ] Styles\n\t\t- [ ] ResourceDictionaries\n\t\t- [ ] Style \u0026 setter \n\t- [ ] Bindings\n\t\t- [X] One way \n\t\t- [X] Two way \n\t\t- [ ] One time\n\t\t- [ ] Converters\n\t- [X] Displays\n\t\t- [X] TextBlock\n\t\t- [X] Image\n\t\t- [X] Rectangle\n\t\t- [X] ProgressRing\n\t\t- [ ] ProgressBar\n\t\t- [ ] Border\n\t- [ ] Controls\n\t\t- [X] TextBox\n\t\t- [X] ToggleSwitch\n\t\t- [ ] Slider\n\t\t- [ ] DatePicker\n\t\t- [ ] ComboBox\n\t\t- [ ] RadioButton\n\t- [ ] Panels\n\t\t- [X] StackPanel\n\t\t- [ ] Grid\n\t\t- [ ] ScrollView\n\t- [ ] Virtualization\n\t\t- [ ] ListView\n\n## How it works\n\n#### Synchronization\n\nAll the logic is executed by an ASP.NET Core middleware that sends and listen to commands from a web app. All property changes, user interaction events, navigation are propagated to the javascript client through WebSockets.\n\n**Details** : [MwmMiddleware.cs](MwmMiddleware.cs), [ElementObserver.cs](ElementObserver.cs)\n\n#### Components \u0026 XAML Generation\n\nA custom simplified XAML layer have been built from ground up for control. The components and the generation are very basic at the moment. All XAML will generate C# file at build time. Theorically, the same concept should be applyable to *Xamarin.Forms* but with a lot more work. :)\n\n**Details** : [Mwm.UI](Mwm.UI), [Mwm.UI.Xaml.Build](Mwm.UI.Xaml.Build)\n\n### Contributions\n\nContributions are welcome! If you find a bug please report it and if you want a feature please report it.\n\nIf you want to contribute code please file an issue and create a branch off of the current dev branch and file a pull request.\n\n### License\n\nMIT © [Aloïs Deniel](http://aloisdeniel.github.io)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet-ad%2Fmwm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotnet-ad%2Fmwm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotnet-ad%2Fmwm/lists"}