This project is read-only.

Can this work with .NET 4?

Mar 11, 2013 at 3:24 PM
This project looks great! But I have a requirement to be able to target XP machines, which means that the latest .NET framework that I can use is 4.0.

Will this be able to run on a .NET 4 machine, or is 4.5 a hard requirement?

if the latter, is there a possibility that this -could- be built on 4.0?
Mar 11, 2013 at 10:09 PM
.NET 4.5 is not a hard requirement, although some 4.5 features such as async/await are used. As far as XP is concerned; I'm not entirely sure the chromeless window feature of Modern UI works on XP, need to test that.

See also this related workitem
Mar 11, 2013 at 10:31 PM
I've also placed a comment on that workitem.

With not having seen the code, how much effort would the migration away from the async/await be? Where does it lie on your radar in terms of priority? I'm trying to plan out the design of a new project that will be starting soon and get a rough guage on if we can wait for a .NET 4 port to be available.
Mar 11, 2013 at 10:40 PM
Migrating away from async/await is fairly straightforward. I expect the most work to be in setting up and maintaining an additional WPF4 classlib project and testing chromeless windows on XP.

It seems .NET4 support is in demand, so I'll most likely start working on it very soon.
Mar 12, 2013 at 11:26 PM

Today I was analysing the source code and I found just 1 interface (IContentLoader) that forces the use of new async feature.
I think it's not hard to replace that piece of code.

Maybe if we could not replace, maybe we could use Async Targeting Pack for Visual Studio 2012, its a plugin JUST FOR VS 2012 that enables async features for .NET 4.0

Let me now if I can help in something as I'm looking forward in use this library to an application I should try to contribute.

Mar 14, 2013 at 9:48 AM
Do you have any ideas when it will be released ?
Mar 14, 2013 at 12:28 PM
Edited Mar 14, 2013 at 12:28 PM
I've commented on the workitem with a possible solution and code. Thanks gblmarquez for the info on Async Targeting Pack!
Apr 26, 2013 at 4:28 PM
So indeed v1.0.3 does work with .net 4, however it seems that none of the control styles are preserved when it is run on XP. The windows that comes up appears chrome-less, but buttons / textboxes / scrollbars / everything look as original unstyled controls.

any ideas? this is a show-stopper for me :/
Apr 26, 2013 at 4:38 PM

do you have windows xp themes enabled?
Apr 26, 2013 at 6:26 PM
Themes are enabled on my XP machine.

I also noticed that for the .net 4 version of MUI, that on my Win7 machine --without .net 4.5--, the controls also look unstyled.. however as soon as I install .net 4.5, but still run the .net 4.0 version, the app looks perfecct....
Apr 26, 2013 at 6:43 PM

This can be an issue, maybe we should warning @kozw about it.
Apr 27, 2013 at 6:12 PM
Make sure you implement a workaround for WPF 4.0 so control styling works. See this newly created document page for details.
May 16, 2013 at 8:40 PM
Edited May 16, 2013 at 9:41 PM
Demo Revision: 100280 (1.0.3+) does works fine here in XP aswell in Windows 8 after recompilation without the WPF4 patch and any difference I could notice, look the screenshot

To compile the demo, I have used VS2012, NuGet and TortoiseSVN (if you don't have check the bottom of my post I posted modified binaries)

1) Checkout svn mui sources from

2) Set FirstFloor.ModernUI.App startup project

3) In the FirstFloor.ModernUI build properties set 'Conditional compilation symbols' to NET4

4) Change FirstFloor.ModernUI and FirstFloor.ModernUI.App to target Framework 4.0

5) For the project FirstFloor.ModernUI.App Right click Reference and select Manage nuget packages

6) Select Online, select show pre releases, and search "Microsoft.Bcl.Async" and Install it

7) Set all references in FirstFloor.ModernUI.App to Copy Local = False except for FirstFloor.ModernUI and Microsoft.Windows.Shell

Also on XP install these redistributables (ModerUIDemo.exe shows a link to msvcr100_clr0400.dll in my VM)

NET Framework 4.0
Visual C++ Redistributable for Visual Studio 2012 Update 1

Have 7zipped the modified sources and binaries if you cant get it so you can confirm it also works for you, hosted on google drive

Gave kozw's project a 5/5, that's a pity I couldn't give it a 6/5 :P, I just would have compiled ModernUIDemo.exe against 4.0 so that it runs out of the box in XP. Yet for XP you best have to compile with the steps I showed you to benefits most up to date async component