Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Width read-only (Read 3724 times)
RichardW2C
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jul 13th, 2011
Width read-only
Jul 20th, 2011 at 10:41am
Print Post  
Hi

When I try to drag and drop a component from the toolbox to the xaml designer, like a SahpeNode, I have an error message saying "The property 'Width' is read-only and cannot be changed".
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Width read-only
Reply #1 - Jul 20th, 2011 at 11:04am
Print Post  
Hi,

How have you managed to add a ShapeNode to the toolbox? It does not derive from Control and should not appear there when you add the diagramming.wpf.dll assembly to the toolbox.

Stoyan
  
Back to top
 
IP Logged
 
RichardW2C
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jul 13th, 2011
Re: Width read-only
Reply #2 - Jul 20th, 2011 at 12:16pm
Print Post  
Well, not sure. So I reset the toolbox and dropped the dll. Now I see various layouts in the toolbox, is that ok? What should appear here?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Width read-only
Reply #3 - Jul 20th, 2011 at 1:21pm
Print Post  
Oh, now I see VS2010 shows the nodes indeed, it probably shows all FrameworkElement derived classes, while older versions only showed controls. Nodes don't really have a settable Width, but a Rect Bounds property, and it seems VS decides to assign some value to Width after drag and drop anyway. You could add nodes through Xaml instead:

Code
Select All
<diag:Diagram ...>
	<diag:ShapeNode Bounds="40,40,50,50" Shape="Ellipse" />
</diag:Diagram>
 

  
Back to top
 
IP Logged
 
RichardW2C
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jul 13th, 2011
Re: Width read-only
Reply #4 - Jul 20th, 2011 at 1:55pm
Print Post  
When I try that:

Code
Select All
<Window x:Class="MaquetteConsole.MainWindow"
	  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:diag="http://mindfusion.eu/diagramming/wpf"
    Title="Maquette Console" Width="1200" Height="600"
Loaded="OnWindowLoaded">
    <Grid>
	  <Grid.RowDefinitions>
		<RowDefinition Height="Auto">  </RowDefinition>
		<RowDefinition></RowDefinition>
	  </Grid.RowDefinitions>

	  <Label Name="Etiq" Grid.Row="0">Glop</Label>

	  <ScrollViewer Grid.Row="1">
		    <diag:Diagram Name="diagram"
BackBrush="White"
ShapeBrush="LightBlue"
DefaultShape="Rectangle">
		    <diag:ShapeNode Bounds="40,40,50,50" Shape="Ellipse" />
		</diag:Diagram>
		</ScrollViewer>
    </Grid>

</Window>
 



It compiles and works, but the designer windows show an error message: "The document constains erros that must be fixed before the designer can be loaded".

In the XAML windows, all the diag part inside the ScrollViewer is underlined, and the error tooltip says : "Object reference not set to an instance of an object".
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Width read-only
Reply #5 - Jul 20th, 2011 at 7:09pm
Print Post  
Try adding the initial node from the code-behind for the being. We'll check what happens when we add Width and Height setters in the next couple of days.
  
Back to top
 
IP Logged
 
RichardW2C
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jul 13th, 2011
Re: Width read-only
Reply #6 - Jul 21st, 2011 at 12:39pm
Print Post  
Ok, thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint