Code Monkey home page Code Monkey logo

avalonia.thememanager's People

Contributors

wieslawsoltes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

avalonia.thememanager's Issues

Change icons based on theme

This may be more a framework feature than this library can offer but is there an easy way to change icons based on theme?

I most use dark grey icons by default and with a light theme they work ok, however on dark theme they are barely visible

image

What is the best approach to solve this? Bind all icons and do some behind code?

The Style already has a parent

//Open new window
public void button_Click(object sender, RoutedEventArgs e)
{
TestWindow testWindow = new TestWindow();
testWindow.Show();
}

public class TestWindow : Window
{
public TestWindow()
{
this.InitializeComponent();
this.AttachDevTools();
App.Selector?.EnableThemes(this); // Error The Style already has a parent.
}

    private void InitializeComponent()
    {
        AvaloniaXamlLoader.Load(this);
    }
}

samples/AvaloniaApp crashes on Windows 10 VS 2022

I cloned the project and opened in VS 2022 (V17.7.5) on Windows 10. I have .NET SDK 7.0.402 installed.
I set AvaloniaApp as my startup project and when I run, it crashes at:

System.ArgumentNullException
HResult=0x80004003
Message=Value cannot be null. (Parameter 'key')
Source=System.Private.CoreLib
StackTrace:
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary2.set_Item(TKey key, TValue value)
at Avalonia.Controls.ResourceDictionary.set_Item(Object key, Object value)
at AvaloniaApp.ColorPage.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) in C:\git\Avalonia.ThemeManager\samples\AvaloniaApp\ColorPage.axaml.cs:line 57
at Avalonia.AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)
at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty1 property, Optional1 oldValue, BindingValue1 newValue, BindingPriority priority, Boolean isEffectiveValue) at Avalonia.PropertyStore.EffectiveValue1.SetAndRaiseCore(ValueStore owner, StyledProperty1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue) at Avalonia.PropertyStore.EffectiveValue1.SetLocalValueAndRaise(ValueStore owner, StyledProperty1 property, T value) at Avalonia.PropertyStore.ValueStore.SetLocalValue[T](StyledProperty1 property, T value)
at Avalonia.PropertyStore.LocalValueBindingObserverBase1.<OnNext>g__Execute|15_0(LocalValueBindingObserverBase1 instance, BindingValue1 value) at Avalonia.PropertyStore.LocalValueBindingObserverBase1.OnNext(BindingValue1 value) at Avalonia.PropertyStore.LocalValueBindingObserver1.OnNext(Object value)
at Avalonia.Reactive.LightweightObservableBase1.PublishNext(T value) at Avalonia.Data.Core.BindingExpression.InnerListener.OnNext(Object value) at Avalonia.Reactive.LightweightObservableBase1.PublishNext(T value)
at Avalonia.Data.Core.ExpressionObserver.ValueChanged(Object value)
at Avalonia.Data.Core.ExpressionNode.ValueChanged(Object value, Boolean notify)
at Avalonia.Data.Core.ExpressionNode.ValueChanged(Object value)
at Avalonia.Data.Core.Plugins.PropertyAccessorBase.PublishValue(Object value)
at Avalonia.Data.Core.Plugins.InpcPropertyAccessorPlugin.Accessor.SendCurrentValue()

Fluent themes broken in AvaloniaApp

Using the latest master, switching to a Fluent theme when running AvaloniaApp results in an unhandled exception:

System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'

Inner Exception
KeyNotFoundException: Static resource 'SystemControlBackgroundAccentBrush' not found.

Adding these includes to App.axaml:

<StyleInclude Source="avares://Avalonia.Themes.Fluent/Accents/Base.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Accents/BaseLight.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Accents/BaseDark.xaml"/>
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Accents/AccentColors.xaml"/>

Fixes the error, but certain elements (the calendar, certain pieces of text, etc.) will always use whichever fluent style was included last, rather than using the selected one.

(Running on Win10, VS2022)

Impossible to change the theme

From Example 2, the item is not available. When compiling Core2D. Sampling doesn't work there either.
image
[Binding] Error in binding to "Avalonia.Controls.MenuItem"."Command": "Could not find CLR property 'ApplyTheme' on 'Avalonia.ThemeManager.Theme'" (Avalonia.Controls.MenuItem #39696553)
[Binding] Error in binding to "Avalonia.Controls.MenuItem"."Command": "Could not find CLR property 'ApplyTheme' on 'Avalonia.ThemeManager.Theme'" (Avalonia.Controls.MenuItem #63406242)
[Binding] Error in binding to "Avalonia.Controls.MenuItem"."Command": "Could not find CLR property 'ApplyTheme' on 'Avalonia.ThemeManager.Theme'" (Avalonia.Controls.MenuItem #511887)
[Binding] Error in binding to "Avalonia.Controls.MenuItem"."Command": "Could not find CLR property 'ApplyTheme' on 'Avalonia.ThemeManager.Theme'" (Avalonia.Controls.MenuItem #3048957)
If use {Binding ThemeSelected.ApplyTheme}
[Binding] Error in binding to "Avalonia.Controls.MenuItem"."Header": "Could not find CLR property 'Name' on 'Avalonia.ThemeManager.ThemeSelector'" (Avalonia.Controls.MenuItem #51198184)
[Binding] Error in binding to "Avalonia.Controls.MenuItem"."Command": "Could not find CLR property 'ThemeSelected' on 'Avalonia.ThemeManager.ThemeSelector'" (Avalonia.Controls.MenuItem #51198184)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.