WPF never ended up supporting XAML 2009, which is a shame because it added some useful extensions, such as generic type parameters and complex x:Key values.
UWP seems to have built upon WPF. Does it, or anything else in .NET 4.6/Windows 10 support XAML 2009, six years after the fact?
The situation in 2018:
For UWP, the answer is no. It's built over XAML 2006.
For WPF, the answer is mainly no. You can in theory use it but with big caveats.
For anything else, the answer is yes: Xamarin.Forms is XAML 2009 based.
The big question mark is XAML Standard. We haven't heard from it for a while and I think it was presumed that it's going to be XAML 2006 based because WPF and UWP are. You might find the following (open) GitHub issue interesting: Use XAML 2009 as the basis for XAML Standard
Related
In WPF, I used the normal combination of:
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d:DataContext="{d:DesignData...}"
To allow a design-time DataContext to be set. This meant that I got reasonable Intellisense in my XAML. I realise the above code doesn't compile but you get the idea.
I've just started using MAUI (without Blazor) and am looking to achieve the same thing - so that I can tell Visual Studio that my ContentView will be bound to a specific object type, ie d:BindingContext="" in a way that will be ignored at runtime? It would make designing ItemTemplates so much easier!
Thanks for Jason's comment. I actually came across the answer to this question in a James Montemango video too.
x:DataType is fantastic - it is stronger than the old system in that it actually provides compile-time protection for the bindings.
Edit: The video in question is: https://youtu.be/3-cT97sBmxM
Google (as of Feb, 2017) returns only 7 results when searching for "MvxNavigationPage", where only one of them is more or less related to this class and provides no any particular knowledge of it.
MvxNavigationPage<T> is not presented neither in any (basic) documentation of MvvmCross, nor in any examples (more or less gathered) about this framework.
So, can somebody give me a hint of how to use it in XAML?
MvvmCross fully supports Xamarin.Forms only since May 2017 (version 5.0).
Also MvvmCross is fully open source so nothing stops you from reading the source code and knowing exactly what any class in the framework does.
You can even search whole GitHub for all references to MvxNavigationPage if you need to.
Your question is very attacking. Please keep in mind that the people behind MvvmCross do it for free in their free time and are bringing great features and regularly updating the framework. They are also very active here one SO with most questions being answered at the same day when they are asked. There is only a few frameworks that are this active, so it deserves recognition rather than any offensive.
To answer your question. You use MvxNavigationPage in place of the Xamarin.Forms NavigationPage where required. It is derived from MvxEventSourceNavigationPage which in turn derives from Xamarin.Forms NavigationPage. The advantage of MvxNavigationPage is that it fully supports MvvmCross, like including the typed ViewModel and integrating into the MvvmCross lifecycle.
When can we expect XAML 2009 support in the tools like Expression Blend 4, Visual Studio 2010? Has Microsoft mentioned something somewhere publically? Willl we have to wait for Blend 5 and VS 2012?
I don't think Microsoft has mentioned this, from my understanding you can use it in WPF if you use loose Xaml files, but no designer support.
I am interested in using Xaml with expression blend for creating user interfaces in an application. However, because of the limitations of the target architecture, I cannot use WPF or C#.
So, what I am interested in is in any examples / existing projects or advice from anyone who has experiance of this technology on the use of Xaml in it's "Pure" form as a specification language not tied to WPF.
Specific questions:
1) Is it possible to use Blend + Xaml without the WPF elements, or without C# backing classes?
2) Are there any other implementations of Xaml parsers etc. which use different architectures, and can they work with blend or similar tools.
3) Are there alternative editor / designer tools which can help in this situation?
I am aware of the MyXaml and MycroXaml projects, and have found a lot of resources on the web about Xaml, but 99% of it relates directly to WPF. This is fine for understanding the concepts of Xaml, but doesn't help with the implimentation I need.
Many thanks!
Have you checked out the XAML spec.
http://download.microsoft.com/download/0/A/6/0A6F7755-9AF5-448B-907D-13985ACCF53E/[MS-XAML].pdf
XAML 2009 and the system.xaml.dll in clr 4.0 is probably going to be a god send for you if you can wait for it.
here is the PDC presentation on it.
http://channel9.msdn.com/pdc2008/TL36/
Now since you said you can't use C#, I am guessing you are not able to use the .net framework?? or using Mono. as far as I know there are no plans to implement XAML support in Mono. So either you would have to write your own XAML parser, and Object graph.
Of course if you are willing to do that you may want to wait for XAML 2009 spec as it adds significant improvements to the xaml language.
Douglas
Does Silverlight help you in anyway?. Now there is an Eclipse plug-in available for you to use Silverlight with eclispe. So you will be able to use Expression blend to design your UI and use Java for the backend coding(Future plan I think). Check out this link for more details. http://www.eclipse4sl.org/
I am using a XAML-based XML document as the core of the new AppMaker v3. I'm currently parsing it in Ruby to generate various output including pure XAML/C# WPF apps.
XAML is very easy to parse especially if you take an XPath approach:
windows = []
REXML::XPath.each(doc, "//Window") do |xml|
windows << Window.new(xml)
end
#... invoking ...
#items = []
xml.each_element("Canvas/*") do |itemXML|
#items << WindowItem.makeItem(itemXML)
end
The real issue, about which we need more information, is what kind of GUI you are trying to generate. The Canvas explicit positional layout in XAML is easy to parse and generate some simple Win32 controls and drawing. If you get into the constraint-based layout like StackPanel then you will have to recreate much WPF behaviour.
If your not using WPF then Xaml as its core is no better than XML really. Xaml has a few flavours but they are essentially addition functionality in the form of libraries. You could use Vanilla Xaml as a base but then you would essentially have to build a parser that reads it and then a framework of code that it essentially maps to. Xaml does not know what a StackPanel is it essentially sends the Textual data off to be compiled by whatever does know what it is, this is the part you would be missing, and its a pretty big part.
I don't mind learning xaml and I'm sure I need to be familiar somewhat, but when I was first trying out Silverlight 1 with javascript it looked like a tremendous amount of overhead. I decided to wait until tools matured and asp.net was added. Well, asp.net has been added with Silverlight 2.0, and now I want to look at using it. But, xaml, to me, still looks like a lot of work for each small step. My experience with Flash seemed a lot more simpler for the graphics side of things (never liked ActionScript that much.) Will $500 for Blend take care of much of my xaml concerns? Can I use Visual Studio Express with the full version of Microsoft Expression Blend?
Do I need Microsoft Expression Studio 2?
Thank you.
Just as a profressional web developer can't lean on Dreamweaver's drag-and-drop to avoid learning HTML, you should climb the XAML learning curve.
Blend will still help, however- just as many started up the HTML curve by doing some drag-and-drop and studying the resulting HTML code. I did some prototyping with Silverlight 1.1 and Blend helped significantly in my understanding of XAML. It helps to have a "real" project to work on, even if it's a proof of concept. Concentrate on the containment paradigm between Canvas and other elements and you'll pick it up quickly enough. I wouldn't worry too much about the MPATH stuff, do rely on the tool for that.
Microsoft Expression Blend takes care of a lot of XAML for you and helps you create animations and setting up triggers (XAML triggers). I would hate to have to do all that by hand coded XAML. I have not used Blend with Visual Studio Express but I believe it will work just fine. Microsoft Expression Blend 2 uses the sln file to open a project.
Expression Blend will not help with databinding. VS2010 promises databinding in its WPF designer, but if you can't wait until then, look to learning some XAML.
Count XAML as one of the many new .NET 3.5 things to learn when working with WPF/Silverlight. I recommend Pro WPF in C# 2008 from APress
Expression Blend give you the ability to draw shapes, paths, Union or diff shapes, create animations (similar to Flash Tweening), wire up simple triggers (like on mouseover play an animation). All with out having to dive into XAML.