question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't load styles for AvaloniaEdit

See original GitHub issue

Just tried to use a TextEditor in Avalonia 11.0.0-preview6 and loading the styles for the TextEditor fails:

<PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.0-preview5" />
<PackageReference Include="AvaloniaEdit.TextMate.Grammars" Version="0.10.12" />
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.0.0-preview5" />        
type App() =
    inherit Application()

    override this.Initialize() =
        this.Styles.Add (FluentTheme())
        this.RequestedThemeVariant <- Styling.ThemeVariant.Dark

        this.Styles.Add(StyleInclude(baseUri = null, Source = Uri("avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml")))
Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml (baseUri: ), make sure to specify x:Class and include your XAML file as AvaloniaResource
   at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(IServiceProvider sp, Uri uri, Uri baseUri) in /_/src/Markup/Avalonia.Markup.Xaml/AvaloniaXamlLoader.cs:line 115
   at Avalonia.Markup.Xaml.Styling.StyleInclude.get_Loaded() in /_/src/Markup/Avalonia.Markup.Xaml/Styling/StyleInclude.cs:line 63
   at Avalonia.Markup.Xaml.Styling.StyleInclude.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost owner) in /_/src/Markup/Avalonia.Markup.Xaml/Styling/StyleInclude.cs:line 105
   at Avalonia.Styling.Styles.InternalAdd(IList items, IResourceHost owner) in /_/src/Avalonia.Base/Styling/Styles.cs:line 265
   at Avalonia.Styling.Styles.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Base/Styling/Styles.cs:line 301
   at Avalonia.Collections.AvaloniaList`1.NotifyAdd(T item, Int32 index) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 700
   at Avalonia.Collections.AvaloniaList`1.Add(T item) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 205
   at Avalonia.Styling.Styles.Add(IStyle item) in /_/src/Avalonia.Base/Styling/Styles.cs:line 165
   at Avalonia.FuncUI.AvaloniaExtensions.Styles.Load(Styles this, String source) in /Users/josuajaeger/sources/Avalonia.FuncUI/src/Avalonia.FuncUI/Helpers.fs:line 20
   at Examples.CounterApp.App.Initialize() in /Users/josuajaeger/sources/Avalonia.FuncUI/src/Avalonia.FuncUI.Docs/Program.fs:line 52
   at Avalonia.AppBuilder.Setup() in /_/src/Avalonia.Controls/AppBuilder.cs:line 263
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime) in /_/src/Avalonia.Controls/AppBuilder.cs:line 162
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 213
   at Examples.CounterApp.Program.main(String[] args) in /Users/josuajaeger/sources/Avalonia.FuncUI/src/Avalonia.FuncUI.Docs/Program.fs:line 65

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

0reactions
JaggerJocommented, Apr 3, 2023

ahaa, so I guess I can close this. @Numpsy thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

AvaloniaEdit won't show up · Issue #118
AvaloniaEdit won't show up in simple demo application. Am I missing something or is this a bug in AvaloniaEdit? My package references.
Read more >
Troubleshooting
Let's imagine a problem when one or all style setters are not applied to the control. Below we will list common possible reasons...
Read more >
Styles
Styles in Avalonia are used to share property settings between controls. The Avalonia styling system can be thought of as a mix of...
Read more >
Where to Load ContentControl Styles in Avalonia Class ...
The styles defined in the App.xaml are global, so all controls will be using them. However, it is possible to change them at...
Read more >
Any ideas why a css file will load but the styles will not apply?
The css files/classes for zoomist are not being applied. Initially I thought problem was do to my webserver (nginx) setup but it seems...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found