HandyOrg / HandyOrg/HandyControl

[Bug] hc:Window 初始化时点击最大化按钮会抛出 ElementNotEnabledException

Open
#1,757 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
7.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

在使用 HandyControl 的 hc:Window 作为主窗口时,窗口刚初始化时,点击最大化按钮会抛出 ElementNotEnabledException。
测试时还发现,即使设置 IsEnabled="False",最大化按钮依然可以点击(最小化和关闭按钮会被禁用),但主要问题是初始化阶段最大化按钮可点且会报错。

Steps to reproduce the bug
  1. 在 XAML 中使用 hc:Window 作为主窗口
  2. 启动程序,在窗口刚显示时点击最大化按钮
  3. (附带问题)如果设置 IsEnabled="False",最大化按钮依然可用,最小化和关闭按钮会被禁用。
Screenshots

https://github.com/user-attachments/assets/24aee6af-cc92-40d1-8920-372ed8cf5f57

Image

https://github.com/user-attachments/assets/17e8b5e5-a128-4511-a9d2-df0235bd79ab

https://github.com/user-attachments/assets/9791ceb5-b1a0-4836-ad00-4e19242337e8

Framework type

.Net 8.0

Additional context

PackageReference Include="HandyControls" Version="3.5.2"
Visual Studio 2026 insiders

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with an hc:Window main window in a .NET 8.0 WPF application, clicking maximize as the window appears and checking the IsEnabled="False" behavior. Trace the hc:Window initialization and title-bar button enabled-state handling; done means startup maximize no longer throws ElementNotEnabledException and disabling the window also disables maximize.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.