Difficulty when porting WPF control to Avalonia #5470
-
Hi! I'm currently rewriting this WPF HexEditor to Avalonia and I have some questions about the performance of different Avalonia functions and about my assumptions for replacing WPF functions with Avalonia ones. I am not very familiar with Avalonia so I may have made some mistakes. Here are the changes I came up with:
Here's what I don't know:
or
or
but the validation method in WPF is defined as
and it is crucial for the logic inside this method to have both
I know that I'm asking a lot of questions at once, but getting at least some help would be priceless. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
ActualWidth
corresponds toBounds.Width
.AddClassHandler
(in the static constructor) is the best way, because it only subscribes once for all control instances.Avalonia/src/Avalonia.Controls/MenuItem.cs
Line 162 in 6332dfc
AddClassHandler
orStringDataVisibilityProperty.Changed.Subscribe
) .