views:

389

answers:

4

I know WPF libraries aren´t implemented by mono class library, however(as far as I know) the mono 2.6 runtime is fully compatible with the .NET 2.0/3.5 runtime, so if the WPF libraries only make PInvoke calls to windows api it is theoretically possible to run a wpf application on windows using the mono runtime. The reason for wanting that is deploying a wpf application as a standalone executable for windows. Has anyone tried something like that before? If so, what were the results?

+2  A: 

As much as I know, Mono does not support WPF.

Also, WPF uses graphics modules and interacts directly with the GPU. So I can't see how u can use WPF with no hidden pinvokes.

Am
I think that means that mono base class library doesnt implement WPF libraries((presentationcore.dll,presentationframework.dll...). As far as I understand(http://en.wikipedia.org/wiki/Windows_Presentation_Foundation) WPF makes unmanaged calls(using PInvoke?) to milcore.dll which comunicates with DirectX. WPF libraries are not compatible with unix systems because of that dependency on directx, however I think its libraries can be executed my the mono runtime(which can run .net 3.5 managed libraries) IF the runtime is loaded on Windows.
Thiado de Arruda
that may be possible, never tried mono outside the unix environment.
Am
A: 

Sounds like you need to read about WPF architecture to better understand it.

http://msdn.microsoft.com/en-us/library/ms750441.aspx

Many pieces are missing in Mono and solely available in .NET. Therefore, your "theory" is not correct, and you cannot run WPF applications on Mono, even on Windows.

Lex Li
What do you mean by 'pieces missing in Mono and solely avaliable in .NET'? Both 'PresentationCore.dll' and 'PresentationFramework.dll' are managed libraries, which makes them compatible with Mono's JIT. The only unmanaged piece of WPF is 'milcore.dll' which(to my knowledge) can be called from managed code either trough PInvoke or Internal CLR calls(both are suported by Mono's JIT). I have read the link you posted and it says nothing about a feature only avaliable to the .NET's CLR, pehaps you are willing to explain?
Thiado de Arruda
+2  A: 

In short... No

At this point, the Mono project does not have plans to implement Windows Presentation Foundation APIs as part of the project

Mono will provide Moonlight support which, from what I understand, would also use a subset of XAML to create its UI (the same as Silverlight does) but there are legal complications involved. Such as, it's limited to non-microsoft and non-mac platforms.

If you want to find a list of open-source cross-platform alternatives to WPF/XAML I'm working to compile a list of viable alternatives.

Evan Plaice
As I already said in the last two answers, I'm not asking if mono has an equivalent implementation of WPF libraries, I know it doesnt. What I asked is if someone tried running a wpf application on windows using the mono runtime, it doesnt matter if this application uses the managed libraries that ships from .NET or Mono, all I care to know is if the mono runtime(mono.dll) works well with wpf libraries;
Thiado de Arruda
@Thiado "What I asked is if someone tried running a wpf application on windows using the mono runtime" The problem with that statement is, WPF cannot run using the mono runtime because the mono runtime doesn't support it. The question is the equivalent to asking "does winforms work well with mono." Plainly, mono does not and will not support WPF in any form now or in the future. Except maybe Silverlight/Moonlight in a limited fashion but I addressed that avenue. When I say 'Mono' I'm referring to the runtime and the library.
Evan Plaice
Evan, theres a diference between the Mono runtime and Mono BCL. Mono BCL does not have plans to add WPF libraries, However Mono runtime is an implementation of ECMA Common Language Infrastructure. Mono runtime and .NET runtime are both native programs that the main purpose is to execute(JIT compile) managed assemblies(System.dll,PresentationFramework.dll). Thats why Mono can run programs written for .NET and vice versa. Thats why I posted this question. Theoretically the Mono runtime can execute WPF libraries as well as .NET does(as long as it is on windows due to Directx dependencies).
Thiado de Arruda
See for yourself: http://www.ecma-international.org/publications/standards/Standard.htmThere is no note anywhere that WPF/XAML is an ECMA standard. Theoretically mono 'could' run WPF/XAML, but the first link in my answer is a clear indication that it won't because the mono development team is not willing to support it. In this case, mono (the organization) encompasses the runtime and the BCL.
Evan Plaice
Believe me, I've been searching everywhere for an indication that it could. Most of what I've found is controversy about MS not releasing a standard for XAML and MS forcefully including support for it in browsers without user's permission. A lot of people think XAML is a strategic move to try to overtake HTML on the web.
Evan Plaice
WPF/XAML is not an standard, but compiled WPF applications contain intermediate language code. XAML is compiled into BAML(which is certainly not understood by mono or the .net runtime) but the BAML processing is probably done by one of the managed WPF libraries(PresentationFramework.dll/PresentationCore.dll) if not my the unmanaged library(milcore.dll). So far, I have seen nothing that stops Mono from running wpf applications(if those managed WPF libs are avaliable in Mono's probe path). Since no one ever tried, I will test myself when I get the time.
Thiado de Arruda
A: 

At MIX 2010 Miguel de Icaza said in his session that Mono isn't going to support WPF. Anything tangentially related to WPF-like support is only to provide what is needed for Moonlight.

TodK