Style for RadGeometryDropDownButton

5 posts, 0 answers
  1. Svyatoslav
    Svyatoslav avatar
    22 posts
    Member since:
    Oct 2016

    Posted 16 Nov 2016 Link to this post

    Good afternoon. How can I set a style for RadGeometryDropDownButton? Now I'm trying to do it this way: 

     <telerik:RadGeometryDropDownButton CloseOnClick="False" Style="{DynamicResource MetroCircleButtonStyle}" Width="50" Height="50"  >

    I took the example for "setup page" from DiagramToolbox, but when I apply the style, the button stops working.

  2. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 18 Nov 2016 Link to this post

    Hi Svyatoslav,

    It is very hard to say what's causing this problem on your side as it is not clear for me what is the MetroCircleButtonStyle you applied. Can you provide the full source code including this style or if possible can you say where did you get it from as our look up into the QSF and SDK demos of RadDiagram  didn't show such style? 

    Regards,
    Evgenia
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
  3. Svyatoslav
    Svyatoslav avatar
    22 posts
    Member since:
    Oct 2016

    Posted 21 Nov 2016 in reply to Evgenia Link to this post

    this style of  NuGet pack MahApps.Metro. http://mahapps.com/controls/buttons.html

    In button type " <Button/>" this style works, for example:

     <Button Command="telerik:DiagramCommands.Redo" CommandTarget="{Binding ElementName=diagram}" Width="50" Height="50" Style="{DynamicResource MetroCircleButtonStyle}" ToolTip="{x:Static res:Resources.Redo}">
                                    <Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="20" Height="20">
                                        <Rectangle.OpacityMask>
                                            <VisualBrush Visual="{StaticResource appbar_redo}" Stretch="Fill"/>
                                        </Rectangle.OpacityMask>
                                    </Rectangle>
                                </Button>

    where StaticResource appbar_redo is:

     <Canvas x:Key="appbar_redo" Width="76.0106" Height="76.0106" Clip="F1 e 0,0L 76.0106,0L 76.0106,76.0106L 0,76.0106L 0,0">
            <Path Width="34.8358" Height="32.9005" Canvas.Left="20.5862" Canvas.Top="20.5864" Stretch="Fill" Fill="{DynamicResource BlackBrush}" Data="F1 M 50.672,20.5864L 55.4219,25.3364L 55.422,38.0031L 42.7553,38.0031L 38.0053,33.2531L 46.8578,33.2522C 44.6831,30.8224 41.5227,29.2932 38.0052,29.2932C 31.4459,29.2932 26.1285,34.6106 26.1285,41.1699C 26.1285,44.4495 27.4579,47.4187 29.6071,49.5679L 25.6881,53.4869C 22.5359,50.3347 20.5862,45.9799 20.5862,41.1698C 20.5862,31.5494 28.385,23.7507 38.0053,23.7507C 42.9966,23.7507 47.4975,25.8499 50.6734,29.2137L 50.672,20.5864 Z "/>
        </Canvas>

  4. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 23 Nov 2016 Link to this post

    Hello Svyatoslav,

    As I see from your last information provided the so called MahApps.Metro toolkit provides several styles to make a native MS Button with Circle or Square shape. However this won't work with our Diagram's RadGeometryDropDownButton for many reasons. First  and main reason is that the TargetType of the style is different than the control you are applying it to (i.e. you are applying Style with TargetType Button to a control that is RadDropDownButton). Another thing I'd like to mention is that we explicitly provided Geometry property for the Geometry buttons so that you can easily set your own Path Data (no need of retemplating). I highly recommend that you take a look at this online demo where we demonstrated all our Geometry buttons with custom Geometries for their content. 

    On a side note I'd like to ask why do you need a style that converts the Button to a Circle shape? I'm asking this as by default all Diagram's Geometry buttons are circled (they have Ellipse inside their default ControlTemplate) and look "circled"? 

    Regards,
    Evgenia
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
  5. Svyatoslav
    Svyatoslav avatar
    22 posts
    Member since:
    Oct 2016

    Posted 28 Nov 2016 in reply to Evgenia Link to this post

    I was given to modify the application where all the buttons have used this style. but there is a need to add additional functions(page setup, print). But thank you for your reply, I will try to repeat this style manually.

Back to Top