dotnet / dotnet/wpf

Implicit button style size affects Calendar control

Open
#8,785 1 comment 0 reactions 0 assignees View on GitHub
Question
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

If at some level e an implicit button style is declared, and this style sets a minimum size for the button, this affects calendar control within that level (or lower level).

This is hard to diagnose as other items from the button style are not displayed in the calendar control (backgrounds, fonts, borders,...)
It is also odd that setting a Width to about 100px has no effect but setting a MinWidth for 100px increases the default calendar width by a factor 1.75

The issue seems to be related to the left right buttons for month selection

### Reproduction Steps

```












<Setter Property="MinWidth" Value="100"/>




```

### Expected behavior

Either ignore button style completely or incorporate it completely

### Actual behavior

Button style partly used.

### Regression?

_No response_

### Known Workarounds

Don't use implicit button style sizing at that level

### Impact

The impact is largely about finding the cause, once you have it workaround is relatively easy. But to me the cause was pretty unclear.

### Configuration

.net 8.0

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.