Skip to content

Commit

Permalink
remove unused stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Nov 3, 2024
1 parent 8d39f3e commit ed9acf7
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 235 deletions.
39 changes: 0 additions & 39 deletions src/IconPacks.Avalonia.Core/Converter/DataTypeValueConverter.cs

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/IconPacks.Avalonia.Core/Converter/MarkupConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object IValueConverter.Convert(object value, Type targetType, object parameter,
}
catch
{
return BindingNotification.UnsetValue;
return BindingOperations.DoNothing;
}
}

Expand All @@ -69,7 +69,7 @@ object IValueConverter.ConvertBack(object value, Type targetType, object paramet
}
catch
{
return BindingNotification.UnsetValue;
return BindingOperations.DoNothing;
}
}
}
Expand Down

This file was deleted.

39 changes: 0 additions & 39 deletions src/IconPacks.Avalonia.Core/Converter/NullToUnsetValueConverter.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ protected Transform GetTransformGroup(object iconKind)
var transformGroup = new TransformGroup();
transformGroup.Children.Add(this.GetScaleTransform(iconKind)); // scale
transformGroup.Children.Add(new ScaleTransform(
this.Flip == PackIconFlipOrientation.Horizontal || this.Flip == PackIconFlipOrientation.Both ? -1 : 1,
this.Flip == PackIconFlipOrientation.Vertical || this.Flip == PackIconFlipOrientation.Both ? -1 : 1
this.Flip is PackIconFlipOrientation.Horizontal or PackIconFlipOrientation.Both ? -1 : 1,
this.Flip is PackIconFlipOrientation.Vertical or PackIconFlipOrientation.Both ? -1 : 1
)); // flip
transformGroup.Children.Add(new RotateTransform(this.RotationAngle)); // rotate

Expand All @@ -60,7 +60,7 @@ protected virtual DrawingGroup GetDrawingGroup(object iconKind, IBrush foregroun
{
var geometryDrawing = new GeometryDrawing
{
Geometry = Geometry.Parse(path),
Geometry = StreamGeometry.Parse(path),
Brush = foregroundBrush
};

Expand Down Expand Up @@ -92,24 +92,15 @@ protected IImage CreateImageSource(object iconKind, IBrush foregroundBrush)
/// <inheritdoc />
protected override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is not Enum)
{
return BindingNotification.UnsetValue;
}

var imageSource = CreateImageSource(value, parameter as IBrush ?? this.Brush ?? Brushes.Black);
if (imageSource is null)
{
return BindingNotification.UnsetValue;
}

return imageSource;
return value is not Enum
? null
: CreateImageSource(value, parameter as IBrush ?? this.Brush ?? Brushes.Black);
}

/// <inheritdoc />
protected override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return BindingNotification.UnsetValue;
throw new NotSupportedException("Two way bindings are not supported with an image");
}
}
}
2 changes: 1 addition & 1 deletion src/IconPacks.Avalonia.Core/PackIconImageExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected virtual DrawingGroup GetDrawingGroup(object iconKind, IBrush foregroun
{
var geometryDrawing = new GeometryDrawing
{
Geometry = Geometry.Parse(path),
Geometry = StreamGeometry.Parse(path),
Brush = foregroundBrush
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected override DrawingGroup GetDrawingGroup(object iconKind, IBrush foregrou
{
var geometryDrawing = new GeometryDrawing
{
Geometry = Geometry.Parse(path)
Geometry = StreamGeometry.Parse(path)
};

// if (iconKind is PackIconFeatherIconsKind)
Expand Down
2 changes: 1 addition & 1 deletion src/IconPacks.Avalonia/PackIconImageExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected override DrawingGroup GetDrawingGroup(object iconKind, IBrush foregrou
{
var geometryDrawing = new GeometryDrawing
{
Geometry = Geometry.Parse(path)
Geometry = StreamGeometry.Parse(path)
};

// if (iconKind is PackIconFeatherIconsKind)
Expand Down

0 comments on commit ed9acf7

Please sign in to comment.