morning4coffe-dev / recurrents

Tired of losing track of your spending on many different services? With Recurrents, just input your subscriptions for an easy overview and stay in control with reminders, save money, and enjoy a stress-free experience. Take control of your expenses effortlessly!
https://www.microsoft.com/store/apps/9N5MJT8G06KC
MIT License
10 stars 1 forks source link

The UISettings.ColorValueChanged is not called on Windows 10 #94

Closed github-actions[bot] closed 8 months ago

github-actions[bot] commented 10 months ago

https://github\.com/CommunityToolkit/WindowsCommunityToolkit/issues/4412\#issuecomment\-1823919825

https://github.com/morning4coffe-dev/recurrents/blob/626b7ec813279329a91b81bd191f00a9a84df710/ProjectSBS/ProjectSBS/Business/ViewModels/StatsBannerViewModel.cs#L94


        for (int i = 0; i < 6; i++)
        {
            months[5 - i] = currentDate.AddMonths(-i).ToString("MMM", CultureInfo.CurrentCulture);
        }

        XAxes = [
            new Axis
            {
                ShowSeparatorLines = false,
                Labels = months,
                LabelsPaint = new SolidColorPaint(SKColors.White),
                TextSize = 14
            }];

        YAxes = [
            new Axis
            {
                ShowSeparatorLines = false,
                Labeler = value => value.ToString("C", CurrencyCache.CurrencyCultures[_settingsService.DefaultCurrency]),
                LabelsPaint = new SolidColorPaint(SKColors.LightGray),
                TextSize = 14
            }];
    }

    private void UISettings_ColorValuesChanged(UISettings sender, object args)
    {
        //TODO: The UISettings.ColorValueChanged is not called on Windows 10
        //https://github.com/CommunityToolkit/WindowsCommunityToolkit/issues/4412#issuecomment-1823919825

        var accentColor = (Color)Application.Current.Resources["SystemAccentColor"];
        var skColor = new SKColor(accentColor.R, accentColor.G, accentColor.B);

        ((LineSeries<double>)Series[0]).Stroke = new SolidColorPaint(skColor) { StrokeThickness = 6 };
        ((LineSeries<double>)Series[0]).GeometryStroke = new SolidColorPaint(skColor) { StrokeThickness = 0 };
        ((LineSeries<double>)Series[0]).GeometryFill = new SolidColorPaint(skColor) { StrokeThickness = 0 };

        ((Axis)XAxes[0]).LabelsPaint = new SolidColorPaint(SKColors.Pink);
        ((Axis)YAxes[0]).LabelsPaint = new SolidColorPaint(SKColors.LightBlue);
    }

    private void ItemService_OnItemsChanged(object? sender, IEnumerable<ItemViewModel> e)
github-actions[bot] commented 8 months ago

Closed in 1fd22a5eb6d1f067a722cc32e9ba848a03eecf86