views:

29

answers:

1

I'm overriding the Content of a Button. My problem is that the default style of the button gets overridden when I do this. How can I keep the old style (the old style defines mouseover, mouseout effects and the like)?

This is my code:

 <Fluent:DropDownButton SizeDefinition="Small">                                                              
                            <Fluent:DropDownButton.Template>    
                                <ControlTemplate>                                                                          
                                    <StackPanel>
                                        <Label Content="A" FontFamily="Times New Roman" FontSize="11"/>
                                        <Polygon Points="0,0 0,15 15,15 15,0"  Stroke="{Binding Fill}" StrokeThickness="5">                                               
                                        </Polygon>
                                    </StackPanel>
                                </ControlTemplate>
                            </Fluent:DropDownButton.Template>
                            <ColorSelectorModule:ColorGallery/>
                        </Fluent:DropDownButton>

P.S.: I know this is a question for a specific Library Control. However, I didn't get any response on the project's forum.

To further explain the attributes of the Fluent:DropDownButton: The Content of the Button (the code inbetween the Fluent:DropDownButton-Tags) doesn't determine what's in the button, but what is displayed in the DropDownMenu of the button. This is why I have to modify the content of the button itself (the area where you click to activate the DrowDownMenu).

What I'm trying to code here is a FontColor-Button, with a behaviour similar to a Word-FontColor-Button, where you see the current color in a bar inside the button.


For anyone who's interested, here's a link to my solution on the Fluent's project page: http://fluent.codeplex.com/Thread/View.aspx?ThreadId=221817

A: 

You are changing just the template, the template defines the behavior you are talking about not the style, there is no template inheritance so you have to manually copy all the behavior from the old template

Nir
uh, that's a bummer. then I'll have to try it this way: http://fluent.codeplex.com/Thread/View.aspx?ThreadId=212981
Torsten