FontWeight for read-only DoubleEditBox not working

Editors for WPF Forum

Posted 4 years ago by Brad Salmon
Version: 19.1.0684
Platform: .NET 3.0 (Core)
Environment: Windows 10 (64-bit)
Avatar

I'm trying to set the FontWeight property on a control that has IsReadOnly="true" and it isn't working. It works for a TextBox, but not for DoubleEditBox, DateTimeEditBox, Int32EditBox, etc. See snippet below. This is a simplified example. In our real application we have Styles defined that contain a Trigger on the IsReadOnly property being true and then setting the Background and FontWeight properties the way we want. This worked as expected when we were on v2015, but no longer working after upgrading to v2019.

xmlns:editors="clr-namespace:ActiproSoftware.Windows.Controls.Editors;assembly=ActiproSoftware.Editors.Wpf"
xmlns:ribbon="clr-namespace:ActiproSoftware.Windows.Controls.Ribbon.Controls;assembly=ActiproSoftware.Ribbon.Wpf"
xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"
mc:Ignorable="d" Height="400" Width="400">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<editors:DoubleEditBox Grid.Row="0" IsReadOnly="True" FontWeight="SemiBold" Value="93029" Background="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonBackgroundNormalBrushKey}}"/>
<ribbon:TextBox Grid.Row="1" IsReadOnly="True" FontWeight="SemiBold" Text="93029" Background="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonBackgroundNormalBrushKey}}"/>

Comments (7)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Brad,

I did a quick test of pasting in this code into a sample app and I saw the font was bold:

<editors:DoubleEditBox IsReadOnly="True" FontWeight="Bold" Value="93029" />

What do you see when you do the same?


Actipro Software Support

Posted 4 years ago by Brad Salmon
Avatar

The number shows as a light grey. I did the following. The first edit box is what I originally had it the # shows light grey. The second edit box is a TextBox and it shows the value SemiBold as expected. The third is your example and it shows the same as the first - lightgrey.

<Window x:Class="UpgradeTesting.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:editors="clr-namespace:ActiproSoftware.Windows.Controls.Editors;assembly=ActiproSoftware.Editors.Wpf"
        xmlns:ribbon="clr-namespace:ActiproSoftware.Windows.Controls.Ribbon.Controls;assembly=ActiproSoftware.Ribbon.Wpf"
        xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"
        mc:Ignorable="d"
        Title="Actipro Upgrade Testing" Height="400" Width="400">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <editors:DoubleEditBox Grid.Row="0" IsReadOnly="True" FontWeight="SemiBold" Value="93029" 
                               Background="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonBackgroundNormalBrushKey}}"/>
        <ribbon:TextBox Grid.Row="1" IsReadOnly="True" FontWeight="SemiBold" Text="93029" 
                        Background="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonBackgroundNormalBrushKey}}"/>
        <editors:DoubleEditBox Grid.Row="2" IsReadOnly="True" FontWeight="Bold" Value="93029" />
    </Grid>
</Window>
Posted 4 years ago by Brad Salmon
Avatar

P.S. - looking at this closer, maybe I'm asking the wrong question. Maybe the FontWeight is working, but the "color" of the font isn't what I am expecting. I just know that on v2015 the only thing we did on IsReadOnly=true was set the FontWeight and Background; and then it looked just like how the ribbon:TextBox shows in my example.

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

There was a Style.Trigger on the embedded textbox that changed the foreground to a disabled color if the control was read-only.  We'll remove that since the normal TextBox style we have doesn't do the same.  This update will be in the next maintenance release.


Actipro Software Support

Posted 4 years ago by Brad Salmon
Avatar

Super.

Any idea when the next maintenance release will be available? I just want to be able to set expectations with my team and users :)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

We're very close to having it wrapped up, so should be soon.


Actipro Software Support

Posted 4 years ago by Brad Salmon
Avatar

Awesome, thanks!

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.