wckdspn
Topic Author
Posts: 67
Joined: 18 Aug 2012, 23:14

Some possibilities for improving Blend support

20 May 2014, 21:58

So, I had a thought today about Blend and Noesis and did a quick experiment to test the practicality. The idea is that, since Blend uses the referenced assemblies to build the asset library that we could remove the PresentationFramework assembly and replace it by a wrapper assembly which only has the controls and parts that Noesis supports.

First I created the wrapper control library and made the following classes:
        public class TextBlock : System.Windows.Controls.TextBlock
        {
        }

	public class Window : System.Windows.Window
	{

	}

	public class Grid : System.Windows.Controls.Grid
	{

	}

	public class Application : System.Windows.Application
	{

	}
I built that, and it was fine.

Next I made a new WPF application and deleted PresentationFramework from the references and added my wrapper assembly. Then I tweaked the default XAML with the new namespace, ending up with the following

App.xaml
<WPFWrap:Application
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:WPFWrap="clr-namespace:WPFWrap;assembly=WPFWrap"
	x:Class="WpfApplication4.App"
	StartupUri="MainWindow.xaml">
	<WPFWrap:Application.Resources>
		<!-- Resources scoped at the Application level should be defined here. -->
	</WPFWrap:Application.Resources>
</WPFWrap:Application>
MainWindow.xaml
<WPFWrap:Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:WPFWrap="clr-namespace:WPFWrap;assembly=WPFWrap" x:Class="WpfApplication4.MainWindow"
        Title="MainWindow" Height="350" Width="525">
	<WPFWrap:Grid Margin="0,2,0,-2">
        
		<WPFWrap:Text2 HorizontalAlignment="Left" Margin="209,77,0,0" TextWrapping="Wrap" Text="Text2" VerticalAlignment="Top"/>
        
	</WPFWrap:Grid>
</WPFWrap:Window>
The XAML renders in design view, and when I go to the Asset library I only see the items that I wrapped. It's just preliminary work, and clearly this WPF app won't build, but it is an interesting start.
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Some possibilities for improving Blend support

21 May 2014, 22:39

wow! This is an amazing idea!

We could even hide/add properties to that dummy classes and in theory Blend should show/hide them in the Properties window.

Who is online

Users browsing this forum: No registered users and 1 guest