WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

SplitButton is drawed incorrectly when IsEnabled=false by default and then enabled back

Open Prochy opened this issue 1 year ago • 1 comments

Describe the bug

If I set IsEnabled=false by default for SplitButton, then I enabled it e.g. by binding, the control is rendered wrong until I hover over the control. After the hover over the control, it is drawn correctly. (See attached pictures)

There is workaround but ofc it's not ideal. The workaround is to have IsEnabled = enable at the start and switch false to on loaded event. Then it looks like it works fine.

Steps to reproduce the bug

I attached an app sample but short the steps are following:

  1. Create simple xaml with SplitButton control: <Button Click="Button_Click">Enable split button</Button> <SplitButton IsEnabled="{x:Bind Enabled, Mode=OneWay}"> <TextBlock Text="Test" /> </SplitButton>
  2. Create Enabled property that has "False" value
  3. Change the Enabled property to True when the item is rendered.

sample.zip

Expected behavior

The SplitButton should be rendered in the same way as it is when the SplitButton is enabled by default from the app start.

Screenshots

After start image After enabling the SplitButton image After hovering over the control and put mouse control out of the control rectangle image

NuGet package version

Windows App SDK 1.5.3: 1.5.240428000

Packaging type

Unpackaged

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022-preview

Additional context

No response

Prochy avatar May 14 '24 13:05 Prochy