Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic CollapseButtonBrush or equivalent on Diagrams? (Read 1809 times)
ToddGreve
YaBB Newbies
*
Offline



Posts: 4
Location: USA
Joined: Mar 19th, 2010
CollapseButtonBrush or equivalent on Diagrams?
Jun 19th, 2010 at 2:26am
Print Post  
The Diagram has a setting to define the brush to use for the expand/collapse button on your canvas. You can define this to use an ImageBrush so you can use a custom graphic. Is there a way though to define a difference brush/image for when the object is expanded vs when it is collapsed?
I would like to use a custom graphic indicating this node is expanded, and a second one to indicate it is collapsed but don't see a way to do this so far.
Any one have any ideas? Would I have to customize the DiagramLite source to get this functionality?
Thanks in advance
Todd
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: CollapseButtonBrush or equivalent on Diagrams?
Reply #1 - Jun 21st, 2010 at 8:06am
Print Post  
There's no way to do that at this time. We'll try to make the button templatable for the next release.

Stoyan
  
Back to top
 
IP Logged
 
ToddGreve
YaBB Newbies
*
Offline



Posts: 4
Location: USA
Joined: Mar 19th, 2010
Re: CollapseButtonBrush or equivalent on Diagrams?
Reply #2 - Jun 21st, 2010 at 10:26pm
Print Post  
Thanks Stoyan
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: CollapseButtonBrush or equivalent on Diagrams?
Reply #3 - Jul 1st, 2010 at 12:55pm
Print Post  
Hi Todd,

We've made the ExpandButton templateble and now you can set your custom template via the Diagram.ExpandButtonTemplate dependancy property. Here's the beta build with these changes: https://mindfusion.eu/_beta/diaglite17_expandtempl.zip.

There are two defined VisualStates - "Expanded" and "Collapsed". You can use them to define your custom visual indication of a node's Expanded state.

For example:

Code
Select All
<ControlTemplate x:Key="CustomExpandButton" TargetType="diag:ExpandButton">
    <Border Background="#7DFFFFFF"
        BorderBrush="#FF000000"
        BorderThickness="1">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="States">
                <VisualState x:Name="Expanded" />
                <VisualState x:Name="Collapsed">
                    <Storyboard>
                        <ColorAnimation Duration="0"
                            Storyboard.TargetName="ExpanderRect"
                        Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
                        To="#FFFF0000"/>
                   </Storyboard>
               </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Rectangle x:Name="ExpanderRect"
            Height="5" Width="5" Fill="#FF00FF00" />
    </Border>
</ControlTemplate>

<diag:Diagram Name="diagram" ExpandButtonTemplate="{StaticResource CustomExpandButton}" />

 



Try it out and let us know what you think.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint