简体   繁体   English

带有HTML和C#的Metro风格应用

[英]Metro style apps with Html and C#

According to this slide 根据这张幻灯片

http://media.infragistics.com/community/general/windows8-platform-tools.jpg http://media.infragistics.com/community/general/windows8-platform-tools.jpg

Does it mean I have to use XAML view with C# if I want to develop a metro styled application? 如果要开发Metro风格的应用程序,是否意味着我必须在C#中使用XAML视图?

Can I use a HTML/JS/CSS - C# combination with event handlers and all? 我可以将HTML / JS / CSS-C#与事件处理程序及其他所有函数结合使用吗? Something like ASP.NET Webforms/MVC . 诸如ASP.NET Webforms / MVC之类的东西。 I know it is not the same client server architecture, but since metro styled apps support HTML/JS, I was wondering. 我知道这不是相同的客户端服务器体系结构,但是由于Metro风格的应用程序支持HTML / JS,我想知道。

I can use Win-JS. 我可以使用Win-JS。 But can I rather write C# than Javascript, and use HTML rather than XAML?(I dont know XAML and I like C#) 但是我能写C#而不是Java脚本,还是用HTML而不是XAML?(我不知道XAML,我喜欢C#)

All the C# samples I found online use XAML. 我在网上找到的所有C#示例都使用XAML。

Perhaps you can write portions of your program logic in C# and package it as a library and then create a HTML5/JS app that references the C# Library. 也许您可以用C#编写程序逻辑的一部分并将其打包为一个库,然后创建引用C#库的HTML5 / JS应用。 That way you should only need to use JS for the parts that are directly related to UI functions and C# for the rest. 这样,您只需要对与UI函数直接相关的部分使用JS,对其余部分使用C#。

I will point out that I haven't tried it yet, but Bill in this thread says that he got it to work. 我要指出的是我还没有尝试过,但是Bill在这个话题中说他已经开始使用它了。

No, you can only use XAML with C#, or HTML+CSS+JS. 不,您只能将XAML与C#或HTML + CSS + JS一起使用。 But XAML is great markup language, so I think you able to use it. 但是XAML是很棒的标记语言,因此我认为您可以使用它。

You can create a "WinMD" library in c# (or c++) that can be invoked from JavaScript. 您可以在c#(或c ++)中创建一个可从JavaScript调用的“ WinMD”库。 There are a ton of limitations that WinMD libraries have over normal .net libraries and the usage model would be would at all like ASP.NET MVC. WinMD库比普通的.net库有很多限制,使用模型将完全像ASP.NET MVC。 Frankly, unless you have a lot of business logic in c# already or if you want to reuse a bunch of code in Win8 Metro apps spanning both HTML and XAML, this WinMD thing is more hassle than its worth. 坦白说,除非您已经在c#中使用了很多业务逻辑,或者如果您想在Win8 Metro应用程序中重用跨越HTML和XAML的大量代码,那么WinMD的麻烦就在于其价值。

根据MSDN-开发中心-Metro风格的应用程序,您可以使用C#/VB/C++ and XAML以及JavaScript and HTML5来开发Metro风格的应用程序(适用于Windows8 / WindowsPhone)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM