From d55edaa18a2791ff024491f25820022c1d1a8531 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 5 Dec 2017 10:16:35 +0100 Subject: [PATCH 01/92] Use readonly structs where possible. C# 7.2 introduced [readonly structs](https://docs.microsoft.com/en-us/dotnet/csharp/reference-semantics-with-value-types). Using this construct we can make sure that future modifications to these structs don't make them immutable and C# can generate more efficient code. --- src/Avalonia.Visuals/Avalonia.Visuals.csproj | 1 + src/Avalonia.Visuals/Matrix.cs | 2 +- src/Avalonia.Visuals/Media/Color.cs | 2 +- src/Avalonia.Visuals/Media/DrawingContext.cs | 4 ++-- .../Media/Immutable/ImmutableSolidColorBrush.cs | 2 +- src/Avalonia.Visuals/Point.cs | 2 +- src/Avalonia.Visuals/Rect.cs | 2 +- src/Avalonia.Visuals/RelativePoint.cs | 4 ++-- src/Avalonia.Visuals/RelativeRect.cs | 2 +- .../Rendering/SceneGraph/DeferredDrawingContextImpl.cs | 2 +- src/Avalonia.Visuals/Size.cs | 2 +- src/Avalonia.Visuals/Thickness.cs | 2 +- src/Avalonia.Visuals/Vector.cs | 2 +- src/Avalonia.Visuals/VisualTree/TransformedBounds.cs | 2 +- src/Shared/RenderHelpers/ArcToHelper.cs | 2 +- src/Skia/Avalonia.Skia/Avalonia.Skia.csproj | 3 ++- src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj | 1 + src/Windows/Avalonia.Direct2D1/OptionalDispose.cs | 2 +- 18 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/Avalonia.Visuals/Avalonia.Visuals.csproj b/src/Avalonia.Visuals/Avalonia.Visuals.csproj index fe18b0e4468..180466d7a83 100644 --- a/src/Avalonia.Visuals/Avalonia.Visuals.csproj +++ b/src/Avalonia.Visuals/Avalonia.Visuals.csproj @@ -3,6 +3,7 @@ netstandard2.0 false Avalonia + latest true diff --git a/src/Avalonia.Visuals/Matrix.cs b/src/Avalonia.Visuals/Matrix.cs index 10549b967de..3ed0287cd18 100644 --- a/src/Avalonia.Visuals/Matrix.cs +++ b/src/Avalonia.Visuals/Matrix.cs @@ -10,7 +10,7 @@ namespace Avalonia /// /// A 2x3 matrix. /// - public struct Matrix + public readonly struct Matrix { private readonly double _m11; private readonly double _m12; diff --git a/src/Avalonia.Visuals/Media/Color.cs b/src/Avalonia.Visuals/Media/Color.cs index cbf5a86fd61..d0a8fb17f84 100644 --- a/src/Avalonia.Visuals/Media/Color.cs +++ b/src/Avalonia.Visuals/Media/Color.cs @@ -11,7 +11,7 @@ namespace Avalonia.Media /// /// An ARGB color. /// - public struct Color + public readonly struct Color { /// /// Gets or sets the Alpha component of the color. diff --git a/src/Avalonia.Visuals/Media/DrawingContext.cs b/src/Avalonia.Visuals/Media/DrawingContext.cs index 1aa3fd21dea..1d25224b8d9 100644 --- a/src/Avalonia.Visuals/Media/DrawingContext.cs +++ b/src/Avalonia.Visuals/Media/DrawingContext.cs @@ -19,7 +19,7 @@ public sealed class DrawingContext : IDisposable ? new Stack() : TransformStackPool.Pop(); - struct TransformContainer + readonly struct TransformContainer { public readonly Matrix LocalTransform; public readonly Matrix ContainerTransform; @@ -147,7 +147,7 @@ public void FillRectangle(IBrush brush, Rect rect, float cornerRadius = 0.0f) } } - public struct PushedState : IDisposable + public readonly struct PushedState : IDisposable { private readonly int _level; private readonly DrawingContext _context; diff --git a/src/Avalonia.Visuals/Media/Immutable/ImmutableSolidColorBrush.cs b/src/Avalonia.Visuals/Media/Immutable/ImmutableSolidColorBrush.cs index 015486c6a4f..b55ca251a6c 100644 --- a/src/Avalonia.Visuals/Media/Immutable/ImmutableSolidColorBrush.cs +++ b/src/Avalonia.Visuals/Media/Immutable/ImmutableSolidColorBrush.cs @@ -6,7 +6,7 @@ namespace Avalonia.Media.Immutable /// /// Fills an area with a solid color. /// - public struct ImmutableSolidColorBrush : ISolidColorBrush + public readonly struct ImmutableSolidColorBrush : ISolidColorBrush { /// /// Initializes a new instance of the class. diff --git a/src/Avalonia.Visuals/Point.cs b/src/Avalonia.Visuals/Point.cs index 5fbd0829671..c1edd9eb427 100644 --- a/src/Avalonia.Visuals/Point.cs +++ b/src/Avalonia.Visuals/Point.cs @@ -10,7 +10,7 @@ namespace Avalonia /// /// Defines a point. /// - public struct Point + public readonly struct Point { /// /// The X position. diff --git a/src/Avalonia.Visuals/Rect.cs b/src/Avalonia.Visuals/Rect.cs index d562429fc7e..cdf1ee98f73 100644 --- a/src/Avalonia.Visuals/Rect.cs +++ b/src/Avalonia.Visuals/Rect.cs @@ -10,7 +10,7 @@ namespace Avalonia /// /// Defines a rectangle. /// - public struct Rect + public readonly struct Rect { /// /// An empty rectangle. diff --git a/src/Avalonia.Visuals/RelativePoint.cs b/src/Avalonia.Visuals/RelativePoint.cs index cc34feb5f3a..1b84f931663 100644 --- a/src/Avalonia.Visuals/RelativePoint.cs +++ b/src/Avalonia.Visuals/RelativePoint.cs @@ -27,7 +27,7 @@ public enum RelativeUnit /// /// Defines a point that may be defined relative to a containing element. /// - public struct RelativePoint : IEquatable + public readonly struct RelativePoint : IEquatable { /// /// A point at the top left of the containing element. @@ -44,7 +44,7 @@ public struct RelativePoint : IEquatable /// public static readonly RelativePoint BottomRight = new RelativePoint(1, 1, RelativeUnit.Relative); - private Point _point; + private readonly Point _point; private readonly RelativeUnit _unit; diff --git a/src/Avalonia.Visuals/RelativeRect.cs b/src/Avalonia.Visuals/RelativeRect.cs index a11f080e945..33a9fb8b156 100644 --- a/src/Avalonia.Visuals/RelativeRect.cs +++ b/src/Avalonia.Visuals/RelativeRect.cs @@ -10,7 +10,7 @@ namespace Avalonia /// /// Defines a rectangle that may be defined relative to a containing element. /// - public struct RelativeRect : IEquatable + public readonly struct RelativeRect : IEquatable { /// /// A rectangle that represents 100% of an area. diff --git a/src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs b/src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs index 29c482c336b..7af1420bbed 100644 --- a/src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs +++ b/src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs @@ -319,7 +319,7 @@ public void PushOpacityMask(IBrush mask, Rect bounds) } } - public struct UpdateState : IDisposable + public readonly struct UpdateState : IDisposable { public UpdateState( DeferredDrawingContextImpl owner, diff --git a/src/Avalonia.Visuals/Size.cs b/src/Avalonia.Visuals/Size.cs index 6ad87c6120a..5045f9a8372 100644 --- a/src/Avalonia.Visuals/Size.cs +++ b/src/Avalonia.Visuals/Size.cs @@ -10,7 +10,7 @@ namespace Avalonia /// /// Defines a size. /// - public struct Size + public readonly struct Size { /// /// A size representing infinity. diff --git a/src/Avalonia.Visuals/Thickness.cs b/src/Avalonia.Visuals/Thickness.cs index dc9be7341db..10d5f769158 100644 --- a/src/Avalonia.Visuals/Thickness.cs +++ b/src/Avalonia.Visuals/Thickness.cs @@ -10,7 +10,7 @@ namespace Avalonia /// /// Describes the thickness of a frame around a rectangle. /// - public struct Thickness + public readonly struct Thickness { /// /// The thickness on the left. diff --git a/src/Avalonia.Visuals/Vector.cs b/src/Avalonia.Visuals/Vector.cs index c4545b8e5c3..acde49a84aa 100644 --- a/src/Avalonia.Visuals/Vector.cs +++ b/src/Avalonia.Visuals/Vector.cs @@ -10,7 +10,7 @@ namespace Avalonia /// /// Defines a vector. /// - public struct Vector + public readonly struct Vector { /// /// The X vector. diff --git a/src/Avalonia.Visuals/VisualTree/TransformedBounds.cs b/src/Avalonia.Visuals/VisualTree/TransformedBounds.cs index 4c548669bd4..57233315000 100644 --- a/src/Avalonia.Visuals/VisualTree/TransformedBounds.cs +++ b/src/Avalonia.Visuals/VisualTree/TransformedBounds.cs @@ -8,7 +8,7 @@ namespace Avalonia.VisualTree /// /// Holds information about the bounds of a control, together with a transform and a clip. /// - public struct TransformedBounds + public readonly struct TransformedBounds { /// /// Initializes a new instance of the struct. diff --git a/src/Shared/RenderHelpers/ArcToHelper.cs b/src/Shared/RenderHelpers/ArcToHelper.cs index 9da47909cb1..2457606f9d1 100644 --- a/src/Shared/RenderHelpers/ArcToHelper.cs +++ b/src/Shared/RenderHelpers/ArcToHelper.cs @@ -982,7 +982,7 @@ static double GetAngle(Vector v1, Vector v2) /// At some point I did not trust the WPF Matrix struct, and wrote my own simple one -_- /// This is supposed to be replaced with proper WPF Matrices everywhere /// - private struct SimpleMatrix + private readonly struct SimpleMatrix { private readonly double _a, _b, _c, _d; diff --git a/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj b/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj index f5ed89d1545..cd27bda6074 100644 --- a/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj +++ b/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj @@ -5,7 +5,8 @@ Avalonia.Skia Avalonia.Skia true - true + latest + true diff --git a/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj b/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj index a84c3738867..9fac027fd05 100644 --- a/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj +++ b/src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj @@ -2,6 +2,7 @@ netstandard2.0 false + latest diff --git a/src/Windows/Avalonia.Direct2D1/OptionalDispose.cs b/src/Windows/Avalonia.Direct2D1/OptionalDispose.cs index cd3eee8d254..e302e711028 100644 --- a/src/Windows/Avalonia.Direct2D1/OptionalDispose.cs +++ b/src/Windows/Avalonia.Direct2D1/OptionalDispose.cs @@ -2,7 +2,7 @@ namespace Avalonia.Direct2D1 { - public struct OptionalDispose : IDisposable where T : IDisposable + public readonly struct OptionalDispose : IDisposable where T : IDisposable { private readonly bool _dispose; From 86f2d45d2b13b574cf2cad64cf8e5d39bfdab314 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 5 Dec 2017 12:35:28 +0100 Subject: [PATCH 02/92] Use current VS2017 image. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index ba3680d0b9d..76d1ae3e1cd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -os: Previous Visual Studio 2017 +os: Visual Studio 2017 platform: - Any CPU skip_branch_with_pr: true From da25b2f61f8497dd2dec235ed063714fb4181c1f Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Sun, 15 Apr 2018 18:52:34 +0200 Subject: [PATCH 03/92] LayoutHelper for controls with single content BorderRenderHelper refactoring --- src/Avalonia.Controls/Border.cs | 28 +--- src/Avalonia.Controls/Decorator.cs | 17 +- .../Presenters/ContentPresenter.cs | 118 +++++++------ .../Utils/BorderRenderHelper.cs | 156 ++++++++++-------- src/Avalonia.Layout/LayoutHelper.cs | 29 ++++ 5 files changed, 175 insertions(+), 173 deletions(-) diff --git a/src/Avalonia.Controls/Border.cs b/src/Avalonia.Controls/Border.cs index 8acb3603c9d..0382c8d6759 100644 --- a/src/Avalonia.Controls/Border.cs +++ b/src/Avalonia.Controls/Border.cs @@ -3,6 +3,7 @@ using Avalonia; using Avalonia.Controls.Utils; +using Avalonia.Layout; using Avalonia.Media; namespace Avalonia.Controls @@ -99,7 +100,7 @@ public override void Render(DrawingContext context) /// The desired size of the control. protected override Size MeasureOverride(Size availableSize) { - return MeasureOverrideImpl(availableSize, Child, Padding, BorderThickness); + return LayoutHelper.MeasureChild(Child, availableSize, Padding, BorderThickness); } /// @@ -109,32 +110,9 @@ protected override Size MeasureOverride(Size availableSize) /// The space taken. protected override Size ArrangeOverride(Size finalSize) { - if (Child != null) - { - var padding = Padding + BorderThickness; - Child.Arrange(new Rect(finalSize).Deflate(padding)); - } - _borderRenderHelper.Update(finalSize, BorderThickness, CornerRadius); - return finalSize; - } - - internal static Size MeasureOverrideImpl( - Size availableSize, - IControl child, - Thickness padding, - Thickness borderThickness) - { - padding += borderThickness; - - if (child != null) - { - child.Measure(availableSize.Deflate(padding)); - return child.DesiredSize.Inflate(padding); - } - - return new Size(padding.Left + padding.Right, padding.Bottom + padding.Top); + return LayoutHelper.ArrangeChild(Child, finalSize, Padding, BorderThickness); } } } \ No newline at end of file diff --git a/src/Avalonia.Controls/Decorator.cs b/src/Avalonia.Controls/Decorator.cs index 4040e4b8b71..389cf66d345 100644 --- a/src/Avalonia.Controls/Decorator.cs +++ b/src/Avalonia.Controls/Decorator.cs @@ -1,6 +1,7 @@ // 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.Layout; using Avalonia.Metadata; namespace Avalonia.Controls @@ -53,25 +54,13 @@ public Thickness Padding /// protected override Size MeasureOverride(Size availableSize) { - var content = Child; - var padding = Padding; - - if (content != null) - { - content.Measure(availableSize.Deflate(padding)); - return content.DesiredSize.Inflate(padding); - } - else - { - return new Size(padding.Left + padding.Right, padding.Bottom + padding.Top); - } + return LayoutHelper.MeasureChild(Child, availableSize, Padding); } /// protected override Size ArrangeOverride(Size finalSize) { - Child?.Arrange(new Rect(finalSize).Deflate(Padding)); - return finalSize; + return LayoutHelper.ArrangeChild(Child, finalSize, Padding); } /// diff --git a/src/Avalonia.Controls/Presenters/ContentPresenter.cs b/src/Avalonia.Controls/Presenters/ContentPresenter.cs index 3cc750e20dd..97c85b0c6cd 100644 --- a/src/Avalonia.Controls/Presenters/ContentPresenter.cs +++ b/src/Avalonia.Controls/Presenters/ContentPresenter.cs @@ -35,6 +35,13 @@ public class ContentPresenter : Control, IContentPresenter public static readonly StyledProperty BorderThicknessProperty = Border.BorderThicknessProperty.AddOwner(); + /// + /// Defines the property. + /// + public static readonly StyledProperty CornerRadiusProperty = + Border.CornerRadiusProperty.AddOwner(); + + /// /// Defines the property. /// @@ -55,12 +62,6 @@ public class ContentPresenter : Control, IContentPresenter public static readonly StyledProperty ContentTemplateProperty = ContentControl.ContentTemplateProperty.AddOwner(); - /// - /// Defines the property. - /// - public static readonly StyledProperty CornerRadiusProperty = - Border.CornerRadiusProperty.AddOwner(); - /// /// Defines the property. /// @@ -96,13 +97,6 @@ static ContentPresenter() TemplatedParentProperty.Changed.AddClassHandler(x => x.TemplatedParentChanged); } - /// - /// Initializes a new instance of the class. - /// - public ContentPresenter() - { - } - /// /// Gets or sets a brush with which to paint the background. /// @@ -130,6 +124,15 @@ public Thickness BorderThickness set { SetValue(BorderThicknessProperty, value); } } + /// + /// Gets or sets the radius of the border rounded corners. + /// + public CornerRadius CornerRadius + { + get { return GetValue(CornerRadiusProperty); } + set { SetValue(CornerRadiusProperty, value); } + } + /// /// Gets the control displayed by the presenter. /// @@ -159,16 +162,7 @@ public IDataTemplate ContentTemplate } /// - /// Gets or sets the radius of the border rounded corners. - /// - public CornerRadius CornerRadius - { - get { return GetValue(CornerRadiusProperty); } - set { SetValue(CornerRadiusProperty, value); } - } - - /// - /// Gets or sets the horizontal alignment of the content within the control. + /// Gets or sets the horizontal alignment of the content within the border the control. /// public HorizontalAlignment HorizontalContentAlignment { @@ -177,7 +171,7 @@ public HorizontalAlignment HorizontalContentAlignment } /// - /// Gets or sets the vertical alignment of the content within the control. + /// Gets or sets the vertical alignment of the content within the border of the control. /// public VerticalAlignment VerticalContentAlignment { @@ -186,7 +180,7 @@ public VerticalAlignment VerticalContentAlignment } /// - /// Gets or sets the padding to place around the control. + /// Gets or sets the space between the border and the control. /// public Thickness Padding { @@ -195,7 +189,7 @@ public Thickness Padding } /// - public override sealed void ApplyTemplate() + public sealed override void ApplyTemplate() { if (!_createdChild && ((ILogical)this).IsAttachedToLogicalTree) { @@ -328,67 +322,41 @@ protected virtual IControl CreateChild() /// protected override Size MeasureOverride(Size availableSize) { - return Border.MeasureOverrideImpl(availableSize, Child, Padding, BorderThickness); + return LayoutHelper.MeasureChild(Child, availableSize, Padding, BorderThickness); } /// protected override Size ArrangeOverride(Size finalSize) { - finalSize = ArrangeOverrideImpl(finalSize, new Vector()); - _borderRenderer.Update(finalSize, BorderThickness, CornerRadius); - return finalSize; - } - - /// - /// Called when the property changes. - /// - /// The event args. - private void ContentChanged(AvaloniaPropertyChangedEventArgs e) - { - _createdChild = false; - - if (((ILogical)this).IsAttachedToLogicalTree) - { - UpdateChild(); - } - else if (Child != null) - { - VisualChildren.Remove(Child); - LogicalChildren.Remove(Child); - Child = null; - _dataTemplate = null; - } - - InvalidateMeasure(); + return ArrangeOverrideImpl(finalSize, new Vector()); } internal Size ArrangeOverrideImpl(Size finalSize, Vector offset) { if (Child == null) return finalSize; - var padding = Padding; - var borderThickness = BorderThickness; + var padding = Padding + BorderThickness; var horizontalContentAlignment = HorizontalContentAlignment; var verticalContentAlignment = VerticalContentAlignment; var useLayoutRounding = UseLayoutRounding; var availableSizeMinusMargins = new Size( - Math.Max(0, finalSize.Width - padding.Left - padding.Right - borderThickness.Left - borderThickness.Right), - Math.Max(0, finalSize.Height - padding.Top - padding.Bottom - borderThickness.Top - borderThickness.Bottom)); + Math.Max(0, finalSize.Width), + Math.Max(0, finalSize.Height)); var size = availableSizeMinusMargins; var scale = GetLayoutScale(); - var originX = offset.X + padding.Left + borderThickness.Left; - var originY = offset.Y + padding.Top + borderThickness.Top; + var originX = offset.X; + var originY = offset.Y; if (horizontalContentAlignment != HorizontalAlignment.Stretch) { - size = size.WithWidth(Math.Min(size.Width, DesiredSize.Width - padding.Left - padding.Right)); + size = size.WithWidth(Math.Min(size.Width, DesiredSize.Width)); } if (verticalContentAlignment != VerticalAlignment.Stretch) { - size = size.WithHeight(Math.Min(size.Height, DesiredSize.Height - padding.Top - padding.Bottom)); + size = size.WithHeight(Math.Min(size.Height, DesiredSize.Height)); } if (useLayoutRounding) @@ -427,11 +395,37 @@ internal Size ArrangeOverrideImpl(Size finalSize, Vector offset) originY = Math.Floor(originY * scale) / scale; } - Child.Arrange(new Rect(originX, originY, Math.Max(0, size.Width), Math.Max(0, size.Height))); + var boundsForChild = + new Rect(originX, originY, Math.Max(0, size.Width), Math.Max(0, size.Height)).Deflate(padding); + + Child.Arrange(boundsForChild); return finalSize; } + /// + /// Called when the property changes. + /// + /// The event args. + private void ContentChanged(AvaloniaPropertyChangedEventArgs e) + { + _createdChild = false; + + if (((ILogical)this).IsAttachedToLogicalTree) + { + UpdateChild(); + } + else if (Child != null) + { + VisualChildren.Remove(Child); + LogicalChildren.Remove(Child); + Child = null; + _dataTemplate = null; + } + + InvalidateMeasure(); + } + private double GetLayoutScale() { var result = (VisualRoot as ILayoutRoot)?.LayoutScaling ?? 1.0; diff --git a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs index d9169e51f3b..e5b1b1961f0 100644 --- a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs +++ b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs @@ -26,7 +26,7 @@ public void Update(Size finalSize, Thickness borderThickness, CornerRadius corne var boundRect = new Rect(finalSize); var innerRect = boundRect.Deflate(borderThickness); - var innerCoordinates = new BorderCoordinates(cornerRadius, borderThickness, false); + var innerCoordinates = GeometryCoordinates.CreateBackgroundCoordinates(cornerRadius, borderThickness); StreamGeometry backgroundGeometry = null; @@ -48,7 +48,7 @@ public void Update(Size finalSize, Thickness borderThickness, CornerRadius corne if (boundRect.Width != 0 && innerRect.Height != 0) { - var outerCoordinates = new BorderCoordinates(cornerRadius, borderThickness, true); + var outerCoordinates = GeometryCoordinates.CreateBorderCoordinates(cornerRadius, borderThickness); var borderGeometry = new StreamGeometry(); using (var ctx = borderGeometry.Open()) @@ -104,42 +104,41 @@ public void Render(DrawingContext context, Size size, Thickness borders, CornerR } } - private static void CreateGeometry(StreamGeometryContext context, Rect boundRect, BorderCoordinates borderCoordinates) + private static void CreateGeometry(StreamGeometryContext context, Rect boundRect, GeometryCoordinates geometryCoordinates) { - var topLeft = new Point(borderCoordinates.LeftTop, 0); - var topRight = new Point(boundRect.Width - borderCoordinates.RightTop, 0); - var rightTop = new Point(boundRect.Width, borderCoordinates.TopRight); - var rightBottom = new Point(boundRect.Width, boundRect.Height - borderCoordinates.BottomRight); - var bottomRight = new Point(boundRect.Width - borderCoordinates.RightBottom, boundRect.Height); - var bottomLeft = new Point(borderCoordinates.LeftBottom, boundRect.Height); - var leftBottom = new Point(0, boundRect.Height - borderCoordinates.BottomLeft); - var leftTop = new Point(0, borderCoordinates.TopLeft); - + var topLeft = new Point(geometryCoordinates.LeftTop, 0); + var topRight = new Point(boundRect.Width - geometryCoordinates.RightTop, 0); + var rightTop = new Point(boundRect.Width, geometryCoordinates.TopRight); + var rightBottom = new Point(boundRect.Width, boundRect.Height - geometryCoordinates.BottomRight); + var bottomRight = new Point(boundRect.Width - geometryCoordinates.RightBottom, boundRect.Height); + var bottomLeft = new Point(geometryCoordinates.LeftBottom, boundRect.Height); + var leftBottom = new Point(0, boundRect.Height - geometryCoordinates.BottomLeft); + var leftTop = new Point(0, geometryCoordinates.TopLeft); if (topLeft.X > topRight.X) { - var scaledX = borderCoordinates.LeftTop / (borderCoordinates.LeftTop + borderCoordinates.RightTop) * boundRect.Width; + var scaledX = geometryCoordinates.LeftTop / (geometryCoordinates.LeftTop + geometryCoordinates.RightTop) * boundRect.Width; topLeft = new Point(scaledX, topLeft.Y); topRight = new Point(scaledX, topRight.Y); } if (rightTop.Y > rightBottom.Y) { - var scaledY = borderCoordinates.TopRight / (borderCoordinates.TopRight + borderCoordinates.BottomRight) * boundRect.Height; + var scaledY = geometryCoordinates.TopRight / (geometryCoordinates.TopRight + geometryCoordinates.BottomRight) * boundRect.Height; rightTop = new Point(rightTop.X, scaledY); rightBottom = new Point(rightBottom.X, scaledY); } if (bottomRight.X < bottomLeft.X) { - var scaledX = borderCoordinates.LeftBottom / (borderCoordinates.LeftBottom + borderCoordinates.RightBottom) * boundRect.Width; + var scaledX = geometryCoordinates.LeftBottom / (geometryCoordinates.LeftBottom + geometryCoordinates.RightBottom) * boundRect.Width; bottomRight = new Point(scaledX, bottomRight.Y); bottomLeft = new Point(scaledX, bottomLeft.Y); } if (leftBottom.Y < leftTop.Y) { - var scaledY = borderCoordinates.TopLeft / (borderCoordinates.TopLeft + borderCoordinates.BottomLeft) * boundRect.Height; + var scaledY = geometryCoordinates.TopLeft / (geometryCoordinates.TopLeft + geometryCoordinates.BottomLeft) * boundRect.Height; leftBottom = new Point(leftBottom.X, scaledY); leftTop = new Point(leftTop.X, scaledY); } @@ -204,75 +203,88 @@ private static void CreateGeometry(StreamGeometryContext context, Rect boundRect context.EndFigure(true); } - private struct BorderCoordinates + private struct GeometryCoordinates { - internal BorderCoordinates(CornerRadius cornerRadius, Thickness borderThickness, bool isOuter) + internal static GeometryCoordinates CreateBorderCoordinates(CornerRadius cornerRadius, Thickness borderThickness) { var left = 0.5 * borderThickness.Left; var top = 0.5 * borderThickness.Top; var right = 0.5 * borderThickness.Right; var bottom = 0.5 * borderThickness.Bottom; - if (isOuter) + var leftTop = 0.0; + var topLeft = 0.0; + if (cornerRadius.TopLeft != 0) { - if (cornerRadius.TopLeft == 0) - { - LeftTop = TopLeft = 0.0; - } - else - { - LeftTop = cornerRadius.TopLeft + left; - TopLeft = cornerRadius.TopLeft + top; - } - if (cornerRadius.TopRight == 0) - { - TopRight = RightTop = 0; - } - else - { - TopRight = cornerRadius.TopRight + top; - RightTop = cornerRadius.TopRight + right; - } - if (cornerRadius.BottomRight == 0) - { - RightBottom = BottomRight = 0; - } - else - { - RightBottom = cornerRadius.BottomRight + right; - BottomRight = cornerRadius.BottomRight + bottom; - } - if (cornerRadius.BottomLeft == 0) - { - BottomLeft = LeftBottom = 0; - } - else - { - BottomLeft = cornerRadius.BottomLeft + bottom; - LeftBottom = cornerRadius.BottomLeft + left; - } + leftTop = cornerRadius.TopLeft + left; + topLeft = cornerRadius.TopLeft + top; } - else + + var topRight = 0.0; + var rightTop = 0.0; + if (cornerRadius.TopRight != 0) { - LeftTop = Math.Max(0, cornerRadius.TopLeft - left); - TopLeft = Math.Max(0, cornerRadius.TopLeft - top); - TopRight = Math.Max(0, cornerRadius.TopRight - top); - RightTop = Math.Max(0, cornerRadius.TopRight - right); - RightBottom = Math.Max(0, cornerRadius.BottomRight - right); - BottomRight = Math.Max(0, cornerRadius.BottomRight - bottom); - BottomLeft = Math.Max(0, cornerRadius.BottomLeft - bottom); - LeftBottom = Math.Max(0, cornerRadius.BottomLeft - left); + topRight = cornerRadius.TopRight + top; + rightTop = cornerRadius.TopRight + right; } + + var rightBottom = 0.0; + var bottomRight = 0.0; + if (cornerRadius.BottomRight != 0) + { + rightBottom = cornerRadius.BottomRight + right; + bottomRight = cornerRadius.BottomRight + bottom; + } + + var bottomLeft = 0.0; + var leftBottom = 0.0; + if (cornerRadius.BottomLeft != 0) + { + bottomLeft = cornerRadius.BottomLeft + bottom; + leftBottom = cornerRadius.BottomLeft + left; + } + + return new GeometryCoordinates + { + LeftTop = leftTop, + TopLeft = topLeft, + TopRight = topRight, + RightTop = rightTop, + RightBottom = rightBottom, + BottomRight = bottomRight, + BottomLeft = bottomLeft, + LeftBottom = leftBottom, + }; + } + + internal static GeometryCoordinates CreateBackgroundCoordinates(CornerRadius cornerRadius, Thickness borderThickness) + { + var left = 0.5 * borderThickness.Left; + var top = 0.5 * borderThickness.Top; + var right = 0.5 * borderThickness.Right; + var bottom = 0.5 * borderThickness.Bottom; + + return new GeometryCoordinates + { + LeftTop = Math.Max(0, cornerRadius.TopLeft - left), + TopLeft = Math.Max(0, cornerRadius.TopLeft - top), + TopRight = Math.Max(0, cornerRadius.TopRight - top), + RightTop = Math.Max(0, cornerRadius.TopRight - right), + RightBottom = Math.Max(0, cornerRadius.BottomRight - right), + BottomRight = Math.Max(0, cornerRadius.BottomRight - bottom), + BottomLeft = Math.Max(0, cornerRadius.BottomLeft - bottom), + LeftBottom = Math.Max(0, cornerRadius.BottomLeft - left), + }; } - internal readonly double LeftTop; - internal readonly double TopLeft; - internal readonly double TopRight; - internal readonly double RightTop; - internal readonly double RightBottom; - internal readonly double BottomRight; - internal readonly double BottomLeft; - internal readonly double LeftBottom; + internal double LeftTop { get; private set; } + internal double TopLeft { get; private set; } + internal double TopRight { get; private set; } + internal double RightTop { get; private set; } + internal double RightBottom { get; private set; } + internal double BottomRight { get; private set; } + internal double BottomLeft { get; private set; } + internal double LeftBottom { get; private set; } } } diff --git a/src/Avalonia.Layout/LayoutHelper.cs b/src/Avalonia.Layout/LayoutHelper.cs index 8c0a6a579b6..d77cc269f9e 100644 --- a/src/Avalonia.Layout/LayoutHelper.cs +++ b/src/Avalonia.Layout/LayoutHelper.cs @@ -29,5 +29,34 @@ public static Size ApplyLayoutConstraints(ILayoutable control, Size constraints) height = Math.Max(height, control.MinHeight); return new Size(width, height); } + + public static Size MeasureChild(ILayoutable control, Size availableSize, Thickness padding, + Thickness borderThickness) + { + return MeasureChild(control, availableSize, padding + borderThickness); + } + + public static Size MeasureChild(ILayoutable control, Size availableSize, Thickness padding) + { + if (control != null) + { + control.Measure(availableSize.Deflate(padding)); + return control.DesiredSize.Inflate(padding); + } + + return new Size(padding.Left + padding.Right, padding.Bottom + padding.Top); + } + + public static Size ArrangeChild(ILayoutable child, Size availableSize, Thickness padding, Thickness borderThickness) + { + return ArrangeChild(child, availableSize, padding + borderThickness); + } + + public static Size ArrangeChild(ILayoutable child, Size availableSize, Thickness padding) + { + child?.Arrange(new Rect(availableSize).Deflate(padding)); + + return availableSize; + } } } From dbbf36e87276bd855b49d02760c6f77058826473 Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Mon, 16 Apr 2018 16:58:58 +0200 Subject: [PATCH 04/92] fix default templates --- .../Presenters/ContentPresenter.cs | 26 +++++++++---------- .../ButtonSpinner.xaml | 8 +++--- .../ContentControl.xaml | 5 +++- src/Avalonia.Themes.Default/ListBoxItem.xaml | 5 +++- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/Avalonia.Controls/Presenters/ContentPresenter.cs b/src/Avalonia.Controls/Presenters/ContentPresenter.cs index 97c85b0c6cd..106a63feb3c 100644 --- a/src/Avalonia.Controls/Presenters/ContentPresenter.cs +++ b/src/Avalonia.Controls/Presenters/ContentPresenter.cs @@ -341,29 +341,27 @@ internal Size ArrangeOverrideImpl(Size finalSize, Vector offset) var horizontalContentAlignment = HorizontalContentAlignment; var verticalContentAlignment = VerticalContentAlignment; var useLayoutRounding = UseLayoutRounding; - var availableSizeMinusMargins = new Size( - Math.Max(0, finalSize.Width), - Math.Max(0, finalSize.Height)); - var size = availableSizeMinusMargins; + var availableSizeMinusMargins = finalSize; + var sizeForChild = availableSizeMinusMargins; var scale = GetLayoutScale(); var originX = offset.X; var originY = offset.Y; if (horizontalContentAlignment != HorizontalAlignment.Stretch) { - size = size.WithWidth(Math.Min(size.Width, DesiredSize.Width)); + sizeForChild = sizeForChild.WithWidth(Math.Min(sizeForChild.Width, DesiredSize.Width)); } if (verticalContentAlignment != VerticalAlignment.Stretch) { - size = size.WithHeight(Math.Min(size.Height, DesiredSize.Height)); + sizeForChild = sizeForChild.WithHeight(Math.Min(sizeForChild.Height, DesiredSize.Height)); } if (useLayoutRounding) { - size = new Size( - Math.Ceiling(size.Width * scale) / scale, - Math.Ceiling(size.Height * scale) / scale); + sizeForChild = new Size( + Math.Ceiling(sizeForChild.Width * scale) / scale, + Math.Ceiling(sizeForChild.Height * scale) / scale); availableSizeMinusMargins = new Size( Math.Ceiling(availableSizeMinusMargins.Width * scale) / scale, Math.Ceiling(availableSizeMinusMargins.Height * scale) / scale); @@ -372,20 +370,20 @@ internal Size ArrangeOverrideImpl(Size finalSize, Vector offset) switch (horizontalContentAlignment) { case HorizontalAlignment.Center: - originX += (availableSizeMinusMargins.Width - size.Width) / 2; + originX += (availableSizeMinusMargins.Width - sizeForChild.Width) / 2; break; case HorizontalAlignment.Right: - originX += availableSizeMinusMargins.Width - size.Width; + originX += availableSizeMinusMargins.Width - sizeForChild.Width; break; } switch (verticalContentAlignment) { case VerticalAlignment.Center: - originY += (availableSizeMinusMargins.Height - size.Height) / 2; + originY += (availableSizeMinusMargins.Height - sizeForChild.Height) / 2; break; case VerticalAlignment.Bottom: - originY += availableSizeMinusMargins.Height - size.Height; + originY += availableSizeMinusMargins.Height - sizeForChild.Height; break; } @@ -396,7 +394,7 @@ internal Size ArrangeOverrideImpl(Size finalSize, Vector offset) } var boundsForChild = - new Rect(originX, originY, Math.Max(0, size.Width), Math.Max(0, size.Height)).Deflate(padding); + new Rect(originX, originY, sizeForChild.Width, sizeForChild.Height).Deflate(padding); Child.Arrange(boundsForChild); diff --git a/src/Avalonia.Themes.Default/ButtonSpinner.xaml b/src/Avalonia.Themes.Default/ButtonSpinner.xaml index a08f5b5e9b9..17a2c5525d1 100644 --- a/src/Avalonia.Themes.Default/ButtonSpinner.xaml +++ b/src/Avalonia.Themes.Default/ButtonSpinner.xaml @@ -46,12 +46,14 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Padding}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalAlignment}"> + Content="{TemplateBinding Content}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> diff --git a/src/Avalonia.Themes.Default/ContentControl.xaml b/src/Avalonia.Themes.Default/ContentControl.xaml index 7584ae0dfe8..f4cdd87ad06 100644 --- a/src/Avalonia.Themes.Default/ContentControl.xaml +++ b/src/Avalonia.Themes.Default/ContentControl.xaml @@ -7,7 +7,10 @@ BorderThickness="{TemplateBinding BorderThickness}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" - Padding="{TemplateBinding Padding}"/> + Padding="{TemplateBinding Padding}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"> + \ No newline at end of file diff --git a/src/Avalonia.Themes.Default/ListBoxItem.xaml b/src/Avalonia.Themes.Default/ListBoxItem.xaml index a0405f2875e..c591fa424f8 100644 --- a/src/Avalonia.Themes.Default/ListBoxItem.xaml +++ b/src/Avalonia.Themes.Default/ListBoxItem.xaml @@ -9,7 +9,10 @@ BorderThickness="{TemplateBinding BorderThickness}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" - Padding="{TemplateBinding Padding}"/> + Padding="{TemplateBinding Padding}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"> + From 969265fbed1e5e37324fda52df3a476ba0e78abe Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Mon, 16 Apr 2018 17:13:13 +0200 Subject: [PATCH 05/92] fix additional default templates --- .../ButtonSpinner.xaml | 12 ++++++--- .../ContentControl.xaml | 3 +-- src/Avalonia.Themes.Default/Expander.xaml | 25 ++++++++++++------- src/Avalonia.Themes.Default/ListBoxItem.xaml | 3 +-- src/Avalonia.Themes.Default/RepeatButton.xaml | 2 +- src/Avalonia.Themes.Default/TabStripItem.xaml | 2 ++ src/Avalonia.Themes.Default/TreeViewItem.xaml | 2 ++ src/Avalonia.Themes.Default/Window.xaml | 8 +++--- 8 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/Avalonia.Themes.Default/ButtonSpinner.xaml b/src/Avalonia.Themes.Default/ButtonSpinner.xaml index 17a2c5525d1..2558b7c2f8b 100644 --- a/src/Avalonia.Themes.Default/ButtonSpinner.xaml +++ b/src/Avalonia.Themes.Default/ButtonSpinner.xaml @@ -53,7 +53,8 @@ ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}"/> @@ -70,8 +71,8 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{TemplateBinding Padding}" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalAlignment}"> @@ -79,7 +80,10 @@ + Content="{TemplateBinding Content}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}"/> diff --git a/src/Avalonia.Themes.Default/ContentControl.xaml b/src/Avalonia.Themes.Default/ContentControl.xaml index f4cdd87ad06..d76eecee84f 100644 --- a/src/Avalonia.Themes.Default/ContentControl.xaml +++ b/src/Avalonia.Themes.Default/ContentControl.xaml @@ -9,8 +9,7 @@ Content="{TemplateBinding Content}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"> - + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> \ No newline at end of file diff --git a/src/Avalonia.Themes.Default/Expander.xaml b/src/Avalonia.Themes.Default/Expander.xaml index 5e05dcf6086..0bea0c9763b 100644 --- a/src/Avalonia.Themes.Default/Expander.xaml +++ b/src/Avalonia.Themes.Default/Expander.xaml @@ -18,8 +18,9 @@ IsVisible="{TemplateBinding IsExpanded}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" /> + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}" /> @@ -36,8 +37,9 @@ IsVisible="{TemplateBinding IsExpanded}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" /> + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}" /> @@ -54,8 +56,9 @@ IsVisible="{TemplateBinding IsExpanded}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" /> + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}" /> @@ -72,8 +75,9 @@ IsVisible="{TemplateBinding IsExpanded}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" /> + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}" /> @@ -94,7 +98,10 @@ Grid.Column="1" Background="Transparent" Content="{TemplateBinding Content}" - VerticalAlignment="Center" /> + VerticalAlignment="Center" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}"/> diff --git a/src/Avalonia.Themes.Default/ListBoxItem.xaml b/src/Avalonia.Themes.Default/ListBoxItem.xaml index c591fa424f8..fc2600c1a9f 100644 --- a/src/Avalonia.Themes.Default/ListBoxItem.xaml +++ b/src/Avalonia.Themes.Default/ListBoxItem.xaml @@ -11,8 +11,7 @@ Content="{TemplateBinding Content}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"> - + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> diff --git a/src/Avalonia.Themes.Default/RepeatButton.xaml b/src/Avalonia.Themes.Default/RepeatButton.xaml index 872f390ac5d..001c5c2f231 100644 --- a/src/Avalonia.Themes.Default/RepeatButton.xaml +++ b/src/Avalonia.Themes.Default/RepeatButton.xaml @@ -25,7 +25,7 @@ Padding="{TemplateBinding Padding}" TextBlock.Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> diff --git a/src/Avalonia.Themes.Default/TabStripItem.xaml b/src/Avalonia.Themes.Default/TabStripItem.xaml index 408cfaa3d7b..8aa03d5bd21 100644 --- a/src/Avalonia.Themes.Default/TabStripItem.xaml +++ b/src/Avalonia.Themes.Default/TabStripItem.xaml @@ -11,6 +11,8 @@ BorderThickness="{TemplateBinding BorderThickness}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}"/> diff --git a/src/Avalonia.Themes.Default/TreeViewItem.xaml b/src/Avalonia.Themes.Default/TreeViewItem.xaml index 5fb1dfb73d2..3a8fe344c5e 100644 --- a/src/Avalonia.Themes.Default/TreeViewItem.xaml +++ b/src/Avalonia.Themes.Default/TreeViewItem.xaml @@ -13,6 +13,8 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Content="{TemplateBinding Header}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" TemplatedControl.IsTemplateFocusTarget="True" Grid.Column="1"/> diff --git a/src/Avalonia.Themes.Default/Window.xaml b/src/Avalonia.Themes.Default/Window.xaml index d19bf41c4d9..f36e091e55e 100644 --- a/src/Avalonia.Themes.Default/Window.xaml +++ b/src/Avalonia.Themes.Default/Window.xaml @@ -6,10 +6,12 @@ - + Content="{TemplateBinding Content}" + Margin="{TemplateBinding Padding}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> From 5190a6c91579bbbe6699a92199446445fd809b11 Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Mon, 16 Apr 2018 17:23:59 +0200 Subject: [PATCH 06/92] fix missing measure call if the padding changes --- src/Avalonia.Controls/Presenters/ContentPresenter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Presenters/ContentPresenter.cs b/src/Avalonia.Controls/Presenters/ContentPresenter.cs index 106a63feb3c..e57928d59bd 100644 --- a/src/Avalonia.Controls/Presenters/ContentPresenter.cs +++ b/src/Avalonia.Controls/Presenters/ContentPresenter.cs @@ -91,7 +91,7 @@ public class ContentPresenter : Control, IContentPresenter static ContentPresenter() { AffectsRender(BackgroundProperty, BorderBrushProperty, BorderThicknessProperty, CornerRadiusProperty); - AffectsMeasure(BorderThicknessProperty); + AffectsMeasure(BorderThicknessProperty, PaddingProperty); ContentProperty.Changed.AddClassHandler(x => x.ContentChanged); ContentTemplateProperty.Changed.AddClassHandler(x => x.ContentChanged); TemplatedParentProperty.Changed.AddClassHandler(x => x.TemplatedParentChanged); From 87cc247100a1e47348adccd0e6200620803b0ecc Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Mon, 16 Apr 2018 18:45:42 +0200 Subject: [PATCH 07/92] fix tests --- .../ContentPresenterTests_Layout.cs | 2 +- .../Data/BindingExpressionTests.cs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/Avalonia.Controls.UnitTests/Presenters/ContentPresenterTests_Layout.cs b/tests/Avalonia.Controls.UnitTests/Presenters/ContentPresenterTests_Layout.cs index 2c1074aa9a1..98e57601a4e 100644 --- a/tests/Avalonia.Controls.UnitTests/Presenters/ContentPresenterTests_Layout.cs +++ b/tests/Avalonia.Controls.UnitTests/Presenters/ContentPresenterTests_Layout.cs @@ -233,7 +233,7 @@ public void Child_Arrange_With_Zero_Height_When_Padding_Height_Greater_Than_Chil target.Arrange(new Rect(0, 0, 100, 100)); - Assert.Equal(new Rect(48, 48, 0, 0), content.Bounds); + Assert.Equal(new Rect(32, 32, 0, 0), content.Bounds); } } } \ No newline at end of file diff --git a/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs b/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs index f5c0c6ec151..a6fb2fa7222 100644 --- a/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs +++ b/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs @@ -58,7 +58,7 @@ public void Should_Set_Indexed_Value() [Fact] public async Task Should_Convert_Get_String_To_Double() { - var data = new Class1 { StringValue = "5.6" }; + var data = new Class1 { StringValue = 5.6.ToString(CultureInfo.CurrentCulture) }; var target = new BindingExpression(new ExpressionObserver(data, "StringValue"), typeof(double)); var result = await target.Take(1); @@ -94,12 +94,12 @@ public async Task Should_Coerce_Get_Null_Double_String_To_UnsetValue() [Fact] public void Should_Convert_Set_String_To_Double() { - var data = new Class1 { StringValue = (5.6).ToString() }; + var data = new Class1 { StringValue = 5.6.ToString(CultureInfo.CurrentCulture) }; var target = new BindingExpression(new ExpressionObserver(data, "StringValue"), typeof(double)); target.OnNext(6.7); - Assert.Equal((6.7).ToString(), data.StringValue); + Assert.Equal(6.7.ToString(CultureInfo.CurrentCulture), data.StringValue); GC.KeepAlive(data); } @@ -111,7 +111,7 @@ public async Task Should_Convert_Get_Double_To_String() var target = new BindingExpression(new ExpressionObserver(data, "DoubleValue"), typeof(string)); var result = await target.Take(1); - Assert.Equal((5.6).ToString(), result); + Assert.Equal((5.6).ToString(CultureInfo.CurrentCulture), result); GC.KeepAlive(data); } @@ -122,7 +122,7 @@ public void Should_Convert_Set_Double_To_String() var data = new Class1 { DoubleValue = 5.6 }; var target = new BindingExpression(new ExpressionObserver(data, "DoubleValue"), typeof(string)); - target.OnNext("6.7"); + target.OnNext(6.7.ToString(CultureInfo.CurrentCulture)); Assert.Equal(6.7, data.DoubleValue); @@ -296,7 +296,7 @@ public void Should_Pass_ConverterParameter_To_ConvertBack() var data = new Class1 { DoubleValue = 5.6 }; var converter = new Mock(); var target = new BindingExpression( - new ExpressionObserver(data, "DoubleValue"), + new ExpressionObserver(data, "DoubleValue"), typeof(string), converter.Object, converterParameter: "foo"); @@ -318,15 +318,15 @@ public void Should_Handle_DataValidation() target.Subscribe(x => result.Add(x)); target.OnNext(1.2); - target.OnNext("3.4"); + target.OnNext(3.4.ToString(CultureInfo.CurrentCulture)); target.OnNext("bar"); Assert.Equal( new[] { - new BindingNotification("5.6"), - new BindingNotification("1.2"), - new BindingNotification("3.4"), + new BindingNotification(5.6.ToString(CultureInfo.CurrentCulture)), + new BindingNotification(1.2.ToString(CultureInfo.CurrentCulture)), + new BindingNotification(3.4.ToString(CultureInfo.CurrentCulture)), new BindingNotification( new InvalidCastException("'bar' is not a valid number."), BindingErrorType.Error) From 77bd8c89ca5dc34680f052ba40aaef4f0f04d415 Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Wed, 18 Apr 2018 16:51:07 +0200 Subject: [PATCH 08/92] Cleanup BorderRenderHelper Name fix in ContentPresenter --- .../Presenters/ContentPresenter.cs | 18 +- .../Utils/BorderRenderHelper.cs | 268 ++++++++---------- 2 files changed, 127 insertions(+), 159 deletions(-) diff --git a/src/Avalonia.Controls/Presenters/ContentPresenter.cs b/src/Avalonia.Controls/Presenters/ContentPresenter.cs index e57928d59bd..6badf913674 100644 --- a/src/Avalonia.Controls/Presenters/ContentPresenter.cs +++ b/src/Avalonia.Controls/Presenters/ContentPresenter.cs @@ -341,8 +341,8 @@ internal Size ArrangeOverrideImpl(Size finalSize, Vector offset) var horizontalContentAlignment = HorizontalContentAlignment; var verticalContentAlignment = VerticalContentAlignment; var useLayoutRounding = UseLayoutRounding; - var availableSizeMinusMargins = finalSize; - var sizeForChild = availableSizeMinusMargins; + var availableSize = finalSize; + var sizeForChild = availableSize; var scale = GetLayoutScale(); var originX = offset.X; var originY = offset.Y; @@ -362,28 +362,28 @@ internal Size ArrangeOverrideImpl(Size finalSize, Vector offset) sizeForChild = new Size( Math.Ceiling(sizeForChild.Width * scale) / scale, Math.Ceiling(sizeForChild.Height * scale) / scale); - availableSizeMinusMargins = new Size( - Math.Ceiling(availableSizeMinusMargins.Width * scale) / scale, - Math.Ceiling(availableSizeMinusMargins.Height * scale) / scale); + availableSize = new Size( + Math.Ceiling(availableSize.Width * scale) / scale, + Math.Ceiling(availableSize.Height * scale) / scale); } switch (horizontalContentAlignment) { case HorizontalAlignment.Center: - originX += (availableSizeMinusMargins.Width - sizeForChild.Width) / 2; + originX += (availableSize.Width - sizeForChild.Width) / 2; break; case HorizontalAlignment.Right: - originX += availableSizeMinusMargins.Width - sizeForChild.Width; + originX += availableSize.Width - sizeForChild.Width; break; } switch (verticalContentAlignment) { case VerticalAlignment.Center: - originY += (availableSizeMinusMargins.Height - sizeForChild.Height) / 2; + originY += (availableSize.Height - sizeForChild.Height) / 2; break; case VerticalAlignment.Bottom: - originY += availableSizeMinusMargins.Height - sizeForChild.Height; + originY += availableSize.Height - sizeForChild.Height; break; } diff --git a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs index e5b1b1961f0..0fd6593fbe5 100644 --- a/src/Avalonia.Controls/Utils/BorderRenderHelper.cs +++ b/src/Avalonia.Controls/Utils/BorderRenderHelper.cs @@ -26,17 +26,17 @@ public void Update(Size finalSize, Thickness borderThickness, CornerRadius corne var boundRect = new Rect(finalSize); var innerRect = boundRect.Deflate(borderThickness); - var innerCoordinates = GeometryCoordinates.CreateBackgroundCoordinates(cornerRadius, borderThickness); - + BorderGeometryKeypoints backgroundKeypoints = null; StreamGeometry backgroundGeometry = null; if (innerRect.Width != 0 && innerRect.Height != 0) { backgroundGeometry = new StreamGeometry(); + backgroundKeypoints = new BorderGeometryKeypoints(innerRect, borderThickness, cornerRadius, true); using (var ctx = backgroundGeometry.Open()) { - CreateGeometry(ctx, innerRect, innerCoordinates); + CreateGeometry(ctx, innerRect, backgroundKeypoints); } _backgroundGeometryCache = backgroundGeometry; @@ -48,16 +48,16 @@ public void Update(Size finalSize, Thickness borderThickness, CornerRadius corne if (boundRect.Width != 0 && innerRect.Height != 0) { - var outerCoordinates = GeometryCoordinates.CreateBorderCoordinates(cornerRadius, borderThickness); + var borderGeometryKeypoints = new BorderGeometryKeypoints(boundRect, borderThickness, cornerRadius, false); var borderGeometry = new StreamGeometry(); using (var ctx = borderGeometry.Open()) { - CreateGeometry(ctx, boundRect, outerCoordinates); + CreateGeometry(ctx, boundRect, borderGeometryKeypoints); if (backgroundGeometry != null) { - CreateGeometry(ctx, innerRect, innerCoordinates); + CreateGeometry(ctx, innerRect, backgroundKeypoints); } } @@ -104,188 +104,156 @@ public void Render(DrawingContext context, Size size, Thickness borders, CornerR } } - private static void CreateGeometry(StreamGeometryContext context, Rect boundRect, GeometryCoordinates geometryCoordinates) - { - var topLeft = new Point(geometryCoordinates.LeftTop, 0); - var topRight = new Point(boundRect.Width - geometryCoordinates.RightTop, 0); - var rightTop = new Point(boundRect.Width, geometryCoordinates.TopRight); - var rightBottom = new Point(boundRect.Width, boundRect.Height - geometryCoordinates.BottomRight); - var bottomRight = new Point(boundRect.Width - geometryCoordinates.RightBottom, boundRect.Height); - var bottomLeft = new Point(geometryCoordinates.LeftBottom, boundRect.Height); - var leftBottom = new Point(0, boundRect.Height - geometryCoordinates.BottomLeft); - var leftTop = new Point(0, geometryCoordinates.TopLeft); - - if (topLeft.X > topRight.X) + private class BorderGeometryKeypoints + { + internal BorderGeometryKeypoints(Rect boundRect, Thickness borderThickness, CornerRadius cornerRadius, bool inner) { - var scaledX = geometryCoordinates.LeftTop / (geometryCoordinates.LeftTop + geometryCoordinates.RightTop) * boundRect.Width; - topLeft = new Point(scaledX, topLeft.Y); - topRight = new Point(scaledX, topRight.Y); - } + var left = 0.5 * borderThickness.Left; + var top = 0.5 * borderThickness.Top; + var right = 0.5 * borderThickness.Right; + var bottom = 0.5 * borderThickness.Bottom; - if (rightTop.Y > rightBottom.Y) - { - var scaledY = geometryCoordinates.TopRight / (geometryCoordinates.TopRight + geometryCoordinates.BottomRight) * boundRect.Height; - rightTop = new Point(rightTop.X, scaledY); - rightBottom = new Point(rightBottom.X, scaledY); - } + double leftTopY; + double topLeftX; + double topRightX; + double rightTopY; + double rightBottomY; + double bottomRightX; + double bottomLeftX; + double leftBottomY; - if (bottomRight.X < bottomLeft.X) - { - var scaledX = geometryCoordinates.LeftBottom / (geometryCoordinates.LeftBottom + geometryCoordinates.RightBottom) * boundRect.Width; - bottomRight = new Point(scaledX, bottomRight.Y); - bottomLeft = new Point(scaledX, bottomLeft.Y); - } + if (inner) + { + leftTopY = Math.Max(0, cornerRadius.TopLeft - top) + boundRect.TopLeft.Y; + topLeftX = Math.Max(0, cornerRadius.TopLeft - left) + boundRect.TopLeft.X; + topRightX = boundRect.Width - Math.Max(0, cornerRadius.TopRight - top) + boundRect.TopLeft.X; + rightTopY = Math.Max(0, cornerRadius.TopRight - right) + boundRect.TopLeft.Y; + rightBottomY = boundRect.Height - Math.Max(0, cornerRadius.BottomRight - bottom) + boundRect.TopLeft.Y; + bottomRightX = boundRect.Width - Math.Max(0, cornerRadius.BottomRight - right) + boundRect.TopLeft.X; + bottomLeftX = Math.Max(0, cornerRadius.BottomLeft - left) + boundRect.TopLeft.X; + leftBottomY = boundRect.Height - Math.Max(0, cornerRadius.BottomLeft - bottom) + boundRect.TopLeft.Y; + } + else + { + + leftTopY = cornerRadius.TopLeft + top + boundRect.TopLeft.Y; + topLeftX = cornerRadius.TopLeft + left + boundRect.TopLeft.X; + topRightX = boundRect.Width - (cornerRadius.TopRight + right) + boundRect.TopLeft.X; + rightTopY = cornerRadius.TopRight + top + boundRect.TopLeft.Y; + rightBottomY = boundRect.Height - (cornerRadius.BottomRight + bottom) + boundRect.TopLeft.Y; + bottomRightX = boundRect.Width - (cornerRadius.BottomRight + right) + boundRect.TopLeft.X; + bottomLeftX = cornerRadius.BottomLeft + left + boundRect.TopLeft.X; + leftBottomY = boundRect.Height - (cornerRadius.BottomLeft + bottom) + boundRect.TopLeft.Y; + } + + var leftTopX = boundRect.TopLeft.X; + var topLeftY = boundRect.TopLeft.Y; + var topRightY = boundRect.TopLeft.Y; + var rightTopX = boundRect.Width + boundRect.TopLeft.X; + var rightBottomX = boundRect.Width + boundRect.TopLeft.X; + var bottomRightY = boundRect.Height + boundRect.TopLeft.Y; + var bottomLeftY = boundRect.Height + boundRect.TopLeft.Y; + var leftBottomX = boundRect.TopLeft.X; + + LeftTop = new Point(leftTopX, leftTopY); + TopLeft = new Point(topLeftX, topLeftY); + TopRight = new Point(topRightX, topRightY); + RightTop = new Point(rightTopX, rightTopY); + RightBottom = new Point(rightBottomX, rightBottomY); + BottomRight = new Point(bottomRightX, bottomRightY); + BottomLeft = new Point(bottomLeftX, bottomLeftY); + LeftBottom = new Point(leftBottomX, leftBottomY); + + //Fix overlap + if (TopLeft.X > TopRight.X) + { + var scaledX = topLeftX / (topLeftX + topRightX) * boundRect.Width; + TopLeft = new Point(scaledX, TopLeft.Y); + TopRight = new Point(scaledX, TopRight.Y); + } - if (leftBottom.Y < leftTop.Y) - { - var scaledY = geometryCoordinates.TopLeft / (geometryCoordinates.TopLeft + geometryCoordinates.BottomLeft) * boundRect.Height; - leftBottom = new Point(leftBottom.X, scaledY); - leftTop = new Point(leftTop.X, scaledY); + if (RightTop.Y > RightBottom.Y) + { + var scaledY = rightBottomY / (rightTopY + rightBottomY) * boundRect.Height; + RightTop = new Point(RightTop.X, scaledY); + RightBottom = new Point(RightBottom.X, scaledY); + } + + if (BottomRight.X < BottomLeft.X) + { + var scaledX = bottomLeftX / (bottomLeftX + bottomRightX) * boundRect.Width; + BottomRight = new Point(scaledX, BottomRight.Y); + BottomLeft = new Point(scaledX, BottomLeft.Y); + } + + if (LeftBottom.Y < LeftTop.Y) + { + var scaledY = leftTopY / (leftTopY + leftBottomY) * boundRect.Height; + LeftBottom = new Point(LeftBottom.X, scaledY); + LeftTop = new Point(LeftTop.X, scaledY); + } } - var offset = new Vector(boundRect.TopLeft.X, boundRect.TopLeft.Y); - topLeft += offset; - topRight += offset; - rightTop += offset; - rightBottom += offset; - bottomRight += offset; - bottomLeft += offset; - leftBottom += offset; - leftTop += offset; + internal Point LeftTop { get; private set; } + internal Point TopLeft { get; private set; } + internal Point TopRight { get; private set; } + internal Point RightTop { get; private set; } + internal Point RightBottom { get; private set; } + internal Point BottomRight { get; private set; } + internal Point BottomLeft { get; private set; } + internal Point LeftBottom { get; private set; } + } - context.BeginFigure(topLeft, true); + private static void CreateGeometry(StreamGeometryContext context, Rect boundRect, BorderGeometryKeypoints keypoints) + { + context.BeginFigure(keypoints.TopLeft, true); //Top - context.LineTo(topRight); + context.LineTo(keypoints.TopRight); //TopRight corner - var radiusX = boundRect.TopRight.X - topRight.X; - var radiusY = rightTop.Y - boundRect.TopRight.Y; + var radiusX = boundRect.TopRight.X - keypoints.TopRight.X; + var radiusY = keypoints.RightTop.Y - boundRect.TopRight.Y; if (radiusX != 0 || radiusY != 0) { - context.ArcTo(rightTop, new Size(radiusY, radiusY), 0, false, SweepDirection.Clockwise); + context.ArcTo(keypoints.RightTop, new Size(radiusY, radiusY), 0, false, SweepDirection.Clockwise); } //Right - context.LineTo(rightBottom); + context.LineTo(keypoints.RightBottom); //BottomRight corner - radiusX = boundRect.BottomRight.X - bottomRight.X; - radiusY = boundRect.BottomRight.Y - rightBottom.Y; + radiusX = boundRect.BottomRight.X - keypoints.BottomRight.X; + radiusY = boundRect.BottomRight.Y - keypoints.RightBottom.Y; if (radiusX != 0 || radiusY != 0) { - context.ArcTo(bottomRight, new Size(radiusX, radiusY), 0, false, SweepDirection.Clockwise); + context.ArcTo(keypoints.BottomRight, new Size(radiusX, radiusY), 0, false, SweepDirection.Clockwise); } //Bottom - context.LineTo(bottomLeft); + context.LineTo(keypoints.BottomLeft); //BottomLeft corner - radiusX = bottomLeft.X - boundRect.BottomLeft.X; - radiusY = boundRect.BottomLeft.Y - leftBottom.Y; + radiusX = keypoints.BottomLeft.X - boundRect.BottomLeft.X; + radiusY = boundRect.BottomLeft.Y - keypoints.LeftBottom.Y; if (radiusX != 0 || radiusY != 0) { - context.ArcTo(leftBottom, new Size(radiusX, radiusY), 0, false, SweepDirection.Clockwise); + context.ArcTo(keypoints.LeftBottom, new Size(radiusX, radiusY), 0, false, SweepDirection.Clockwise); } //Left - context.LineTo(leftTop); + context.LineTo(keypoints.LeftTop); //TopLeft corner - radiusX = topLeft.X - boundRect.TopLeft.X; - radiusY = leftTop.Y - boundRect.TopLeft.Y; + radiusX = keypoints.TopLeft.X - boundRect.TopLeft.X; + radiusY = keypoints.LeftTop.Y - boundRect.TopLeft.Y; if (radiusX != 0 || radiusY != 0) { - context.ArcTo(topLeft, new Size(radiusX, radiusY), 0, false, SweepDirection.Clockwise); + context.ArcTo(keypoints.TopLeft, new Size(radiusX, radiusY), 0, false, SweepDirection.Clockwise); } context.EndFigure(true); } - - private struct GeometryCoordinates - { - internal static GeometryCoordinates CreateBorderCoordinates(CornerRadius cornerRadius, Thickness borderThickness) - { - var left = 0.5 * borderThickness.Left; - var top = 0.5 * borderThickness.Top; - var right = 0.5 * borderThickness.Right; - var bottom = 0.5 * borderThickness.Bottom; - - var leftTop = 0.0; - var topLeft = 0.0; - if (cornerRadius.TopLeft != 0) - { - leftTop = cornerRadius.TopLeft + left; - topLeft = cornerRadius.TopLeft + top; - } - - var topRight = 0.0; - var rightTop = 0.0; - if (cornerRadius.TopRight != 0) - { - topRight = cornerRadius.TopRight + top; - rightTop = cornerRadius.TopRight + right; - } - - var rightBottom = 0.0; - var bottomRight = 0.0; - if (cornerRadius.BottomRight != 0) - { - rightBottom = cornerRadius.BottomRight + right; - bottomRight = cornerRadius.BottomRight + bottom; - } - - var bottomLeft = 0.0; - var leftBottom = 0.0; - if (cornerRadius.BottomLeft != 0) - { - bottomLeft = cornerRadius.BottomLeft + bottom; - leftBottom = cornerRadius.BottomLeft + left; - } - - return new GeometryCoordinates - { - LeftTop = leftTop, - TopLeft = topLeft, - TopRight = topRight, - RightTop = rightTop, - RightBottom = rightBottom, - BottomRight = bottomRight, - BottomLeft = bottomLeft, - LeftBottom = leftBottom, - }; - } - - internal static GeometryCoordinates CreateBackgroundCoordinates(CornerRadius cornerRadius, Thickness borderThickness) - { - var left = 0.5 * borderThickness.Left; - var top = 0.5 * borderThickness.Top; - var right = 0.5 * borderThickness.Right; - var bottom = 0.5 * borderThickness.Bottom; - - return new GeometryCoordinates - { - LeftTop = Math.Max(0, cornerRadius.TopLeft - left), - TopLeft = Math.Max(0, cornerRadius.TopLeft - top), - TopRight = Math.Max(0, cornerRadius.TopRight - top), - RightTop = Math.Max(0, cornerRadius.TopRight - right), - RightBottom = Math.Max(0, cornerRadius.BottomRight - right), - BottomRight = Math.Max(0, cornerRadius.BottomRight - bottom), - BottomLeft = Math.Max(0, cornerRadius.BottomLeft - bottom), - LeftBottom = Math.Max(0, cornerRadius.BottomLeft - left), - }; - } - - internal double LeftTop { get; private set; } - internal double TopLeft { get; private set; } - internal double TopRight { get; private set; } - internal double RightTop { get; private set; } - internal double RightBottom { get; private set; } - internal double BottomRight { get; private set; } - internal double BottomLeft { get; private set; } - internal double LeftBottom { get; private set; } - } - } } From eafb8cde9e5c6dd6d9e65bb7b7abe94e615e9f9b Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Thu, 26 Apr 2018 18:17:50 +0200 Subject: [PATCH 09/92] revert BindingExpressionTests --- .../Data/BindingExpressionTests.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs b/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs index a6fb2fa7222..6eeaa029de2 100644 --- a/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs +++ b/tests/Avalonia.Markup.UnitTests/Data/BindingExpressionTests.cs @@ -58,7 +58,7 @@ public void Should_Set_Indexed_Value() [Fact] public async Task Should_Convert_Get_String_To_Double() { - var data = new Class1 { StringValue = 5.6.ToString(CultureInfo.CurrentCulture) }; + var data = new Class1 { StringValue = "5.6" }; var target = new BindingExpression(new ExpressionObserver(data, "StringValue"), typeof(double)); var result = await target.Take(1); @@ -94,12 +94,12 @@ public async Task Should_Coerce_Get_Null_Double_String_To_UnsetValue() [Fact] public void Should_Convert_Set_String_To_Double() { - var data = new Class1 { StringValue = 5.6.ToString(CultureInfo.CurrentCulture) }; + var data = new Class1 { StringValue = (5.6).ToString() }; var target = new BindingExpression(new ExpressionObserver(data, "StringValue"), typeof(double)); target.OnNext(6.7); - Assert.Equal(6.7.ToString(CultureInfo.CurrentCulture), data.StringValue); + Assert.Equal((6.7).ToString(), data.StringValue); GC.KeepAlive(data); } @@ -111,7 +111,7 @@ public async Task Should_Convert_Get_Double_To_String() var target = new BindingExpression(new ExpressionObserver(data, "DoubleValue"), typeof(string)); var result = await target.Take(1); - Assert.Equal((5.6).ToString(CultureInfo.CurrentCulture), result); + Assert.Equal((5.6).ToString(), result); GC.KeepAlive(data); } @@ -122,7 +122,7 @@ public void Should_Convert_Set_Double_To_String() var data = new Class1 { DoubleValue = 5.6 }; var target = new BindingExpression(new ExpressionObserver(data, "DoubleValue"), typeof(string)); - target.OnNext(6.7.ToString(CultureInfo.CurrentCulture)); + target.OnNext("6.7"); Assert.Equal(6.7, data.DoubleValue); @@ -318,15 +318,15 @@ public void Should_Handle_DataValidation() target.Subscribe(x => result.Add(x)); target.OnNext(1.2); - target.OnNext(3.4.ToString(CultureInfo.CurrentCulture)); + target.OnNext("3.4"); target.OnNext("bar"); Assert.Equal( new[] { - new BindingNotification(5.6.ToString(CultureInfo.CurrentCulture)), - new BindingNotification(1.2.ToString(CultureInfo.CurrentCulture)), - new BindingNotification(3.4.ToString(CultureInfo.CurrentCulture)), + new BindingNotification("5.6"), + new BindingNotification("1.2"), + new BindingNotification("3.4"), new BindingNotification( new InvalidCastException("'bar' is not a valid number."), BindingErrorType.Error) From 247365714878d8b880889447065b94bdf1613645 Mon Sep 17 00:00:00 2001 From: lindexi Date: Mon, 30 Apr 2018 21:41:24 +0800 Subject: [PATCH 10/92] Fix 1533 Avoid throwing exception in TryReadDouble --- src/Avalonia.Base/Utilities/StringTokenizer.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Base/Utilities/StringTokenizer.cs b/src/Avalonia.Base/Utilities/StringTokenizer.cs index 2559e529320..f4e9eee9603 100644 --- a/src/Avalonia.Base/Utilities/StringTokenizer.cs +++ b/src/Avalonia.Base/Utilities/StringTokenizer.cs @@ -70,8 +70,15 @@ public int ReadInt32(char? separator = null) public bool TryReadDouble(out double result, char? separator = null) { var success = TryReadString(out var stringResult, separator); - result = success ? double.Parse(stringResult, _formatProvider) : 0; - return success; + + if (success) + { + success = double.TryParse(stringResult, NumberStyles.Float, _formatProvider, out result); + return success; + } + + result = default(double); + return false; } public double ReadDouble(char? separator = null) From 2bd00bff491a5c3e508a0288be9f089fab4ec76e Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 3 May 2018 22:07:41 +0100 Subject: [PATCH 11/92] Add a PasswordBox control. --- samples/ControlCatalog/Pages/TextBoxPage.xaml | 7 +- src/Avalonia.Controls/PasswordBox.cs | 47 ++++++++++++++ src/Avalonia.Themes.Default/PasswordBox.xaml | 64 +++++++++++++++++++ 3 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 src/Avalonia.Controls/PasswordBox.cs create mode 100644 src/Avalonia.Themes.Default/PasswordBox.xaml diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml index 7bfcad6d511..87fb1f0b4e2 100644 --- a/samples/ControlCatalog/Pages/TextBoxPage.xaml +++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml @@ -14,9 +14,14 @@ Watermark="Floating Watermark" UseFloatingWatermark="True" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."/> + + - + diff --git a/src/Avalonia.Controls/PasswordBox.cs b/src/Avalonia.Controls/PasswordBox.cs new file mode 100644 index 00000000000..a7dd03445a7 --- /dev/null +++ b/src/Avalonia.Controls/PasswordBox.cs @@ -0,0 +1,47 @@ +using Avalonia.Controls.Primitives; +using Avalonia.Styling; +using System; + +namespace Avalonia.Controls +{ + public class PasswordBox : TextBox, IStyleable + { + Type IStyleable.StyleKey => typeof(PasswordBox); + + public PasswordBox() + { + this.GetObservable(TextProperty).Subscribe(text => + { + if (text != null) + { + DisplayText = new string(PasswordChar, text.Length); + } + else + { + DisplayText = null; + } + }); + } + + public static readonly StyledProperty PasswordCharProperty = AvaloniaProperty.Register(nameof(PasswordChar), '*'); + + public char PasswordChar + { + get => GetValue(PasswordCharProperty); + set => SetValue(PasswordCharProperty, value); + } + + public static readonly StyledProperty DisplayTextProperty = AvaloniaProperty.Register(nameof(DisplayText)); + + public string DisplayText + { + get => GetValue(DisplayTextProperty); + set => SetValue(DisplayTextProperty, value); + } + + protected override void OnTemplateApplied(TemplateAppliedEventArgs e) + { + base.OnTemplateApplied(e); + } + } +} diff --git a/src/Avalonia.Themes.Default/PasswordBox.xaml b/src/Avalonia.Themes.Default/PasswordBox.xaml new file mode 100644 index 00000000000..4297a69bab0 --- /dev/null +++ b/src/Avalonia.Themes.Default/PasswordBox.xaml @@ -0,0 +1,64 @@ + + + + + + \ No newline at end of file From aca0fb3eba886449f0f381dcf94b0e0f99411c2e Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 3 May 2018 22:37:53 +0100 Subject: [PATCH 12/92] Implement password char on TextBox rather than separate control. --- samples/ControlCatalog/Pages/TextBoxPage.xaml | 3 +- src/Avalonia.Controls/PasswordBox.cs | 47 -------------- src/Avalonia.Controls/TextBox.cs | 40 ++++++++++-- src/Avalonia.Themes.Default/PasswordBox.xaml | 64 ------------------- src/Avalonia.Themes.Default/TextBox.xaml | 4 +- 5 files changed, 39 insertions(+), 119 deletions(-) delete mode 100644 src/Avalonia.Controls/PasswordBox.cs delete mode 100644 src/Avalonia.Themes.Default/PasswordBox.xaml diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml index 87fb1f0b4e2..96b534fc58b 100644 --- a/samples/ControlCatalog/Pages/TextBoxPage.xaml +++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml @@ -15,9 +15,10 @@ UseFloatingWatermark="True" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit."/> - diff --git a/src/Avalonia.Controls/PasswordBox.cs b/src/Avalonia.Controls/PasswordBox.cs deleted file mode 100644 index a7dd03445a7..00000000000 --- a/src/Avalonia.Controls/PasswordBox.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Avalonia.Controls.Primitives; -using Avalonia.Styling; -using System; - -namespace Avalonia.Controls -{ - public class PasswordBox : TextBox, IStyleable - { - Type IStyleable.StyleKey => typeof(PasswordBox); - - public PasswordBox() - { - this.GetObservable(TextProperty).Subscribe(text => - { - if (text != null) - { - DisplayText = new string(PasswordChar, text.Length); - } - else - { - DisplayText = null; - } - }); - } - - public static readonly StyledProperty PasswordCharProperty = AvaloniaProperty.Register(nameof(PasswordChar), '*'); - - public char PasswordChar - { - get => GetValue(PasswordCharProperty); - set => SetValue(PasswordCharProperty, value); - } - - public static readonly StyledProperty DisplayTextProperty = AvaloniaProperty.Register(nameof(DisplayText)); - - public string DisplayText - { - get => GetValue(DisplayTextProperty); - set => SetValue(DisplayTextProperty, value); - } - - protected override void OnTemplateApplied(TemplateAppliedEventArgs e) - { - base.OnTemplateApplied(e); - } - } -} diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index 890926db546..a0096ef7ae7 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -30,7 +30,10 @@ public class TextBox : TemplatedControl, UndoRedoHelper.I nameof(CaretIndex), o => o.CaretIndex, (o, v) => o.CaretIndex = v); - + + public static readonly StyledProperty PasswordCharProperty = + AvaloniaProperty.Register(nameof(PasswordChar)); + public static readonly StyledProperty IsReadOnlyProperty = AvaloniaProperty.Register(nameof(IsReadOnly)); @@ -53,6 +56,9 @@ public class TextBox : TemplatedControl, UndoRedoHelper.I defaultBindingMode: BindingMode.TwoWay, enableDataValidation: true); + public static readonly StyledProperty DisplayTextProperty = + AvaloniaProperty.Register(nameof(DisplayText)); + public static readonly StyledProperty TextAlignmentProperty = TextBlock.TextAlignmentProperty.AddOwner(); @@ -78,7 +84,7 @@ public UndoRedoState(string text, int caretPosition) public bool Equals(UndoRedoState other) => ReferenceEquals(Text, other.Text) || Equals(Text, other.Text); } - + private string _text; private int _caretIndex; private int _selectionStart; @@ -117,6 +123,18 @@ public TextBox() horizontalScrollBarVisibility, BindingPriority.Style); _undoRedoHelper = new UndoRedoHelper(this); + + this.GetObservable(TextProperty).Subscribe(text => + { + if (PasswordChar != default(char)) + { + DisplayText = new string(PasswordChar, text.Length); + } + else + { + DisplayText = Text; + } + }); } public bool AcceptsReturn @@ -147,7 +165,13 @@ public int CaretIndex _undoRedoHelper.UpdateLastState(); } } - + + public char PasswordChar + { + get => GetValue(PasswordCharProperty); + set => SetValue(PasswordCharProperty, value); + } + public bool IsReadOnly { get { return GetValue(IsReadOnlyProperty); } @@ -208,6 +232,12 @@ public string Text } } + public string DisplayText + { + get => GetValue(DisplayTextProperty); + set => SetValue(DisplayTextProperty, value); + } + public TextAlignment TextAlignment { get { return GetValue(TextAlignmentProperty); } @@ -832,9 +862,9 @@ private int GetLine(int caretIndex, IList lines) private void SetTextInternal(string value) { try - { + { _ignoreTextChanges = true; - SetAndRaise(TextProperty, ref _text, value); + SetAndRaise(TextProperty, ref _text, value); } finally { diff --git a/src/Avalonia.Themes.Default/PasswordBox.xaml b/src/Avalonia.Themes.Default/PasswordBox.xaml deleted file mode 100644 index 4297a69bab0..00000000000 --- a/src/Avalonia.Themes.Default/PasswordBox.xaml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/Avalonia.Themes.Default/TextBox.xaml b/src/Avalonia.Themes.Default/TextBox.xaml index e228aebf587..52e98b0c578 100644 --- a/src/Avalonia.Themes.Default/TextBox.xaml +++ b/src/Avalonia.Themes.Default/TextBox.xaml @@ -38,12 +38,12 @@ Text="{TemplateBinding Watermark}" IsVisible="{TemplateBinding Path=Text, Converter={x:Static StringConverters.NullOrEmpty}}"/> + TextWrapping="{TemplateBinding TextWrapping}"/> From a9747e0bd67ce574996feece816c3645faac5292 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 3 May 2018 22:40:22 +0100 Subject: [PATCH 13/92] whitespace. --- samples/ControlCatalog/Pages/TextBoxPage.xaml | 6 +++--- src/Avalonia.Controls/TextBox.cs | 14 +++++++------- src/Avalonia.Themes.Default/TextBox.xaml | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml index 96b534fc58b..db1c9cb69d9 100644 --- a/samples/ControlCatalog/Pages/TextBoxPage.xaml +++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml @@ -10,8 +10,8 @@ - @@ -22,7 +22,7 @@ Text="Password" /> - + diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index a0096ef7ae7..78ef532a260 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -32,7 +32,7 @@ public class TextBox : TemplatedControl, UndoRedoHelper.I (o, v) => o.CaretIndex = v); public static readonly StyledProperty PasswordCharProperty = - AvaloniaProperty.Register(nameof(PasswordChar)); + AvaloniaProperty.Register(nameof(PasswordChar)); public static readonly StyledProperty IsReadOnlyProperty = AvaloniaProperty.Register(nameof(IsReadOnly)); @@ -84,7 +84,7 @@ public UndoRedoState(string text, int caretPosition) public bool Equals(UndoRedoState other) => ReferenceEquals(Text, other.Text) || Equals(Text, other.Text); } - + private string _text; private int _caretIndex; private int _selectionStart; @@ -93,7 +93,7 @@ public UndoRedoState(string text, int caretPosition) private UndoRedoHelper _undoRedoHelper; private bool _isUndoingRedoing; private bool _ignoreTextChanges; - private static readonly string[] invalidCharacters = new String[1]{"\u007f"}; + private static readonly string[] invalidCharacters = new String[1] { "\u007f" }; static TextBox() { @@ -267,7 +267,7 @@ protected override void OnTemplateApplied(TemplateAppliedEventArgs e) _presenter = e.NameScope.Get("PART_TextPresenter"); _presenter.Cursor = new Cursor(StandardCursorType.Ibeam); - if(IsFocused) + if (IsFocused) { _presenter.ShowCaret(); } @@ -608,7 +608,7 @@ protected override void UpdateDataValidation(AvaloniaProperty property, BindingN DataValidationErrors.SetError(this, status.Error); } } - + private int CoerceCaretIndex(int value) => CoerceCaretIndex(value, Text?.Length ?? 0); private int CoerceCaretIndex(int value, int length) @@ -862,9 +862,9 @@ private int GetLine(int caretIndex, IList lines) private void SetTextInternal(string value) { try - { + { _ignoreTextChanges = true; - SetAndRaise(TextProperty, ref _text, value); + SetAndRaise(TextProperty, ref _text, value); } finally { diff --git a/src/Avalonia.Themes.Default/TextBox.xaml b/src/Avalonia.Themes.Default/TextBox.xaml index 52e98b0c578..89c445eac52 100644 --- a/src/Avalonia.Themes.Default/TextBox.xaml +++ b/src/Avalonia.Themes.Default/TextBox.xaml @@ -11,7 +11,7 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> - + - + + TextWrapping="{TemplateBinding TextWrapping}"/> From d1200e1e4727baa1232e05749d64252d14952bcf Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 3 May 2018 22:43:18 +0100 Subject: [PATCH 14/92] protect against copy and cut. --- src/Avalonia.Controls/TextBox.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index 78ef532a260..df68a017221 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -126,7 +126,7 @@ public TextBox() this.GetObservable(TextProperty).Subscribe(text => { - if (PasswordChar != default(char)) + if (IsPasswordBox) { DisplayText = new string(PasswordChar, text.Length); } @@ -345,7 +345,7 @@ public string RemoveInvalidCharacters(string text) private async void Copy() { await ((IClipboard)AvaloniaLocator.Current.GetService(typeof(IClipboard))) - .SetTextAsync(GetSelection()); + .SetTextAsync(GetSelection()); } private async void Paste() @@ -379,7 +379,10 @@ protected override void OnKeyDown(KeyEventArgs e) case Key.C: if (modifiers == InputModifiers.Control) { - Copy(); + if (!IsPasswordBox) + { + Copy(); + } handled = true; } break; @@ -387,8 +390,11 @@ protected override void OnKeyDown(KeyEventArgs e) case Key.X: if (modifiers == InputModifiers.Control) { - Copy(); - DeleteSelection(); + if (!IsPasswordBox) + { + Copy(); + DeleteSelection(); + } handled = true; } break; @@ -886,6 +892,8 @@ private void SetSelectionForControlDelete(InputModifiers modifiers) SelectionEnd = CaretIndex; } + private bool IsPasswordBox => PasswordChar != default(char); + UndoRedoState UndoRedoHelper.IUndoRedoHost.UndoRedoState { get { return new UndoRedoState(Text, CaretIndex); } From a4221ad809296d41c79d9d1f1832c9e2a12a763a Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 3 May 2018 22:45:22 +0100 Subject: [PATCH 15/92] whitespace. --- src/Avalonia.Controls/TextBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/TextBox.cs b/src/Avalonia.Controls/TextBox.cs index df68a017221..b09c380faa5 100644 --- a/src/Avalonia.Controls/TextBox.cs +++ b/src/Avalonia.Controls/TextBox.cs @@ -345,7 +345,7 @@ public string RemoveInvalidCharacters(string text) private async void Copy() { await ((IClipboard)AvaloniaLocator.Current.GetService(typeof(IClipboard))) - .SetTextAsync(GetSelection()); + .SetTextAsync(GetSelection()); } private async void Paste() From 7ae90eb7c502df24ce25932991420be757ef3b3b Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Fri, 4 May 2018 20:07:53 +0800 Subject: [PATCH 16/92] Cleanup all the csproj's that can be cleaned. Ported RenderTest and VirtualizationTest samples to .NET Core. --- build/Base.props | 2 +- samples/RenderTest/Properties/AssemblyInfo.cs | 36 ---- samples/RenderTest/RenderTest.csproj | 201 ++---------------- .../Properties/AssemblyInfo.cs | 36 ---- .../VirtualizationTest.csproj | 166 ++------------- .../Avalonia.Animation.csproj | 29 +-- .../Properties/AssemblyInfo.cs | 6 - .../{Properties => }/AssemblyInfo.cs | 1 - src/Avalonia.Base/Avalonia.Base.csproj | 30 +-- .../{Properties => }/AssemblyInfo.cs | 1 - .../Avalonia.Controls.csproj | 30 +-- .../Properties/AssemblyInfo.cs | 8 - .../Avalonia.Diagnostics.csproj | 37 +--- .../Properties/AssemblyInfo.cs | 6 - .../Avalonia.DotNetCoreRuntime.csproj | 6 +- .../Properties/AssemblyInfo.cs | 6 - .../Avalonia.DotNetFrameworkRuntime.csproj | 6 +- .../Avalonia.HtmlRenderer.csproj | 115 +--------- .../{Properties => }/AssemblyInfo.cs | 1 - src/Avalonia.Input/Avalonia.Input.csproj | 30 +-- .../Avalonia.Interactivity.csproj | 34 +-- .../Properties/AssemblyInfo.cs | 6 - src/Avalonia.Layout/Avalonia.Layout.csproj | 30 +-- .../Properties/AssemblyInfo.cs | 6 - .../Avalonia.Logging.Serilog.csproj | 26 +-- .../Properties/AssemblyInfo.cs | 3 - .../Avalonia.ReactiveUI.csproj | 4 +- .../Properties/AssemblyInfo.cs | 6 - .../{Properties => }/AssemblyInfo.cs | 1 - src/Avalonia.Styling/Avalonia.Styling.csproj | 30 +-- .../Avalonia.Themes.Default.csproj | 34 +-- .../Properties/AssemblyInfo.cs | 6 - .../{Properties => }/AssemblyInfo.cs | 1 - src/Avalonia.Visuals/Avalonia.Visuals.csproj | 29 +-- .../{Properties => }/AssemblyInfo.cs | 2 - src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj | 24 +-- .../Avalonia.LinuxFramebuffer.csproj | 1 + .../Avalonia.MonoMac/Avalonia.MonoMac.csproj | 2 +- src/Shared/CompileXaml.props | 11 + src/Shared/Shared.props | 11 + src/Skia/Avalonia.Skia/Avalonia.Skia.csproj | 10 +- 41 files changed, 105 insertions(+), 925 deletions(-) delete mode 100644 samples/RenderTest/Properties/AssemblyInfo.cs delete mode 100644 samples/VirtualizationTest/Properties/AssemblyInfo.cs delete mode 100644 src/Avalonia.Animation/Properties/AssemblyInfo.cs rename src/Avalonia.Base/{Properties => }/AssemblyInfo.cs (90%) rename src/Avalonia.Controls/{Properties => }/AssemblyInfo.cs (95%) delete mode 100644 src/Avalonia.DesignerSupport/Properties/AssemblyInfo.cs delete mode 100644 src/Avalonia.Diagnostics/Properties/AssemblyInfo.cs delete mode 100644 src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs rename src/Avalonia.Input/{Properties => }/AssemblyInfo.cs (87%) delete mode 100644 src/Avalonia.Interactivity/Properties/AssemblyInfo.cs delete mode 100644 src/Avalonia.Layout/Properties/AssemblyInfo.cs delete mode 100644 src/Avalonia.Logging.Serilog/Properties/AssemblyInfo.cs delete mode 100644 src/Avalonia.ReactiveUI/Properties/AssemblyInfo.cs rename src/Avalonia.Styling/{Properties => }/AssemblyInfo.cs (92%) delete mode 100644 src/Avalonia.Themes.Default/Properties/AssemblyInfo.cs rename src/Avalonia.Visuals/{Properties => }/AssemblyInfo.cs (93%) rename src/Gtk/Avalonia.Gtk3/{Properties => }/AssemblyInfo.cs (93%) create mode 100644 src/Shared/CompileXaml.props create mode 100644 src/Shared/Shared.props diff --git a/build/Base.props b/build/Base.props index 66894653388..78930156e76 100644 --- a/build/Base.props +++ b/build/Base.props @@ -2,4 +2,4 @@ - + \ No newline at end of file diff --git a/samples/RenderTest/Properties/AssemblyInfo.cs b/samples/RenderTest/Properties/AssemblyInfo.cs deleted file mode 100644 index f66c1580751..00000000000 --- a/samples/RenderTest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RenderTest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RenderTest")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f1fdc5b0-4654-416f-ae69-e3e9bbd87801")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/RenderTest/RenderTest.csproj b/samples/RenderTest/RenderTest.csproj index b33d5d3c704..4373e4715a1 100644 --- a/samples/RenderTest/RenderTest.csproj +++ b/samples/RenderTest/RenderTest.csproj @@ -1,184 +1,29 @@ - - - + - Debug - AnyCPU - {F1FDC5B0-4654-416F-AE69-E3E9BBD87801} - WinExe - Properties - RenderTest - RenderTest - v4.7 - 512 - true - + Exe + netcoreapp2.0 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - App.xaml - - - DrawingPage.xaml - - - ClippingPage.xaml - - - AnimationsPage.xaml - - - - - MainWindow.xaml - - - - - - - - - Designer - - - - {d211e587-d8bc-45b9-95a4-f297c8fa5200} - Avalonia.Animation - - - {b09b78d8-9b26-48b0-9149-d64a2f120f3f} - Avalonia.Base - - - {d2221c82-4a25-4583-9b43-d791e3f6820c} - Avalonia.Controls - - - {799a7bb5-3c2c-48b6-85a7-406a12c420da} - Avalonia.DesignerSupport - - - {7062ae20-5dcc-4442-9645-8195bdece63e} - Avalonia.Diagnostics - - - {4a1abb09-9047-4bd5-a4ad-a055e52c5ee0} - Avalonia.DotNetFrameworkRuntime - - - {62024b2d-53eb-4638-b26b-85eeaa54866e} - Avalonia.Input - - - {6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b} - Avalonia.Interactivity - - - {42472427-4774-4c81-8aff-9f27b8e31721} - Avalonia.Layout - - - {b61b66a3-b82d-4875-8001-89d3394fe0c9} - Avalonia.Logging.Serilog - - - {6417b24e-49c2-4985-8db2-3ab9d898ec91} - Avalonia.ReactiveUI - - - {eb582467-6abb-43a1-b052-e981ba910e3a} - Avalonia.Visuals - - - {f1baa01a-f176-4c6a-b39d-5b40bb1b148f} - Avalonia.Styling - - - {3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f} - Avalonia.Themes.Default - - - {3e53a01a-b331-47f3-b828-4a5717e77a24} - Avalonia.Markup.Xaml - - - {6417e941-21bc-467b-a771-0de389353ce6} - Avalonia.Markup - - - {7d2d3083-71dd-4cc9-8907-39a0d86fb322} - Avalonia.Skia - - - {3e908f67-5543-4879-a1dc-08eace79b3cd} - Avalonia.Direct2D1 - - - {811a76cf-1cf6-440f-963b-bbe31bd72a82} - Avalonia.Win32 - - - - - Designer - - - - - Designer - - - - - Designer - - - - - Designer - - - - - Designer - - - + + + + + + + + + + + + + + + + + + + + diff --git a/samples/VirtualizationTest/Properties/AssemblyInfo.cs b/samples/VirtualizationTest/Properties/AssemblyInfo.cs deleted file mode 100644 index e6af64555bd..00000000000 --- a/samples/VirtualizationTest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("VirtualizationTest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("VirtualizationTest")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("fbcaf3d0-2808-4934-8e96-3f607594517b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/VirtualizationTest/VirtualizationTest.csproj b/samples/VirtualizationTest/VirtualizationTest.csproj index 0d498d827f3..180c8dd48dc 100644 --- a/samples/VirtualizationTest/VirtualizationTest.csproj +++ b/samples/VirtualizationTest/VirtualizationTest.csproj @@ -1,151 +1,29 @@ - - - + - Debug - AnyCPU - {FBCAF3D0-2808-4934-8E96-3F607594517B} - WinExe - Properties - VirtualizationTest - VirtualizationTest - v4.7 - 512 - true - + Exe + netcoreapp2.0 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - App.xaml - - - MainWindow.xaml - - - - - - - - - - - - {d211e587-d8bc-45b9-95a4-f297c8fa5200} - Avalonia.Animation - - - {b09b78d8-9b26-48b0-9149-d64a2f120f3f} - Avalonia.Base - - - {d2221c82-4a25-4583-9b43-d791e3f6820c} - Avalonia.Controls - - - {799a7bb5-3c2c-48b6-85a7-406a12c420da} - Avalonia.DesignerSupport - - - {7062ae20-5dcc-4442-9645-8195bdece63e} - Avalonia.Diagnostics - - - {4A1ABB09-9047-4BD5-A4AD-A055E52C5EE0} - Avalonia.DotNetFrameworkRuntime - - - {62024b2d-53eb-4638-b26b-85eeaa54866e} - Avalonia.Input - - - {6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b} - Avalonia.Interactivity - - - {42472427-4774-4c81-8aff-9f27b8e31721} - Avalonia.Layout - - - {B61B66A3-B82D-4875-8001-89D3394FE0C9} - Avalonia.Logging.Serilog - - - {6417b24e-49c2-4985-8db2-3ab9d898ec91} - Avalonia.ReactiveUI - - - {eb582467-6abb-43a1-b052-e981ba910e3a} - Avalonia.Visuals - - - {f1baa01a-f176-4c6a-b39d-5b40bb1b148f} - Avalonia.Styling - - - {3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f} - Avalonia.Themes.Default - - - {3e53a01a-b331-47f3-b828-4a5717e77a24} - Avalonia.Markup.Xaml - - - {6417e941-21bc-467b-a771-0de389353ce6} - Avalonia.Markup - - - {3e908f67-5543-4879-a1dc-08eace79b3cd} - Avalonia.Direct2D1 - - - {811a76cf-1cf6-440f-963b-bbe31bd72a82} - Avalonia.Win32 - - - - - Designer - - - - Designer - + + + + + + + + + + + + + + + + + - + + diff --git a/src/Avalonia.Animation/Avalonia.Animation.csproj b/src/Avalonia.Animation/Avalonia.Animation.csproj index 2101c5669d8..6627fdf9526 100644 --- a/src/Avalonia.Animation/Avalonia.Animation.csproj +++ b/src/Avalonia.Animation/Avalonia.Animation.csproj @@ -1,37 +1,10 @@  netstandard2.0 - false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Animation.xml - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Animation.xml - CS1591 - true - - - - Properties\SharedAssemblyInfo.cs - - + \ No newline at end of file diff --git a/src/Avalonia.Animation/Properties/AssemblyInfo.cs b/src/Avalonia.Animation/Properties/AssemblyInfo.cs deleted file mode 100644 index a41edcc7b13..00000000000 --- a/src/Avalonia.Animation/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 System.Reflection; - -[assembly: AssemblyTitle("Avalonia.Animation")] diff --git a/src/Avalonia.Base/Properties/AssemblyInfo.cs b/src/Avalonia.Base/AssemblyInfo.cs similarity index 90% rename from src/Avalonia.Base/Properties/AssemblyInfo.cs rename to src/Avalonia.Base/AssemblyInfo.cs index 2ee7378413f..0a276aa2aa0 100644 --- a/src/Avalonia.Base/Properties/AssemblyInfo.cs +++ b/src/Avalonia.Base/AssemblyInfo.cs @@ -4,7 +4,6 @@ using System.Reflection; using System.Runtime.CompilerServices; -[assembly: AssemblyTitle("Avalonia.Base")] [assembly: InternalsVisibleTo("Avalonia.Base.UnitTests")] [assembly: InternalsVisibleTo("Avalonia.UnitTests")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] \ No newline at end of file diff --git a/src/Avalonia.Base/Avalonia.Base.csproj b/src/Avalonia.Base/Avalonia.Base.csproj index 54537841a94..599374f75ae 100644 --- a/src/Avalonia.Base/Avalonia.Base.csproj +++ b/src/Avalonia.Base/Avalonia.Base.csproj @@ -1,36 +1,10 @@  netstandard2.0 - false + Avalonia.Base Avalonia - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Base.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Base.xml - CS1591 - true - - - - Properties\SharedAssemblyInfo.cs - - + diff --git a/src/Avalonia.Controls/Properties/AssemblyInfo.cs b/src/Avalonia.Controls/AssemblyInfo.cs similarity index 95% rename from src/Avalonia.Controls/Properties/AssemblyInfo.cs rename to src/Avalonia.Controls/AssemblyInfo.cs index ae8c88f7e8c..3466119411c 100644 --- a/src/Avalonia.Controls/Properties/AssemblyInfo.cs +++ b/src/Avalonia.Controls/AssemblyInfo.cs @@ -5,7 +5,6 @@ using System.Runtime.CompilerServices; using Avalonia.Metadata; -[assembly: AssemblyTitle("Avalonia.Controls")] [assembly: InternalsVisibleTo("Avalonia.Controls.UnitTests")] [assembly: InternalsVisibleTo("Avalonia.DesignerSupport")] diff --git a/src/Avalonia.Controls/Avalonia.Controls.csproj b/src/Avalonia.Controls/Avalonia.Controls.csproj index 997e15050f5..e50625a4c48 100644 --- a/src/Avalonia.Controls/Avalonia.Controls.csproj +++ b/src/Avalonia.Controls/Avalonia.Controls.csproj @@ -1,35 +1,8 @@  netstandard2.0 - false + Avalonia.Controls - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Controls.xml - CS1591;CS0067 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Controls.xml - CS1591 - true - - - - Properties\SharedAssemblyInfo.cs - - @@ -40,6 +13,7 @@ + \ No newline at end of file diff --git a/src/Avalonia.DesignerSupport/Properties/AssemblyInfo.cs b/src/Avalonia.DesignerSupport/Properties/AssemblyInfo.cs deleted file mode 100644 index 1c43bc6d1fc..00000000000 --- a/src/Avalonia.DesignerSupport/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -// 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 System.Reflection; -using Avalonia.Metadata; - -[assembly: AssemblyTitle("Avalonia.Application")] -[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia")] diff --git a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj index 5f8e25269bf..59ed1685f4f 100644 --- a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj +++ b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj @@ -1,29 +1,7 @@  netstandard2.0 - false - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 4 - bin\Debug\Avalonia.Diagnostics.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Diagnostics.xml - CS1591 - true + Avalonia.Diagnostics @@ -38,16 +16,7 @@ - - - Properties\SharedAssemblyInfo.cs - - - %(Filename) - - - Designer - - + + \ No newline at end of file diff --git a/src/Avalonia.Diagnostics/Properties/AssemblyInfo.cs b/src/Avalonia.Diagnostics/Properties/AssemblyInfo.cs deleted file mode 100644 index f4100ef48b6..00000000000 --- a/src/Avalonia.Diagnostics/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 System.Reflection; - -[assembly: AssemblyTitle("Avalonia.Diagnostics")] diff --git a/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj b/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj index a7586ac7ac0..3df25cca498 100644 --- a/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj +++ b/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj @@ -7,11 +7,6 @@ bin\$(Configuration)\Avalonia.DotNetCoreRuntime.xml - - - Properties\SharedAssemblyInfo.cs - - @@ -21,6 +16,7 @@ + \ No newline at end of file diff --git a/src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs b/src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs deleted file mode 100644 index 51ec3975c98..00000000000 --- a/src/Avalonia.DotNetCoreRuntime/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 System.Reflection; - -[assembly: AssemblyTitle("Avalonia.DotNetCoreRuntime")] diff --git a/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj b/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj index dc4a06d2a7a..1c30fe17958 100644 --- a/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj +++ b/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj @@ -7,15 +7,13 @@ true - - Properties\SharedAssemblyInfo.cs - + - + \ No newline at end of file diff --git a/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj b/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj index fde486fa12e..a5d9bae4688 100644 --- a/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj +++ b/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj @@ -6,124 +6,10 @@ false CS0436 - - true - full - false - bin\Debug\ - TRACE;DEBUG;PCL - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE;PCL - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -134,5 +20,6 @@ + \ No newline at end of file diff --git a/src/Avalonia.Input/Properties/AssemblyInfo.cs b/src/Avalonia.Input/AssemblyInfo.cs similarity index 87% rename from src/Avalonia.Input/Properties/AssemblyInfo.cs rename to src/Avalonia.Input/AssemblyInfo.cs index 64b8e8f1a3f..7025965f833 100644 --- a/src/Avalonia.Input/Properties/AssemblyInfo.cs +++ b/src/Avalonia.Input/AssemblyInfo.cs @@ -4,5 +4,4 @@ using System.Reflection; using Avalonia.Metadata; -[assembly: AssemblyTitle("Avalonia.Input")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Input")] diff --git a/src/Avalonia.Input/Avalonia.Input.csproj b/src/Avalonia.Input/Avalonia.Input.csproj index c82601ac2c1..59e413670e9 100644 --- a/src/Avalonia.Input/Avalonia.Input.csproj +++ b/src/Avalonia.Input/Avalonia.Input.csproj @@ -1,29 +1,7 @@  netstandard2.0 - false - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Input.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Input.xml - CS1591 - true + Avalonia.Input @@ -32,10 +10,6 @@ - - - Properties\SharedAssemblyInfo.cs - - + \ No newline at end of file diff --git a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj index 4f6f9ad6fe6..6178ad954ed 100644 --- a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj +++ b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj @@ -1,29 +1,7 @@  netstandard2.0 - false - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Interactivity.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Interactivity.xml - CS1591 - true + Avalonia.Interactive @@ -31,10 +9,8 @@ - - - Properties\SharedAssemblyInfo.cs - - + - \ No newline at end of file + + + diff --git a/src/Avalonia.Interactivity/Properties/AssemblyInfo.cs b/src/Avalonia.Interactivity/Properties/AssemblyInfo.cs deleted file mode 100644 index 27c8765239f..00000000000 --- a/src/Avalonia.Interactivity/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 System.Reflection; - -[assembly: AssemblyTitle("Avalonia.Interactive")] diff --git a/src/Avalonia.Layout/Avalonia.Layout.csproj b/src/Avalonia.Layout/Avalonia.Layout.csproj index 58c18921f5e..39dc37478c0 100644 --- a/src/Avalonia.Layout/Avalonia.Layout.csproj +++ b/src/Avalonia.Layout/Avalonia.Layout.csproj @@ -1,39 +1,13 @@  netstandard2.0 - false - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Layout.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Layout.xml - CS1591 - true + Avalonia.Layout - - - Properties\SharedAssemblyInfo.cs - - + \ No newline at end of file diff --git a/src/Avalonia.Layout/Properties/AssemblyInfo.cs b/src/Avalonia.Layout/Properties/AssemblyInfo.cs deleted file mode 100644 index 126893e1893..00000000000 --- a/src/Avalonia.Layout/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 System.Reflection; - -[assembly: AssemblyTitle("Avalonia.Layout")] diff --git a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj index 4d9d141d0dd..5116d196b5c 100644 --- a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj +++ b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj @@ -1,34 +1,12 @@  netstandard2.0 - false + Avalonia.Serilog - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Logging.Serilog.xml - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Logging.Serilog.xml - true - - - - + \ No newline at end of file diff --git a/src/Avalonia.Logging.Serilog/Properties/AssemblyInfo.cs b/src/Avalonia.Logging.Serilog/Properties/AssemblyInfo.cs deleted file mode 100644 index 35b2e48f70b..00000000000 --- a/src/Avalonia.Logging.Serilog/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyTitle("Avalonia.Serilog")] diff --git a/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj b/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj index b7ad36f8b29..aee428c247f 100644 --- a/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj +++ b/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj @@ -1,10 +1,9 @@  netstandard2.0 - false + Avalonia.ReactiveUI - @@ -14,6 +13,7 @@ + \ No newline at end of file diff --git a/src/Avalonia.ReactiveUI/Properties/AssemblyInfo.cs b/src/Avalonia.ReactiveUI/Properties/AssemblyInfo.cs deleted file mode 100644 index c9ead6f6e64..00000000000 --- a/src/Avalonia.ReactiveUI/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 System.Reflection; - -[assembly: AssemblyTitle("Avalonia.ReactiveUI")] diff --git a/src/Avalonia.Styling/Properties/AssemblyInfo.cs b/src/Avalonia.Styling/AssemblyInfo.cs similarity index 92% rename from src/Avalonia.Styling/Properties/AssemblyInfo.cs rename to src/Avalonia.Styling/AssemblyInfo.cs index 0a639139f73..9f1794c7007 100644 --- a/src/Avalonia.Styling/Properties/AssemblyInfo.cs +++ b/src/Avalonia.Styling/AssemblyInfo.cs @@ -5,7 +5,6 @@ using System.Runtime.CompilerServices; using Avalonia.Metadata; -[assembly: AssemblyTitle("Avalonia.Styling")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Controls")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.LogicalTree")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Styling")] diff --git a/src/Avalonia.Styling/Avalonia.Styling.csproj b/src/Avalonia.Styling/Avalonia.Styling.csproj index b8083b52db8..d614747c7ba 100644 --- a/src/Avalonia.Styling/Avalonia.Styling.csproj +++ b/src/Avalonia.Styling/Avalonia.Styling.csproj @@ -1,40 +1,14 @@  netstandard2.0 - false + Avalonia.Styling Avalonia - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Styling.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Styling.xml - CS1591 - true - - - - Properties\SharedAssemblyInfo.cs - - + \ No newline at end of file diff --git a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj index d8260226e9b..1cc31d57c73 100644 --- a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj +++ b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj @@ -1,27 +1,6 @@  netstandard2.0 - false - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Themes.Default.xml - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Themes.Default.xml - true @@ -34,16 +13,7 @@ - - - Properties\SharedAssemblyInfo.cs - - - %(Filename) - - - Designer - - + + \ No newline at end of file diff --git a/src/Avalonia.Themes.Default/Properties/AssemblyInfo.cs b/src/Avalonia.Themes.Default/Properties/AssemblyInfo.cs deleted file mode 100644 index 36576736188..00000000000 --- a/src/Avalonia.Themes.Default/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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 System.Reflection; - -[assembly: AssemblyTitle("Avalonia.Themes.Default")] diff --git a/src/Avalonia.Visuals/Properties/AssemblyInfo.cs b/src/Avalonia.Visuals/AssemblyInfo.cs similarity index 93% rename from src/Avalonia.Visuals/Properties/AssemblyInfo.cs rename to src/Avalonia.Visuals/AssemblyInfo.cs index 900746d05a0..05c3d7e62ae 100644 --- a/src/Avalonia.Visuals/Properties/AssemblyInfo.cs +++ b/src/Avalonia.Visuals/AssemblyInfo.cs @@ -5,7 +5,6 @@ using System.Runtime.CompilerServices; using Avalonia.Metadata; -[assembly: AssemblyTitle("Avalonia.Visuals")] [assembly: InternalsVisibleTo("Avalonia.Visuals.UnitTests")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Animation")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Media")] diff --git a/src/Avalonia.Visuals/Avalonia.Visuals.csproj b/src/Avalonia.Visuals/Avalonia.Visuals.csproj index fe18b0e4468..0e2cde2c97e 100644 --- a/src/Avalonia.Visuals/Avalonia.Visuals.csproj +++ b/src/Avalonia.Visuals/Avalonia.Visuals.csproj @@ -1,39 +1,12 @@  netstandard2.0 - false Avalonia - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Visuals.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Visuals.xml - CS1591 - true - - - - Properties\SharedAssemblyInfo.cs - - + \ No newline at end of file diff --git a/src/Gtk/Avalonia.Gtk3/Properties/AssemblyInfo.cs b/src/Gtk/Avalonia.Gtk3/AssemblyInfo.cs similarity index 93% rename from src/Gtk/Avalonia.Gtk3/Properties/AssemblyInfo.cs rename to src/Gtk/Avalonia.Gtk3/AssemblyInfo.cs index 034b73f699a..a27d631ee04 100644 --- a/src/Gtk/Avalonia.Gtk3/Properties/AssemblyInfo.cs +++ b/src/Gtk/Avalonia.Gtk3/AssemblyInfo.cs @@ -5,8 +5,6 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Avalonia.Gtk3")] - [assembly: ExportWindowingSubsystem(OperatingSystemType.WinNT, 2, "GTK3", typeof(Gtk3Platform), nameof(Gtk3Platform.Initialize))] [assembly: ExportWindowingSubsystem(OperatingSystemType.Linux, 1, "GTK3", typeof(Gtk3Platform), nameof(Gtk3Platform.Initialize))] [assembly: ExportWindowingSubsystem(OperatingSystemType.OSX, 2, "GTK3", typeof(Gtk3Platform), nameof(Gtk3Platform.Initialize))] \ No newline at end of file diff --git a/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj b/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj index f1b990f349e..7ac43e98bf8 100644 --- a/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj +++ b/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj @@ -1,30 +1,9 @@  netstandard2.0 - false - - - true - full - false - bin\Debug\ - TRACE;DEBUG;GTK3_PINVOKE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE;GTK3_PINVOKE - prompt - 4 true + $(DefineConstants);GTK3_PINVOKE - - - @@ -32,4 +11,5 @@ + \ No newline at end of file diff --git a/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj b/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj index 466b47f7a08..fc34ecf9e99 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj +++ b/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj @@ -11,4 +11,5 @@ + \ No newline at end of file diff --git a/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj b/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj index c31c131ea94..e7c11541105 100644 --- a/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj +++ b/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj @@ -5,7 +5,6 @@ false - @@ -18,5 +17,6 @@ + \ No newline at end of file diff --git a/src/Shared/CompileXaml.props b/src/Shared/CompileXaml.props new file mode 100644 index 00000000000..219ffb2e422 --- /dev/null +++ b/src/Shared/CompileXaml.props @@ -0,0 +1,11 @@ + + + + %(Filename) + + + Designer + + + \ No newline at end of file diff --git a/src/Shared/Shared.props b/src/Shared/Shared.props new file mode 100644 index 00000000000..1602d7d6179 --- /dev/null +++ b/src/Shared/Shared.props @@ -0,0 +1,11 @@ + + + Avalonia + 0.6.2 + Copyright 2016 © AvaloniaUI + https://github.com/AvaloniaUI/Avalonia/blob/master/licence.md + https://github.com/AvaloniaUI/Avalonia/ + https://github.com/AvaloniaUI/Avalonia/ + + \ No newline at end of file diff --git a/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj b/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj index f5ed89d1545..19ab0dffde4 100644 --- a/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj +++ b/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj @@ -5,13 +5,8 @@ Avalonia.Skia Avalonia.Skia true - true + true - - - Properties\SharedAssemblyInfo.cs - - @@ -21,6 +16,7 @@ + - + \ No newline at end of file From b1615939940fb397ac14dbfa6469dad027e399e1 Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sun, 6 May 2018 12:47:39 +0800 Subject: [PATCH 17/92] Moved version and xaml props to build directory. added Directory.Build.Props to src & samples directory. cleaned up Avalonia.Markup.csproj. Will do more test to do the same on Avalonia.Markup.Xaml. --- .../EmbedXaml.props | 0 .../Shared.props => build/SharedVersion.props | 0 samples/Directory.Build.props | 3 +++ samples/RenderTest/RenderTest.csproj | 3 +-- .../VirtualizationTest.csproj | 3 +-- .../Avalonia.Animation.csproj | 1 - src/Avalonia.Base/Avalonia.Base.csproj | 1 - .../Avalonia.Controls.csproj | 1 - .../Avalonia.Diagnostics.csproj | 6 ++--- .../Avalonia.DotNetCoreRuntime.csproj | 6 +---- .../Avalonia.DotNetFrameworkRuntime.csproj | 3 +-- .../Avalonia.HtmlRenderer.csproj | 2 +- src/Avalonia.Input/Avalonia.Input.csproj | 4 +-- .../Avalonia.Interactivity.csproj | 1 - src/Avalonia.Layout/Avalonia.Layout.csproj | 4 +-- .../Avalonia.Logging.Serilog.csproj | 3 +-- .../Avalonia.ReactiveUI.csproj | 2 -- src/Avalonia.Styling/Avalonia.Styling.csproj | 1 - .../Avalonia.Themes.Default.csproj | 5 ++-- src/Avalonia.Visuals/Avalonia.Visuals.csproj | 3 +-- src/Directory.Build.props | 3 +++ src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj | 1 - .../Avalonia.LinuxFramebuffer.csproj | 3 +-- .../Avalonia.Markup.Xaml.csproj | 3 --- .../{Properties => }/AssemblyInfo.cs | 1 - .../Avalonia.Markup/Avalonia.Markup.csproj | 27 ------------------- .../Avalonia.MonoMac/Avalonia.MonoMac.csproj | 1 - src/Skia/Avalonia.Skia/Avalonia.Skia.csproj | 2 +- 28 files changed, 21 insertions(+), 72 deletions(-) rename src/Shared/CompileXaml.props => build/EmbedXaml.props (100%) rename src/Shared/Shared.props => build/SharedVersion.props (100%) create mode 100644 samples/Directory.Build.props create mode 100644 src/Directory.Build.props rename src/Markup/Avalonia.Markup/{Properties => }/AssemblyInfo.cs (89%) diff --git a/src/Shared/CompileXaml.props b/build/EmbedXaml.props similarity index 100% rename from src/Shared/CompileXaml.props rename to build/EmbedXaml.props diff --git a/src/Shared/Shared.props b/build/SharedVersion.props similarity index 100% rename from src/Shared/Shared.props rename to build/SharedVersion.props diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props new file mode 100644 index 00000000000..7325bab2a39 --- /dev/null +++ b/samples/Directory.Build.props @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/samples/RenderTest/RenderTest.csproj b/samples/RenderTest/RenderTest.csproj index 4373e4715a1..1fa9a140fe1 100644 --- a/samples/RenderTest/RenderTest.csproj +++ b/samples/RenderTest/RenderTest.csproj @@ -22,8 +22,7 @@ - - + diff --git a/samples/VirtualizationTest/VirtualizationTest.csproj b/samples/VirtualizationTest/VirtualizationTest.csproj index 180c8dd48dc..b29ea52b28a 100644 --- a/samples/VirtualizationTest/VirtualizationTest.csproj +++ b/samples/VirtualizationTest/VirtualizationTest.csproj @@ -22,8 +22,7 @@ - - + diff --git a/src/Avalonia.Animation/Avalonia.Animation.csproj b/src/Avalonia.Animation/Avalonia.Animation.csproj index 6627fdf9526..46e41dd32a4 100644 --- a/src/Avalonia.Animation/Avalonia.Animation.csproj +++ b/src/Avalonia.Animation/Avalonia.Animation.csproj @@ -5,6 +5,5 @@ - \ No newline at end of file diff --git a/src/Avalonia.Base/Avalonia.Base.csproj b/src/Avalonia.Base/Avalonia.Base.csproj index 599374f75ae..35adcbeb922 100644 --- a/src/Avalonia.Base/Avalonia.Base.csproj +++ b/src/Avalonia.Base/Avalonia.Base.csproj @@ -4,7 +4,6 @@ Avalonia.Base Avalonia - diff --git a/src/Avalonia.Controls/Avalonia.Controls.csproj b/src/Avalonia.Controls/Avalonia.Controls.csproj index e50625a4c48..a29c807bccb 100644 --- a/src/Avalonia.Controls/Avalonia.Controls.csproj +++ b/src/Avalonia.Controls/Avalonia.Controls.csproj @@ -13,7 +13,6 @@ - \ No newline at end of file diff --git a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj index 59ed1685f4f..a2ff0ecf02f 100644 --- a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj +++ b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj @@ -1,7 +1,6 @@  netstandard2.0 - Avalonia.Diagnostics @@ -15,8 +14,7 @@ - - - + + \ No newline at end of file diff --git a/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj b/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj index 3df25cca498..5f40d347b7d 100644 --- a/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj +++ b/src/Avalonia.DotNetCoreRuntime/Avalonia.DotNetCoreRuntime.csproj @@ -4,9 +4,6 @@ false $(DefineConstants);DOTNETCORE - - bin\$(Configuration)\Avalonia.DotNetCoreRuntime.xml - @@ -15,8 +12,7 @@ - - + \ No newline at end of file diff --git a/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj b/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj index 1c30fe17958..eca5b894198 100644 --- a/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj +++ b/src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj @@ -11,8 +11,7 @@ - - + diff --git a/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj b/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj index a5d9bae4688..520687c3ef1 100644 --- a/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj +++ b/src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj @@ -20,6 +20,6 @@ - + \ No newline at end of file diff --git a/src/Avalonia.Input/Avalonia.Input.csproj b/src/Avalonia.Input/Avalonia.Input.csproj index 59e413670e9..86d081abb8e 100644 --- a/src/Avalonia.Input/Avalonia.Input.csproj +++ b/src/Avalonia.Input/Avalonia.Input.csproj @@ -1,7 +1,6 @@  netstandard2.0 - Avalonia.Input @@ -9,7 +8,6 @@ - - + \ No newline at end of file diff --git a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj index 6178ad954ed..1f8247b3875 100644 --- a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj +++ b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj @@ -9,7 +9,6 @@ - diff --git a/src/Avalonia.Layout/Avalonia.Layout.csproj b/src/Avalonia.Layout/Avalonia.Layout.csproj index 39dc37478c0..befa22ec46d 100644 --- a/src/Avalonia.Layout/Avalonia.Layout.csproj +++ b/src/Avalonia.Layout/Avalonia.Layout.csproj @@ -1,13 +1,11 @@  netstandard2.0 - Avalonia.Layout - - + \ No newline at end of file diff --git a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj index 5116d196b5c..4c67ffd7b9b 100644 --- a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj +++ b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj @@ -6,7 +6,6 @@ - - + \ No newline at end of file diff --git a/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj b/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj index aee428c247f..ae1ef604640 100644 --- a/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj +++ b/src/Avalonia.ReactiveUI/Avalonia.ReactiveUI.csproj @@ -1,7 +1,6 @@  netstandard2.0 - Avalonia.ReactiveUI @@ -13,7 +12,6 @@ - \ No newline at end of file diff --git a/src/Avalonia.Styling/Avalonia.Styling.csproj b/src/Avalonia.Styling/Avalonia.Styling.csproj index d614747c7ba..3c9dce8dca0 100644 --- a/src/Avalonia.Styling/Avalonia.Styling.csproj +++ b/src/Avalonia.Styling/Avalonia.Styling.csproj @@ -9,6 +9,5 @@ - \ No newline at end of file diff --git a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj index 1cc31d57c73..eceafc23718 100644 --- a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj +++ b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj @@ -12,8 +12,7 @@ - - - + + \ No newline at end of file diff --git a/src/Avalonia.Visuals/Avalonia.Visuals.csproj b/src/Avalonia.Visuals/Avalonia.Visuals.csproj index 0e2cde2c97e..f320644cd00 100644 --- a/src/Avalonia.Visuals/Avalonia.Visuals.csproj +++ b/src/Avalonia.Visuals/Avalonia.Visuals.csproj @@ -6,7 +6,6 @@ - - + \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000000..7325bab2a39 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj b/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj index 7ac43e98bf8..ef043959adc 100644 --- a/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj +++ b/src/Gtk/Avalonia.Gtk3/Avalonia.Gtk3.csproj @@ -11,5 +11,4 @@ - \ No newline at end of file diff --git a/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj b/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj index fc34ecf9e99..fb1fbdaf939 100644 --- a/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj +++ b/src/Linux/Avalonia.LinuxFramebuffer/Avalonia.LinuxFramebuffer.csproj @@ -10,6 +10,5 @@ - - + \ No newline at end of file diff --git a/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj b/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj index bd6acfdad13..95208fabd97 100644 --- a/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj +++ b/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj @@ -26,9 +26,6 @@ CS1591 - - Properties\SharedAssemblyInfo.cs - diff --git a/src/Markup/Avalonia.Markup/Properties/AssemblyInfo.cs b/src/Markup/Avalonia.Markup/AssemblyInfo.cs similarity index 89% rename from src/Markup/Avalonia.Markup/Properties/AssemblyInfo.cs rename to src/Markup/Avalonia.Markup/AssemblyInfo.cs index dd8c0a6bd3e..15c0be673a3 100644 --- a/src/Markup/Avalonia.Markup/Properties/AssemblyInfo.cs +++ b/src/Markup/Avalonia.Markup/AssemblyInfo.cs @@ -5,6 +5,5 @@ using Avalonia.Metadata; using System.Runtime.CompilerServices; -[assembly: AssemblyTitle("Avalonia.Markup")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Markup")] [assembly: InternalsVisibleTo("Avalonia.Markup.UnitTests")] diff --git a/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj b/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj index a6d3c3336fa..9707662701c 100644 --- a/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj +++ b/src/Markup/Avalonia.Markup/Avalonia.Markup.csproj @@ -3,33 +3,6 @@ netstandard2.0 false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Avalonia.Markup.xml - CS1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Avalonia.Markup.xml - CS1591 - true - - - - Properties\SharedAssemblyInfo.cs - - diff --git a/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj b/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj index e7c11541105..cbf91e818a1 100644 --- a/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj +++ b/src/OSX/Avalonia.MonoMac/Avalonia.MonoMac.csproj @@ -17,6 +17,5 @@ - \ No newline at end of file diff --git a/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj b/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj index 19ab0dffde4..ade7f8778aa 100644 --- a/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj +++ b/src/Skia/Avalonia.Skia/Avalonia.Skia.csproj @@ -16,7 +16,7 @@ - + \ No newline at end of file From 9aa93ee6d9bf0a5c6db18241aa3da9fc8797be6c Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sun, 6 May 2018 13:23:11 +0800 Subject: [PATCH 18/92] Fix merge conflict --- src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj b/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj index fd49f515981..49f6ca9eebd 100644 --- a/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj +++ b/src/Markup/Avalonia.Markup.Xaml/Avalonia.Markup.Xaml.csproj @@ -26,10 +26,6 @@ CS1591 - - - Properties\SharedAssemblyInfo.cs - From 3873efea02dab3605830e40e1772fb19828062b0 Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sun, 6 May 2018 13:34:48 +0800 Subject: [PATCH 19/92] Added GenerateDocumentationFile attribute to fix Cake --- build/SharedVersion.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/SharedVersion.props b/build/SharedVersion.props index 1602d7d6179..86ee811125f 100644 --- a/build/SharedVersion.props +++ b/build/SharedVersion.props @@ -7,5 +7,7 @@ https://github.com/AvaloniaUI/Avalonia/blob/master/licence.md https://github.com/AvaloniaUI/Avalonia/ https://github.com/AvaloniaUI/Avalonia/ + true + CS1591 \ No newline at end of file From 73f408de2190b7d24603bc08aa2da8eb89122e6d Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sun, 6 May 2018 13:54:58 +0800 Subject: [PATCH 20/92] Fix Avalonia.Interactive to Avalonia.Interactivity --- src/Avalonia.Interactivity/Avalonia.Interactivity.csproj | 1 - .../Avalonia.Interactivity.UnitTests/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj index 1f8247b3875..66f1e8cc267 100644 --- a/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj +++ b/src/Avalonia.Interactivity/Avalonia.Interactivity.csproj @@ -1,7 +1,6 @@  netstandard2.0 - Avalonia.Interactive diff --git a/tests/Avalonia.Interactivity.UnitTests/Properties/AssemblyInfo.cs b/tests/Avalonia.Interactivity.UnitTests/Properties/AssemblyInfo.cs index 49d227c3e94..318b40828ed 100644 --- a/tests/Avalonia.Interactivity.UnitTests/Properties/AssemblyInfo.cs +++ b/tests/Avalonia.Interactivity.UnitTests/Properties/AssemblyInfo.cs @@ -4,7 +4,7 @@ using System.Reflection; using Xunit; -[assembly: AssemblyTitle("Avalonia.Interactive.UnitTests")] +[assembly: AssemblyTitle("Avalonia.Interactivity.UnitTests")] // Don't run tests in parallel. [assembly: CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file From f8dc172416f7a29c8a478e5ad254aa86abf170ab Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sun, 6 May 2018 14:09:47 +0800 Subject: [PATCH 21/92] Fix Avalonia.Serilog to Avalonia.Logging.Serilog --- src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj index 4c67ffd7b9b..456cd8c5685 100644 --- a/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj +++ b/src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj @@ -1,7 +1,6 @@  netstandard2.0 - Avalonia.Serilog From dd3a9ed3d344dd1472602f91bd1109d9fa7a6f4d Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sun, 6 May 2018 14:45:44 +0800 Subject: [PATCH 22/92] Port BindingTest sample to the new csproj format. Also added MainWindow's Title. Added net461 on TargetFramework attribs on the samples. --- samples/BindingTest/BindingTest.csproj | 169 +++--------------- samples/BindingTest/MainWindow.xaml | 3 +- .../BindingTest/Properties/AssemblyInfo.cs | 36 ---- samples/RenderTest/MainWindow.xaml | 2 +- samples/RenderTest/RenderTest.csproj | 2 +- samples/VirtualizationTest/MainWindow.xaml | 2 +- .../VirtualizationTest.csproj | 4 +- 7 files changed, 28 insertions(+), 190 deletions(-) delete mode 100644 samples/BindingTest/Properties/AssemblyInfo.cs diff --git a/samples/BindingTest/BindingTest.csproj b/samples/BindingTest/BindingTest.csproj index a17fe0eed13..c89921e427d 100644 --- a/samples/BindingTest/BindingTest.csproj +++ b/samples/BindingTest/BindingTest.csproj @@ -1,155 +1,28 @@ - - - + - Debug - AnyCPU - {08B3E6B9-1CD5-443C-9F61-6D49D1C5F162} - WinExe - Properties - BindingTest - BindingTest - v4.7 - 512 - true - - PackageReference + Exe + netcoreapp2.0;net461 - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - Designer - - - App.xaml - - - MainWindow.xaml - - - - TestItemView.xaml - - - - - - - - - - - - Designer - - - - - {4A1ABB09-9047-4BD5-A4AD-A055E52C5EE0} - Avalonia.DotNetFrameworkRuntime - - - {3e53a01a-b331-47f3-b828-4a5717e77a24} - Avalonia.Markup.Xaml - - - {6417e941-21bc-467b-a771-0de389353ce6} - Avalonia.Markup - - - {d211e587-d8bc-45b9-95a4-f297c8fa5200} - Avalonia.Animation - - - {b09b78d8-9b26-48b0-9149-d64a2f120f3f} - Avalonia.Base - - - {d2221c82-4a25-4583-9b43-d791e3f6820c} - Avalonia.Controls - - - {799a7bb5-3c2c-48b6-85a7-406a12c420da} - Avalonia.DesignerSupport - - - {7062ae20-5dcc-4442-9645-8195bdece63e} - Avalonia.Diagnostics - - - {62024b2d-53eb-4638-b26b-85eeaa54866e} - Avalonia.Input - - - {6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b} - Avalonia.Interactivity - - - {42472427-4774-4c81-8aff-9f27b8e31721} - Avalonia.Layout - - - {b61b66a3-b82d-4875-8001-89d3394fe0c9} - Avalonia.Logging.Serilog - - - {6417b24e-49c2-4985-8db2-3ab9d898ec91} - Avalonia.ReactiveUI - - - {eb582467-6abb-43a1-b052-e981ba910e3a} - Avalonia.Visuals - - - {f1baa01a-f176-4c6a-b39d-5b40bb1b148f} - Avalonia.Styling - - - {3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f} - Avalonia.Themes.Default - - - {3e908f67-5543-4879-a1dc-08eace79b3cd} - Avalonia.Direct2D1 - - - {811a76cf-1cf6-440f-963b-bbe31bd72a82} - Avalonia.Win32 - + + + + + + + + + + + + + + + + + - + diff --git a/samples/BindingTest/MainWindow.xaml b/samples/BindingTest/MainWindow.xaml index 4eb45e07c5c..ad488c35a89 100644 --- a/samples/BindingTest/MainWindow.xaml +++ b/samples/BindingTest/MainWindow.xaml @@ -1,7 +1,8 @@ + xmlns:local="clr-namespace:BindingTest" + Title="AvaloniaUI Bindings Test">