Added volume control. Updated styling.

This commit is contained in:
2026-08-13 00:29:35 -04:00
parent 321db65154
commit c8ce4ca7f0
9 changed files with 118 additions and 4 deletions

View File

@@ -1,9 +1,44 @@
using System;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
using Harmonia.WinUI.Models;
namespace Harmonia.WinUI.Converters;
public sealed partial class VolumeStateToIconConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, string language)
{
if (value is not VolumeState volumeState)
return null;
if (Application.Current.Resources[$"Volume{volumeState}Icon2"] is not string pathData)
return null;
return XamlBindingHelper.ConvertValue(typeof(Geometry), pathData.Trim());
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
public sealed partial class VolumeStateToFillConverter : IValueConverter
{
public object? Convert(object value, Type targetType, object parameter, string language)
{
return value is VolumeState.Muted ? parameter : null;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
public sealed partial class VolumeStateConverter : IValueConverter
{
public VolumeStateConverter()