committed by
GitHub
69 changed files with 569 additions and 281 deletions
@ -0,0 +1,31 @@ |
|||||
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
namespace Avalonia.Visuals.Media.Imaging |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Controls the performance and quality of bitmap scaling.
|
||||
|
/// </summary>
|
||||
|
public enum BitmapInterpolationMode |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Uses the default behavior of the underling render backend.
|
||||
|
/// </summary>
|
||||
|
Default, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// The best performance but worst image quality.
|
||||
|
/// </summary>
|
||||
|
LowQuality, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Good performance and decent image quality.
|
||||
|
/// </summary>
|
||||
|
MediumQuality, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Highest quality but worst performance.
|
||||
|
/// </summary>
|
||||
|
HighQuality |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
// Copyright (c) The Avalonia Project. All rights reserved.
|
||||
|
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
||||
|
|
||||
|
using Avalonia.Visuals.Media.Imaging; |
||||
|
|
||||
|
namespace Avalonia.Media |
||||
|
{ |
||||
|
public class RenderOptions |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Defines the <see cref="BitmapInterpolationMode"/> property.
|
||||
|
/// </summary>
|
||||
|
public static readonly StyledProperty<BitmapInterpolationMode> BitmapInterpolationModeProperty = |
||||
|
AvaloniaProperty.RegisterAttached<RenderOptions, AvaloniaObject, BitmapInterpolationMode>( |
||||
|
"BitmapInterpolationMode", |
||||
|
BitmapInterpolationMode.MediumQuality, |
||||
|
inherits: true); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets the value of the BitmapInterpolationMode attached property for a control.
|
||||
|
/// </summary>
|
||||
|
/// <param name="element">The control.</param>
|
||||
|
/// <returns>The control's left coordinate.</returns>
|
||||
|
public static BitmapInterpolationMode GetBitmapInterpolationMode(AvaloniaObject element) |
||||
|
{ |
||||
|
return element.GetValue(BitmapInterpolationModeProperty); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Sets the value of the BitmapInterpolationMode attached property for a control.
|
||||
|
/// </summary>
|
||||
|
/// <param name="element">The control.</param>
|
||||
|
/// <param name="value">The left value.</param>
|
||||
|
public static void SetBitmapInterpolationMode(AvaloniaObject element, BitmapInterpolationMode value) |
||||
|
{ |
||||
|
element.SetValue(BitmapInterpolationModeProperty, value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace Avalonia.Controls.UnitTests |
||||
|
{ |
||||
|
public class SliderTests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Default_Orientation_Should_Be_Horizontal() |
||||
|
{ |
||||
|
var slider = new Slider(); |
||||
|
Assert.Equal(Orientation.Horizontal, slider.Orientation); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public void Should_Set_Horizontal_Class() |
||||
|
{ |
||||
|
var slider = new Slider |
||||
|
{ |
||||
|
Orientation = Orientation.Horizontal |
||||
|
}; |
||||
|
|
||||
|
Assert.Contains(slider.Classes, ":horizontal".Equals); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public void Should_Set_Vertical_Class() |
||||
|
{ |
||||
|
var slider = new Slider |
||||
|
{ |
||||
|
Orientation = Orientation.Vertical |
||||
|
}; |
||||
|
|
||||
|
Assert.Contains(slider.Classes, ":vertical".Equals); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue