ghost1372 / HandyControls

Contains some simple and commonly used WPF controls based on HandyControl
https://ghost1372.github.io/
MIT License
1.07k stars 102 forks source link

Title: StepBar click events not updated after ItemsSource changesBug title #194

Closed VagyokC4 closed 11 months ago

VagyokC4 commented 1 year ago

Describe the bug

I've encountered an issue with the StepBar control where the click events do not update properly after changes in its ItemsSource property. When the ItemsSource property is updated, the display of the control is refreshed, but the click events are still wired up to the old locations of where the step bar items were. This causes inconsistencies between the displayed control and the click events.

Steps to reproduce the bug

  1. Create a new WPF application and add the HandyControls library.
  2. Add a StepBar control to the main window.
  3. Bind the ItemsSource property of the StepBar to an ObservableCollection in the ViewModel.
  4. Add a button to the main window that updates the ItemsSource by adding or removing StepBarItem objects in the ViewModel.

Expected behavior

When the ItemsSource property is updated, the StepBar should refresh its display to reflect the changes in the data, and the click events and progress bar should be updated to match the new locations of the step bar items.

Actual behavior: The StepBar refreshes its display when the ItemsSource is updated, but the click events remain tied to the old locations of where the step bar items were. This causes the new step bar click events to be misaligned with the displayed UI.

https://user-images.githubusercontent.com/253250/231290617-fd726748-ecfc-40d0-b6e4-d0248d38b513.mp4

Screenshots

No response

NuGet package version

HandyControls (Custom version) 3.4.4

IDE

Visual Studio 2022-preview

Framework type

.Net 7.0

Windows version

May 2021 Update (19043)

Additional context

Please let me know if there is a better way to handle this issue with a workaround or if you plan on addressing this problem in a future release. It would be greatly appreciated if this issue can be resolved, as it affects the usability of the StepBar control.

ghost1372 commented 11 months ago

report it in original repo