W8商店应用程序:用HTML和CSS编写用户界面,并将C#DLL用于域/模型? [英] W8 Store App: Writing UI in HTML and CSS, and using C# DLLs for Domain/Model?

查看:133
本文介绍了W8商店应用程序:用HTML和CSS编写用户界面,并将C#DLL用于域/模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经开始研究通过我们/客户的域名商店将LOB W8商店应用推送到Surfaces的可能性。我们有一个用.Net编写的WinForms和WPF应用程序组合,并且正考虑将其中一些迁移到Surface,因为客户的偏好。
现在我有一个困境:我已经研究了Windows 8中的开发技术,并且从我已阅读的内容和尝试,似乎利用W8商店开发技术的最佳方式是使用这种组合:


  • 用于UI开发的HTML,CSS,JQuery和JS(View)和
  • C#和适当的.net为解决方案的模型/域的一部分。



事实是(或恕我直言),XAML是臃肿与创建触发器,效果,动画和UI时的轻量级HTML / CSS / JQuery相比,我们没有太多开发人员创建UI的时间。
另一方面,JS(恕我直言,再次)不适用于域/模型应用程序,因为代码将不得不重写(没有时间),尽管在JS中引入了语言和类型检查,认为该语言对于我们的领域/模型需求和学习曲线几乎不可用。



从我的想法来看,是否有可能将UI部分编写成HTML / CSS / JQuery / JS和.Net / C#中的域/模型部分?为了让我们有一堆HTML,JS和我们说的ViewModels绑定到的,以及用C# ?
我的意思是使用它类似于在C ++ .Net中创建解决方案,并添加一些C#和VB.Net项目/ dll引用并引用其中的类?



我读到了如何实现这一点(因为JS应用程序是原生AFAIK),唯一的方法就是使用Interops和COMs,并且恐怕这是我们的软件无法实现的。



谢谢大家。

Windows运行时组件应该启用您想要的功能并提供与JS前端(阅读:没有凌乱的interop / COM让你担心)。用C#编写的Windows运行时组件可以使用Windows应用商店允许的任何.NET功能(因此您不会失去任何功能);但是,从Windows运行时组件公开的内容只能使用Windows运行时类型的参数和返回值,这是您可能预期的。



查看开发人员中心的演练在C#和Visual Basic中创建Windows运行时组件获取更多详细信息。


We've started to research the possibility of creating the LOB W8 Store apps pushed to Surfaces through our/customers' domain store. We've got a portfolio of working WinForms and WPF apps written in .Net, and are thinking of migrating some of them to Surface because of the customers' preferences. Now I've got a dilemma: I've made a research about development technologies in Windows 8, and from what I have read and tried it seems the best way to utilize the W8 Store development techs is to use this combination:

  • HTML, CSS, JQuery and JS for UI development (View), and
  • C# and proper .Net for the Model/Domain part of the solution.

The fact is (or IMHO), that XAML is heavily bloated compared to lightweight HTML/CSS/JQuery when creating triggers, effects, animations and UI, we don't have that much developers' time creating the UIs. On the other hand, JS is (IMHO, again) unusable for Domain/Model application because the code would have to be rewritten (no time for that) and, despite the language and type-checks introduced in JS, I think the language is hardly usable for our Domain/Model requirements and learning curves.

From what I was thinking, is there a possibility of writing the UI part in HTML/CSS/JQuery/JS and Domain/Model parts in .Net/C#? So that we'd have a bunch of HTMLs, JS and, let's say ViewModels to bind to, and a domain DLL written in C#? I mean to use it similarly to creating a solution in C++.Net and adding a couple of C# and VB.Net projects/dll references to it and referencing the classes in it?

I read that the only way how to achieve this (since the JS app is native AFAIK), is to use the Interops and COMs, and, I'm afraid that this would not be possible with our software.

Thank you guys.

解决方案

A Windows Runtime Component should enable what you want here and provide a seamless integration with the JS front end (read: no messy interop/COM for you to worry about). The Windows Runtime component you write in C# can use any of the .NET functionality allowed for the Windows Store (so you're not losing any capability there); however, what you expose from the Windows Runtime Component can only use Windows Runtime types for parameters and return values, which you probably expected anyway.

Check out the Walkthrough on the Dev Center and Creating Windows Runtime Components in C# and Visual Basic for more details.

这篇关于W8商店应用程序:用HTML和CSS编写用户界面,并将C#DLL用于域/模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆