Sean McDirmid started this CodePlex project, and just released RC2 of Bling. From http://bling.codeplex.com/:
Bling is a C#-based library for easily programming images, animations, interactions, and visualizations on Microsoft's WPF/.NET. Bling is oriented towards design technologists, i.e., designers who sometimes program, to aid in the rapid prototyping of rich UI design ideas. Students, artists, researchers, and hobbyists will also find Bling useful as a tool for quickly expressing ideas or visualizations. Bling's APIs and constructs are optimized for the fast programming of throw away code as opposed to the careful programming of production code.
Bling as the following features that aid in the rapid prototyping of rich UIs:
- Declarative constraints that maintain dynamic relationships in the UI without the need for complex event handling. For example, button.Width = 100 - slider.Value causes button to shrink as the slider thumb is moved to the right, or grow as it is moved to the left. Constraints have many benefits: they allow rich custom layouts to be expressed with very little code, they are easy animate, and they support UIs with lots of dynamic behavior.
- Simplified animation with one line of code. For example, button.Left.Animate.Duration(500).To = label.Right will cause button to move to the right of label in 500 milliseconds.
- Pixel shader effects without the need to write HLSL code or boilerplate code! For example, canvas.CustomEffect = (input, uv) => new ColorBl(new Point3DBl(1,1,1) - input[uv].ScRGB, input[uv].ScA); defines and installs a pixel shader on a canvas that inverts the canvas's colors. Pixel shading in Bling takes advantage of your graphics card to create rich, pixel-level effects.
- Support for multi-pass bitmap effects such as diffuse lighting.
- An experimental UI physics engine for integrating physics into user interfaces! The physics supported by Bling is flexible, controllable, and easy to program.
- A rich library of geometry routines; e.g., finding where two lines intersect, the base of a triangle, the area of triangle, or a point on Bezier curve. These routines are compatible with all of Bling's features; e.g., they can be used in express constraints, pixel shaders, or physical constraints. Bling also provides a rich API for manipulating angles in both degrees and radians.
- And many smaller things; e.g., a frame-based background animation manager and slide presentation system.
- As a lightweight wrapper around WPF, Bling code is completely compatible with conventional WPF code written in C#, XAML, or other .NET languages.
Bling is an open source project created by Sean McDirmid and friends to aid in design rapid prototyping. We used Bling to enhance our productivity and would like to share it with other WPF UI design prototypers.
As we always the love the two way discussion about WPF/XAML, the WPF team is excited about the upcoming MVP Summit and Mix09.
- MVP Summit is by invitation only for Microsoft MVPs.
- Mix09 is the Microsoft Web Conference. Lots of Silverlight and WPF there!
@ MVP Summit, I’ll be giving a talk on XAML on Tuesday, 3/3. It’ll be an evolution of our PDC09 talk on XAML. I also plan on attending a Monday evening social gathering… Hope to see you there (or meet you if we haven’t met yet).
@ Mix09, I’m not attending this year. My team needs my total attention right now, so I can’t spare a week at Mix this year. Also, most of my focus right now is XAML, and I’m less focused on WPF overall, so there are better people to present on WPF issues. I’ll update this post later with pointers to the WPF sessions… I’ll be watching many sessions from Redmond…
Dear XAML Nation:
My days, like many of you, are filled with work with XAML. This space gets more exciting every year! I wanted to do a brain dump of our current work items, plans, etc… We first unveiled most of this information at our XAML talk at PDC 2008. If you haven’t seen that talk and you are hungry to understand much of the writing below, you should watch the video. We’re trying to be transparent with our progress with this complex set of components and scenarios. I look forward to your questions/comments now, and when you get the first .NET 4 beta…
Thanks, Rob
New XAML Engine for .NET 4 – System.Xaml
We are providing a unified, enhanced XAML engine for WPF, WCF, WF and more. This unified XAML engine is System.Xaml.dll (planned to ship in .NET 4).
New XAML Language Features: XAML2009 - XAML2009
At PDC 2008, we discussed ~9 new XAML language features. When .NET 4 Beta 1 ships, we’ll begin posting individual posts going into the different features.
XAML Reading
Our work to make WPF 4 use System.Xaml includes a new codebase for interpreting XAML files. XamlXmlReader will ship in System.Xaml.dll v4. Current users of XamlReader.Load() will automatically get the new engine doing the same work for them, but better.
BAML Reading
Our work to make WPF 4 use System.Xaml includes a new codebase for interpreting BAML files (a binary format). Baml2006Reader will ship in PresentationFramework.dll v4. Our focus here right now is compatibility and matching performance of BAML in v3. BAML in general, at least for built in WPF types, avoids much of the reflection that XAML usually needs to go through. Current calls to Application.LoadComponent() will automatically get the new engine doing the same work for them, but better.
- FxCop: With .NET 4, FxCop rules that can analyze BAML will be possible to write. If appropriate for your scenario, using XamlXmlReader in FxCop would also allow you to write FxCop rules to analyze XAML (if you distribute this as part of this app) as well (without having to create the corresponding object graph.)
Localization – WPF (BAML) – UI Localization
We have work under way to make the localization APIs that LocBaml relies on built on top of the System.Xaml infrastructure. As we do that work, we are attempting to address several issues in this space. We are unsure if this work will ship with .NET 4 or seperately. In v3, it was provided by PresentationFramework.dll, but this API generally isn’t needed at runtime, so we are considering not making it part of the framework directly.
As more and more groups inside and outside of Microsoft are localizing more and more BAML, we are getting a very good idea of which problems we need to focus on first.
Localization – XAML (Silverlight, other)
The work I mention above in “Localization – WPF (BAML)” will benefit localization scenarios (x:Uid based) for XAML as well (not just BAML). Systems that want to benefit from that should make sure to not crash if they see an “x:Uid” attribute.
Markup Compiler – WPF
We have a goal to completely rewrite the markup compiler, however it is very unlikely that will happen in .NET 4. We likely provide an updated Markup Compiler in conjunction with good support from Cider and Blend for XAML2009 features. Designers and compilers need to move in lock step, ideally.
BAML Writing
Since both Localization and the WPF Markup Compiler require Baml2006Writer, and since they both may not ship in the v4 box, we may not have Baml2006Writer baked enough to ship in the runtime in v4. I still hope to, but it may not be feasible. We’ll see. I know many of you want this!
- Obfuscation of BAML: once we provide the BamlWriter, we believe that obfuscation engines will be able to obfuscate type/member names in BAML.
XAML Writing
We have invested a lot of time and effort in XamlServices.Save() which uses XamlObjectReader and XamlXmlWriter under its covers. If all goes well, we will be providing a number of enhancements for current uses of XamlWriter.Save(). We currently don’t plan to make your old calls to XamlWriter.Save() use the new XAML Writing engine in v4, but if XamlServices.Save provides value for you, you can call it.
Markup Compiler – Silverlight
My team builds the markup compiler that validates XAML and generated .g.cs/.g.vb code files in Silverlight projects. We are doing some minor work in this space for SL3 and plan more major investments in releases beyond that.
XAML Language Spec - Specification
We are actually finally getting some customer issues on [MS-XAML] come in through our support channels. Great to get these. We plan on shipping a version updated with fixes for many of those issues and including the new XAML2009 features.
XAML Vocabularies – XAML Vocabularies, Specification
WPF v4 – we are planning on shipping a draft of the WPF v4 XAML Vocabulary when Beta 1 ships. This will be similar to [MS-WPFXV], with new stuff added in.
Other – inside Microsoft and around the world we continue to see more and more people use XAML for things other than UI, Workflows, Paper. We’re always excited to see new uses for XAML!
I worked with a part of the VS2010 team recently to improve XamlReader.Load performance for an important scenario. It was taking 120ms to load a XAML file and create the objects that it specified. It seemed like the XAML was a bit verbose, so I wrote a quick tool to analyze the types, properties and values used. Digging in, I was able to see that many properties were set on every instance of that type, and usually to that same value. That was a clue that the DefaultValueAttribute of many of the properties was not set appropriately.
A few days later, I heard of 2 improvements that helped perf of this scenario (measured in warm start scenarios, I believe):
- moving to the System.Xaml.dll engine improved this scenario from 120ms to 72ms
- fixing the default values, and thus loading a smaller XAML file, took it down from 72ms to 38ms
We will still try to help them reduce the time more, but we’re really happy with the progress so far. It is also exciting to see VS adopting XAML in their UI and for several other scenarios as well.
We’re really happy of our current XAML to Object performance of the new XAML stack…we continue to profile many scenarios and figure out other ways to get more speed. Our BAML to Object performance right now isn’t where we need it, so we are actually investing more optimization/profiling time there right now…
Getting the XAML Analysis Tool
The tool I wrote uses System.Xaml.dll, so I won’t ship it yet…but I’ll provide my little utility as it may help others understand how their XAML Vocabulary can be improved.