Back to Devexpress

Calculator.CornerRadius Property

wpf-devexpress-dot-xpf-dot-editors-dot-calculator-04d15a60.md

latest6.1 KB
Original Source

Calculator.CornerRadius Property

Gets or sets the Calculator’s corner radius. This is a dependency property.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public CornerRadius CornerRadius { get; set; }
vb
Public Property CornerRadius As CornerRadius

Property Value

TypeDescription
CornerRadius

The Calculator’s corner radius.

|

Remarks

The following code sample specifies the CornerRadius , DigitButtonStyle, OperationButtonStyle, and CEButtonStyle properties.

xaml
<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys">
    <StackPanel>
        <StackPanel.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/DevExpress.Xpf.Themes.Office2019Colorful.v20.2;component/Core/Core/Editors/Themes/Generic/Generic.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            <Style x:Key="digitStyle" TargetType="Button" BasedOn="{StaticResource {dxet:CalculatorThemeKey ResourceKey=ButtonDigitStyle, ThemeName=Office2019Colorful}}">
                <Setter Property="Background" Value="#FFFCFCFC" />
                <Setter Property="Padding" Value="5,15"/>
                <Setter Property="BorderBrush" Value="Transparent" />
                <Setter Property="FontSize" Value="12"/>
                <Setter Property="FontWeight" Value="Bold"/>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="#FFE1E1E1" />
                        <Setter Property="BorderBrush" Value="Transparent" />
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Background" Value="#FFCBCBCB" />
                        <Setter Property="BorderBrush" Value="Transparent" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="operationStyle" TargetType="Button" BasedOn="{StaticResource {dxet:CalculatorThemeKey ResourceKey=ButtonOperationStyle, ThemeName=Office2019Colorful}}">
                <Setter Property="Background" Value="#FFF7F7F7" />
                <Setter Property="Padding" Value="5,15"/>
                <Setter Property="BorderBrush" Value="Transparent" />
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="#FFE1E1E1" />
                        <Setter Property="BorderBrush" Value="Transparent" />
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Background" Value="#FFCBCBCB" />
                        <Setter Property="BorderBrush" Value="Transparent" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="ceStyle" TargetType="Button" BasedOn="{StaticResource {dxet:CalculatorThemeKey ResourceKey=ButtonCEStyle, ThemeName=Office2019Colorful}}">
                <Setter Property="Background" Value="#FFF7F7F7" />
                <Setter Property="Padding" Value="5,15"/>
                <Setter Property="BorderBrush" Value="Transparent" />
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="#FFE1E1E1" />
                        <Setter Property="BorderBrush" Value="Transparent" />
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Background" Value="#FFCBCBCB" />
                        <Setter Property="BorderBrush" Value="Transparent" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            </ResourceDictionary>
        </StackPanel.Resources>
        <dxe:Calculator Background="#FFF2F2F2"
                        CornerRadius="10"
                        DigitButtonStyle="{StaticResource digitStyle}"
                        OperationButtonStyle="{StaticResource operationStyle}"
                        CEButtonStyle="{StaticResource ceStyle}" />
    </StackPanel>
</Window>

Note

The property is supported in the following DevExpress themes:

Theme FamilyThemes
Windows 11Dark, Light
Windows 10Dark, Light
Office 2019Black, Colorful, Dark Gray, White, HighContrast
Visual Studio 2019Blue, Dark, Light
Office 2016 SEBlack, Colorful, Dark Gray, White
Visual Studio 2017Blue, Dark, Light

See Also

Calculator Class

Calculator Members

DevExpress.Xpf.Editors Namespace