kir-antipov / hotavalonia Goto Github PK
View Code? Open in Web Editor NEW๐ฅ Supercharge your Avalonia development experience with hot reload capabilities
License: MIT License
๐ฅ Supercharge your Avalonia development experience with hot reload capabilities
License: MIT License
Hi!
I was wondering if there is a plan to support more complex solutions with multiple projects containing controls?
cheers,
Stefan
Expected: Changes are reflected in view
Actual: No changes can be seen
I'm using Visual Studio 2022 - tried both .NET 7 and .NET 8
Unable to find suitable setter or adder for property Converter of type Avalonia.Markup.Xaml:Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension for argument Avalonia.Base:Avalonia.Data.IBinding, available setter parameter lists are:
Avalonia.Data.Converters.IValueConverter Line 91, position 92.
This happens when there is a custom converter for any field, for example, as described here: https://docs.avaloniaui.net/docs/guides/data-binding/how-to-create-a-custom-data-binding-converter
When an x:Name
is assigned to a root element (Window
or UserControl
), hot reloading doesn't work. I assume that some synchronization is happening and Avalonia doesn't like it when the Name
is set again.
Repro (with XAML comments): https://github.com/stevemonaco/HotAvaloniaNameRepro
There are some behavioral differences in Rider and VS and I tested in both. Namely, the Window Title (and bindings to the Title) can be hot reloaded in Rider, but not in VS. Child state modifications never seem to work when the root element is named in either IDE.
I've been able to break hot reloading in a (real) project I made in Rider simply by adding an x:Name
to the Window
. Conversely, I've been able to fix another (real) project maintained in VS simply by removing a Window
x:Name
.
HotAvalonia version: 1.1.0
Avalonia versions: 11.0.10 and 11.1.0-beta2
.NET 8
VS: 17.9.3
Rider: 2024.1
Avalonia source where exception is thrown
Stack Trace:
[HotReload]Failed to reload 'HotAvaloniaNameRepro.MainWindow' ('avares://HotAvaloniaNameRepro/MainWindow.axaml'): 'System.InvalidOperationException: Cannot set Name : styled element already styled.
at Builder_24391e343bd24033bf98f239fe7114c6_avares___HotAvaloniaNameRepro_MainWindow_axaml.__AvaloniaXamlIlPopulate(IServiceProvider, MainWindow)
at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadOrPopulate(Type created, Object rootInstance, IServiceProvider parentServiceProvider)
at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.<>c.<LoadGroupSreCore>b__16_2(ValueTuple`2 t)
at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadGroupSreCore(IReadOnlyCollection`1 documents, RuntimeXamlLoaderConfiguration configuration)
at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadSreCore(RuntimeXamlLoaderDocument document, RuntimeXamlLoaderConfiguration configuration)
at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.LoadSre(RuntimeXamlLoaderDocument document, RuntimeXamlLoaderConfiguration configuration)
at Avalonia.Markup.Xaml.XamlIl.AvaloniaXamlIlRuntimeCompiler.Load(RuntimeXamlLoaderDocument document, RuntimeXamlLoaderConfiguration configuration)
at Avalonia.Markup.Xaml.AvaloniaRuntimeXamlLoader.Load(Stream stream, Assembly localAssembly, Object rootInstance, Uri uri, Boolean designMode)
at Avalonia.Markup.Xaml.AvaloniaRuntimeXamlLoader.Load(String xaml, Assembly localAssembly, Object rootInstance, Uri uri, Boolean designMode)
at HotAvalonia.Helpers.AvaloniaControlHelper.Load(String xaml, Uri uri, Object control, MethodInfo& compiledPopulateMethod) in /_/src/HotAvalonia/Helpers/AvaloniaControlHelper.cs:line 34
at HotAvalonia.AvaloniaControlManager.ReloadAsync(String xaml, CancellationToken cancellationToken) in /_/src/HotAvalonia/AvaloniaControlManager.cs:line 93
at HotAvalonia.AvaloniaControlManager.ReloadAsync(CancellationToken cancellationToken) in /_/src/HotAvalonia/AvaloniaControlManager.cs:line 76
at HotAvalonia.AvaloniaHotReloadContext.OnChanged(Object sender, FileSystemEventArgs args) in /_/src/HotAvalonia/AvaloniaHotReloadContext.cs:line 112'(AvaloniaHotReloadContext #35567111)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.