We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github\.com/CommunityToolkit/WindowsCommunityToolkit/issues/4412\#issuecomment\-1823919825
{
new LineSeries<double>
Values = _values,
Fill = null
}
};
recurrents/ProjectSBS/ProjectSBS/Business/ViewModels/StatsBannerViewModel.cs
Line 93 in bf6d888
_itemService.OnItemsChanged += ItemService_OnItemsChanged; _itemService.OnItemsInitialized += ItemService_OnItemsChanged; UpdateVisual(_itemService.GetItems()); var accentColor = (Color)Application.Current.Resources["SystemAccentColor"]; var skColor = new SKColor(accentColor.R, accentColor.G, accentColor.B); ObservableCollection<ISeries> series = [ new LineSeries<decimal> { Values = _values, Fill = null, Stroke = new SolidColorPaint(skColor) { StrokeThickness = 6 }, GeometryStroke = new SolidColorPaint(skColor) { StrokeThickness = 0 }, GeometryFill = new SolidColorPaint(skColor) { StrokeThickness = 0 } } ]; Series = series; DateTime currentDate = DateTime.Now; var months = new string[6]; 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<decimal>)Series[0]).Stroke = new SolidColorPaint(skColor) { StrokeThickness = 6 }; ((LineSeries<decimal>)Series[0]).GeometryStroke = new SolidColorPaint(skColor) { StrokeThickness = 0 }; ((LineSeries<decimal>)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) { UpdateVisual(e); } private async void UpdateVisual(IEnumerable<ItemViewModel> items) { SetSum(items); _values.Clear(); for (int i = 0; i < 6; i++) { var date = DateTime.Now.AddMonths(-i); var days = DateTime.DaysInMonth(date.Year, date.Month); var tasks = items.Select(async item => item.IsArchived ? 0 : await _currencyCache.ConvertToDefaultCurrency ( item.Item?.Billing.BasePrice * item.GetPaymentsInPeriod(days, (DateTime.Now - date).Days) ?? 0, item?.Item?.Billing?.CurrencyId ?? "EUR", _settingsService.DefaultCurrency) ); var values = await Task.WhenAll(tasks); _values.Insert(0, values.Sum()); } } private async void SetSum(IEnumerable<ItemViewModel> e)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://github\.com/CommunityToolkit/WindowsCommunityToolkit/issues/4412\#issuecomment\-1823919825
{
new LineSeries<double>
{
Values = _values,
Fill = null
}
};
recurrents/ProjectSBS/ProjectSBS/Business/ViewModels/StatsBannerViewModel.cs
Line 93 in bf6d888
The text was updated successfully, but these errors were encountered: