In WP7 I am used to generating sample data (XML) from my ViewModels in Blend and seeing them in Visual Studio.
In Blend 2012 I cannot find the option to generate design time data. The tempales in Visual Studio use design time data genarated in code. Is it the only way? No more XML design time data?
I don't think generating design time data in Blend for VS2012 is possible, but it's still possible to use design time data created in code, but even this is more complicated than in WP7.
Basically you have to use this construct in XAML to make it work:
<Page.Resources>
<CollectionViewSource x:Name="imagesSource" Source="{Binding Model.Images}"
d:Source="{Binding Model.Images, Source={d:DesignInstance Type=local:MainViewModel, IsDesignTimeCreatable=True}}"/>
</Page.Resources>
The important part here is the "d:DesignInstance" and "IsDesignTimeCreatable=True", the rest is quite similar to WP7.
Not possible to use design time data in XML like in WP7
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
I design a UWP application.
In this one I am asked to make many reports that they are invoices or print delivery for example.
These can therefore have different models and these can be fixed or dynamic.
I explore different ideas:
- In the old application in WPF, we used an old version of DevExpress but it's really not easy to make reports simply and scalable ways easily
- There are indeed things like Telerik, ComponentOne but it's really expensive for what it does and I can not find an open source component.
- I looked to be able to make the models in XAML and be able to print them which would be ideal, however it works well with text but with tables (listbox, listview, datagrid ...) I can not manage the pagination.
Do you have any ideas? I do not know Power Bi Embedded well but maybe be an idea? I would like something scalable and simple to implement and without having to pay exhobirating sums for this kind of component.
use all in one DataGrid for enterprise LOB apps on uwp platform, it offers you editing, filtering and sorting etc as well : https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/datagrid
use Print helper to print stuff from your uwp app. : https://learn.microsoft.com/en-us/windows/communitytoolkit/helpers/printhelper
Also please do look through other controls and helpers within windows community toolkit you might find some other stuff as well to help and simplify your uwp app developing experience :)
I'm making a Windows Store App. Unfortunately it has some performance issues on weaker ARM devices. After reading this article about how to optimize the loading of XAML, I'm interested if there is any tool that will allow me to see a tree of where resources are referenced and/or help me optimize it.
For a visual tree you can use Document Outline in VS. Some other handy XAML tools are like WPF Snoop, or Silverlight Spy, but most of all just good 'ol Expression Blend is a dear friend when working with xaml & templates. Hope this helps.
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.