Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic adding color palette to dashboard and allow to add colors to selected node using color palette (Read 3125 times)
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
adding color palette to dashboard and allow to add colors to selected node using color palette
Apr 19th, 2017 at 5:20am
Print Post  
I want to add color palette to canvas toolbar like Microsoft paint (like attached picture), then once select a node on canvas and apply colors to it using color palette how can I do this ?

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: adding color palette to dashboard and allow to add colors to selected node using color palette
Reply #1 - Apr 19th, 2017 at 8:19am
Print Post  
There are ColorEditor and ColorPicker controls in mindfusion.common.wpf assembly. E.g. using ColorEditor you could change node's color like this -

Code
Select All
void OnColorClick(object sender, EventArgs e)
{
	if (diagram.ActiveItem != null)
		diagram.ActiveItem.Brush = new SolidColorBrush(colorEdit.SelectedColor);
}

<mfc:ColorEditor x:Name="colorEdit" ColorBoxClick="OnColorClick" /> 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Re: adding color palette to dashboard and allow to add colors to selected node using color palette
Reply #2 - Apr 19th, 2017 at 10:27am
Print Post  
thnks now I can add and modify colors to selected node, but once I save this diagram to XML file and once I open through text editor,  I cannot see any color property for that applied color for each node

These are the Node properties I can see

Code
Select All
  <Nodes>
    <Node Class="std:ShapeNode" Version="1" Id="0">
      <Bounds>58, 48.04, 60, 30</Bounds>
      <ZIndex>1</ZIndex>
      <LayerIndex>-1</LayerIndex>
      <HyperLink>
      </HyperLink>
      <Locked>False</Locked>
      <Visible>True</Visible>
      <Printable>True</Printable>
      <Brush Id="0" />
      <Weight>1</Weight>
      <IgnoreLayout>False</IgnoreLayout>
      <Obstacle>True</Obstacle>
      <AllowIncomingLinks>True</AllowIncomingLinks>
      <AllowOutgoingLinks>True</AllowOutgoingLinks>
      <EnabledHandles>768</EnabledHandles>
      <Expanded>True</Expanded>
      <Expandable>False</Expandable>
      <HandlesStyle>1</HandlesStyle>
      <Effects />
      <Shape Id="Rectangle" />
      <ShapeOrientation>0</ShapeOrientation>
      <PolygonalTextLayout>False</PolygonalTextLayout>
      <EnableStyledText>False</EnableStyledText>
      <ImageAlign>1</ImageAlign>
      <RotateImage>True</RotateImage>
      <RotateText>False</RotateText>
      <Transparent>False</Transparent>
      <CustomDraw>0</CustomDraw>
      <ClipImage>True</ClipImage>
    </Node> 



please let me know where that color property located
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: adding color palette to dashboard and allow to add colors to selected node using color palette
Reply #3 - Apr 19th, 2017 at 11:27am
Print Post  
It's the <Brush Id="0" /> element, pointing to a more detailed brush description later in the XML under Brushes element.
  
Back to top
 
IP Logged
 
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Re: adding color palette to dashboard and allow to add colors to selected node using color palette
Reply #4 - May 8th, 2017 at 4:04am
Print Post  
currently my color palate like this



can I change color palate template here something simple one
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: adding color palette to dashboard and allow to add colors to selected node using color palette
Reply #5 - May 10th, 2017 at 5:59am
Print Post  
You can edit the template using Edit Template -> Edit a Copy command from control's context menu, and I guess set the Visibility property of components you don't need to Hidden/Collapsed .
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint