Comments (4)
Ok, I think I was finally able to repro this. The app theme defaults to Light mode, and I'm guessing you're both in dark mode for Windows? The FluentAvaloniaTheme is configured to pull the user theme from Windows, if requested (on by default), which is setting the app theme twice on startup and causing issues. If you go into App.axaml and set DefaultToUserTheme="False"
on the FluentAvaloniaTheme, that should stop this from happening, as a temporary fix while I work on an actual fix:
<sty:FluentAvaloniaTheme ControlsVersion="2" DefaultToUserTheme="False" />
from fluentavalonia.
That's definitely odd. I don't use Rider but I'll look into why this is happening. I can't imagine VS and Rider build the solution so differently that this would occur though.
from fluentavalonia.
I am unable to reproduce this, using VS, Rider, my local source, and pulling from Github, so I really don't know why this is happening. Have you tried re-pulling the source in case something went wrong for some reason. Otherwise, I really don't know.
from fluentavalonia.
Same here, in both vs2019 and vs2022
System.InvalidOperationException
HResult=0x80131509
Message=The Styles already has a owner.
Source=Avalonia.Styling
StackTrace:
at Avalonia.Styling.Styles.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost owner) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 230
at FluentAvalonia.Styling.FluentAvaloniaTheme.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost owner) in C:\Users\jeanr\Downloads\FluentAvalonia\FluentAvalonia\Styling\Core\FluentAvaloniaTheme.cs:line 220
at Avalonia.Styling.Styles.<OnCollectionChanged>g__Add|52_1(IList items) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 292
at Avalonia.Styling.Styles.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 318
at Avalonia.Collections.AvaloniaList`1.NotifyAdd(T item, Int32 index) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 683
at Avalonia.Collections.AvaloniaList`1.Add(T item) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 206
at Avalonia.Styling.Styles.Add(IStyle item) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 201
at FluentAvaloniaSamples.App.!XamlIlPopulate(IServiceProvider , App ) in C:\Users\jeanr\Downloads\FluentAvalonia\FluentAvaloniaSamples\App.axaml:line 25
at FluentAvaloniaSamples.App.!XamlIlPopulateTrampoline(App )
at FluentAvaloniaSamples.App.Initialize() in C:\Users\jeanr\Downloads\FluentAvalonia\FluentAvaloniaSamples\App.axaml.cs:line 13
at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 311
at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 180
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 148
at FluentAvaloniaSamples.Program.Main(String[] args) in C:\Users\jeanr\Downloads\FluentAvalonia\FluentAvaloniaSamples\Program.cs:line 12
Even in a new solution
HResult=0x80131509
Message=The Styles already has a owner.
Source=Avalonia.Styling
StackTrace:
at Avalonia.Styling.Styles.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost owner) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 230
at FluentAvalonia.Styling.FluentAvaloniaTheme.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost owner)
at Avalonia.Styling.Styles.<OnCollectionChanged>g__Add|52_1(IList items) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 292
at Avalonia.Styling.Styles.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 318
at Avalonia.Collections.AvaloniaList`1.NotifyAdd(T item, Int32 index) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 683
at Avalonia.Collections.AvaloniaList`1.Add(T item) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 206
at Avalonia.Styling.Styles.Add(IStyle item) in /_/src/Avalonia.Styling/Styling/Styles.cs:line 201
at AvaloniaApplication1.App.!XamlIlPopulate(IServiceProvider , App ) in C:\Users\jeanr\source\repos\AvaloniaApplication1\AvaloniaApplication1\App.axaml:line 9
at AvaloniaApplication1.App.!XamlIlPopulateTrampoline(App )
at AvaloniaApplication1.App.Initialize() in C:\Users\jeanr\source\repos\AvaloniaApplication1\AvaloniaApplication1\App.axaml.cs:line 11
at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 311
at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 180
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 148
at AvaloniaApplication1.Program.Main(String[] args) in C:\Users\jeanr\source\repos\AvaloniaApplication1\AvaloniaApplication1\Program.cs:line 13
from fluentavalonia.
Related Issues (20)
- NavigationView / ItemsRepeater Crash with FluentAvalonia 2.1.0-preview4 HOT 6
- 'Command bar' crashes on resizing the window after opening the overflow menu
- NumberBox crashes if there is a bindings to the ViewModel HOT 3
- StackOverflow exception in RangeSlider
- Support Bottom NavigationView HOT 4
- Exception when trying to remove selected item in NavigationView 2.1.0-preview5 HOT 1
- AppWindow WindowState disappears from taskbar HOT 1
- NullReferenceException when clicking FAIconElement/IconSource - Symbol Enum in FAControlsGallery
- Blank space appears when scrolling up in ListView with variable sized elements
- Transparent ToggleButton styles will not work
- GridView control implementation
- NavigationView selection indictor doesn't always show
- Window moves up the screen when resizing.
- NullReferenceException is thrown when using FACombBox with Flyout HOT 2
- ContentDialog buttons not showing HOT 1
- NullReferenceException when trying to remove selected item in NavigationView 2.1.0-preview6
- TextBox flyout commands and SelectableTextBox command buttons not working
- SettingsExpander is swallowing space key HOT 2
- Can I disable Escape key of ContentDialog?
- FluentAvolonia OpenFolderPicker cannot return to the previous directory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentavalonia.