-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Avalonia v11 #141
base: master
Are you sure you want to change the base?
Upgrade Avalonia v11 #141
Conversation
…_) to `ItemsSource`
… some Roslyn style errors
…nPropertyChanged` deprecated virtual generic `..Changed<t>()` as per (AvaloniaUI/Avalonia#7980)
…ormSurface, SharpTreeView overrides and IndexOf(..)
Avalonia-v11-Update.md - please add that to the description of the PR but remove the file |
Please rebase on latest master - because then the build automation fixes I made will kick in. |
Wonderful, thanks for the heads up on both areas @christophwille. This upgrade isn't as smooth as I'd like it to be, but it was expected considering there are a lot of breaking changes moving to v11. I'm trying to keep tabs on the undocumented Avalonia v11 upgrade areas and making updates for their docs as well. |
Really appreciate you providing feedback to the Avalonia project! |
How are things going? How bad is it? |
Hi @christophwille, though it's not as straightforward as I'd like it to be, it is going well. The biggest part of the slow turnaround comes down to time prioritization during the summer months. It's the usual adult life items: open-source projects, fixing my house, working on a new startup, rewind-repeat. |
…rity)` to only pass, `ISegment`. Updated deprecated usage of `ForegroundBrush` property to `SetForegroundBrush()` method.
…g` to use override method, `OnPropertyChanged`. Reference: AvaloniaUI/Avalonia#10088
I didn't forget about this repo. Daytime job got very busy as we're aiming to deliver a lot in Q3. I aim to see this completed and will wrap this upgrade up as time allows. |
How does it look like on your end - got a little time to chip away at this? |
Thanks Chris for the tap on the shoulder, things got super busy at work over the past few months (got to love layoff/fire season). I'll get back on track for you sir with Christmas vacation time coming up soon |
Decided to try to get this to build and run, and surprisingly, I did get it to run in some capacity. I put up the changes on https://github.com/KubeRoot/AvaloniaILSpy/tree/UpgradeAvalonia11-WIP, but I didn't care much for code quality with this, so not sure how much of this is usable. EDIT: Small update, figured out the errors I've made with some things. Code is now rendering, the menu and toolbar are populated, font selection is working. |
@DamianSuess @KubeRoot @christophwille please let me know if you need any help with this upgrade. Although, I am wondering if it might be better to recreate this project from latest WPF-version sources. |
@maxkatz6 please coordinate the porting / adaptation work with @DamianSuess (I don't know about his plans or available time) |
NOTE: This upgrade is a work-in-progress
Feature Includes:
References
Avalonia Changes
AvaloniaProperty.Register<T>(..)
deprecatednotifying
argument.protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
ForegroundBrush { get; set; }
, Use method,SetForegroundBrush(...)
Pending Fixes
TextBlock
does not contain a definition forGetForeground
RunAsync
takes 3 argumentsContextMenuOpening
Application
does not contain a definition forClipboard
IObserver<string>
because it is not a delegate typeApplication
does not contain a definition forFocusManager
Avalonia.StyledElement
toAvalonia.Controls.Control
IWindowImpl
does not contain a definition forMouseDevice
IPointerDevice
does not contain a definition forGetPosition
FontManager
does not contain a definition forGetInstalledForntFamilyNames
FontManager
does not contain a definition forDefaultFontFamilyName
AvaloniaLocator
does not contain a definition forCurrent
AvaloniaLocator.Current.GetService<T>
...GetService<IPlatformRenderInterface>().CreateRenderTarget(...)
Bitmap
does not contain definition forPlatformImpl
(x3)ITopLevelImpl.Input
is inaccessable due to its protection levelRawKeyEventArgs
does not contain a definition forModifiers
- Ava v11 is now[PrivateApi]
andinternal
RawKeyEventArgs
does not contain a definition forKey
Application
does not contain a definition forClipboard
Application
does not contain a definition forClipboard
Register
does not have a parameter namednotifing
notifying
argument in v11.0-preview6.AvaloniaEdit.Document.ISegment
toint
TextView.Redraw(ISegment, DispatcherPriority)
TextView.Redraw(ISegment)
VisualLineElementTextRunProperties.ForegroundBrush
cannot be assigned - It's read only.element.TextRunProperties.SetForegroundBrush(foregroundBrush);
Application
does not contain a definition forClipboard
Notes
protected override ... CreateItemContainerGenerator()
private protected virtual ItemContainerGenerator CreateItemContainerGenerator()
IItemContainerGenerator
->ItemContainerGenerator
ItemContainerEventArgs
has been deprecatedoverride void OnContainerMaterialized()
has been replaced byinternal override void PrepareContainerForItemOverride(...)
MainWindow.HandleWindowStateChanged
has been deprecated in v11protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Stretch TO-DO
.xaml
to.axaml
Overview of Changes Made
IBitmap
->Bitmap
FocusManager
WbFb : IFramebufferPlatformSurface
now implementsCreateFramebufferRenderTarget()
- macOS rendering update + initial metal support AvaloniaUI/Avalonia#11914Focus Manager
OpenListDialog.xaml.cs
Clipboard