Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Tutorial 3 and BPMN shapes (Read 2318 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Tutorial 3 and BPMN shapes
Mar 23rd, 2010 at 7:11am
Print Post  
Hi Stoyo

I am not able to display BPMN shapes with Tutorial 3.

In tutorial3, I added following code in generic.xaml to display the shape

<Path Grid.Row="2" Grid.ColumnSpan="2" Stretch="Fill"
Data="{TemplateBinding ShapeGeometry}"
Stroke="{TemplateBinding Stroke}"
DataContext="{TemplateBinding StrokeDashArray}"
StrokeDashArray="{Binding Converter={StaticResource dashArrayConverter}}"
StrokeDashCap="{TemplateBinding StrokeDashCap}"
StrokeDashOffset="{TemplateBinding StrokeDashOffset}"
StrokeEndLineCap="{TemplateBinding StrokeEndLineCap}"
StrokeLineJoin="{TemplateBinding StrokeLineJoin}"
StrokeMiterLimit="{TemplateBinding StrokeMiterLimit}"
StrokeStartLineCap="{TemplateBinding StrokeStartLineCap}"
StrokeThickness="{TemplateBinding StrokeThickness}"
Fill="{TemplateBinding Brush}"
/>

And my OrgChartNode.cs file contains following thing -

public OrgChartNode()
{
DefaultStyleKey = typeof(OrgChartNode);
this.Shape = ShapesBpmnEndError;
}
With above changes, I am able to see only circle and not the BpmnEndError. How I can see the proper bpmn shape here.

-Rajesh
  
Back to top
WWW  
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Tutorial 3 and BPMN shapes
Reply #1 - Mar 23rd, 2010 at 8:29am
Print Post  
Hi Stoyo

I checked, the BPMN decorations are displayed using "DecorationsContainer" property.

In my application, when CreateOutlineGeometry function is not available, I am extracting the ShapeGeomertery from a static function which creates a single instance of "ShapeNode" and based on shapeID parameter fetch different geometry objects and bind the geometry collection to listbox to display various shapes in listbox.

Same way, I tried to store "DecorationContainer" i.e Grid object and tried to bind it thro' ContentPresenterr and it doesn't get displayed.

Any help on this highly appreciated ....

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tutorial 3 and BPMN shapes
Reply #2 - Mar 23rd, 2010 at 8:41am
Print Post  
Hi Rajesh,

You can copy this part from the default ShapeNode template to display the BPMN decorations:

<ContentPresenter
     Content="{TemplateBinding DecorationsContainer}"
     Visibility="{TemplateBinding ShapeVisibility}" />

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Tutorial 3 and BPMN shapes
Reply #3 - Apr 12th, 2010 at 3:45pm
Print Post  
Hi Stoyo

I am applying following template for my custom shape.

Code
Select All
		    <ControlTemplate TargetType="local:IControlerNode">
			  <Canvas x:Name="Adorner">
				    <local:ExpandConverter x:Key="expandConverter"/>
				</Canvas.Resources>

				<Grid x:Name="MyCustomGrid" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" >
				    <Path x:Name="Shape"
    Data="{TemplateBinding ShapeGeometry}"
    Stroke="{TemplateBinding Stroke}"
					  StrokeDashArray="{TemplateBinding StrokeDashArray}"
					  StrokeDashCap="{TemplateBinding StrokeDashCap}"
					  StrokeDashOffset="{TemplateBinding StrokeDashOffset}"
					  StrokeEndLineCap="{TemplateBinding StrokeEndLineCap}"
					  StrokeLineJoin="{TemplateBinding StrokeLineJoin}"
					  StrokeMiterLimit="{TemplateBinding StrokeMiterLimit}"
					  StrokeStartLineCap="{TemplateBinding StrokeStartLineCap}"
    StrokeThickness="{TemplateBinding StrokeThickness}"
    Fill="{TemplateBinding Brush}"
    Visibility="{TemplateBinding ShapeVisibility}" />

				    <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
					  <Image x:Name="Image"
Source="{TemplateBinding Image}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Stretch="Uniform">
					  </Image>
				    </Grid>

				    <Grid
    Margin="{TemplateBinding TextMargin}"
    Width="{TemplateBinding TextWidth}"
    Height="{TemplateBinding TextHeight}"
    HorizontalAlignment="Left"
    VerticalAlignment="Top">

						<TextBlock
    Text="{TemplateBinding Text}"
    HorizontalAlignment="{TemplateBinding HorizontalTextBlockAlignment}"
    VerticalAlignment="{TemplateBinding VerticalTextBlockAlignment}"
    TextAlignment="{TemplateBinding TextAlignment}"
    TextWrapping="Wrap"
    Foreground="{TemplateBinding TextBrush}">
						</TextBlock>

				    </Grid>

				    <ContentPresenter
    Content="{TemplateBinding DecorationsContainer}"
    Visibility="{TemplateBinding ShapeVisibility}" />

				</Grid>
			  </Canvas>
		    </ControlTemplate>
 


With this template, when I assign the BPMN shape, I won't be able to see the text for BPMN. I found out that it is because the extra grid "MyCustomGrid" I added.

Commenting that line works as expected.

Can you provide me a way so that with BPMN shapes I am able to see the text also with the additional grid.

Regards
Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tutorial 3 and BPMN shapes
Reply #4 - Apr 12th, 2010 at 4:02pm
Print Post  
By default text is displayed below the node for BPMN shapes. Is your custom grid showing something just below the shape geometry?

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint