Change the style of the generated buttons

Thread is closed for posting
3 posts, 0 answers
  1. Marcello
    Marcello avatar
    4 posts
    Member since:
    May 2013

    Posted 29 May 2013 Link to this post

    i'm trying to completely restyle the messageBox using the ControlTemplate (ImageTemplate in examples) as a starting point.
    What i'm trying to achieve is to change, other than the style of the box and the other elements inside, also the design of the generated buttons. (the ones that are inside the stackpanel "PART_ButtonsPanel").
    I need to do that because the background that i'm now using for the MessageBox is almost white, and the buttons are barely visible.
    How can i do that?
    This is the actual Template portion related to the ButtonsContainer:

    <ContentControl Grid.Row="3" x:Name="PART_ButtonsContainer" HorizontalContentAlignment="Stretch" Foreground="#FF0D375A" Grid.ColumnSpan="2">
                              <StackPanel x:Name="PART_ButtonsPanel" Orientation="Horizontal"></StackPanel>
    Many thanks in advance

  2. Victor
    Victor avatar
    1358 posts

    Posted 03 Jun 2013 Link to this post

    Hi Marcello,

    Thanks for writing.
    Since the stack panel contains the buttons, you can put an implicit style in the stack panel resources that targets the Button type. This should override the default styles with your settings.

    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. Marcello
    Marcello avatar
    4 posts
    Member since:
    May 2013

    Posted 03 Jun 2013 Link to this post

    Thank you very much.
    That's exactly what i was looking for!!!

    PS:(Do i have to mark this thread as solved somewhere?)
Back to Top