2 * Copyright(c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
23 /// The class storing Background extra properties such as CornerRadius, ImageBorder.
25 internal class BackgroundExtraData : IDisposable
27 internal BackgroundExtraData()
31 internal BackgroundExtraData(BackgroundExtraData other)
33 BackgroundImageBorder = other.BackgroundImageBorder;
34 CornerRadius = other.CornerRadius;
37 private Rectangle backgroundImageBorder;
39 /// <summary></summary>
40 internal Rectangle BackgroundImageBorder
42 get => backgroundImageBorder;
43 set => backgroundImageBorder = new Rectangle(value);
46 /// <summary></summary>
47 internal float CornerRadius { get; set; }
50 /// Whether the CornerRadius value is relative (percentage [0.0f to 1.0f] of the view size) or absolute (in world units).
52 internal VisualTransformPolicyType CornerRadiusPolicy { get; set; } = VisualTransformPolicyType.Absolute;
56 return CornerRadius == 0 && Rectangle.IsNullOrZero(BackgroundImageBorder);
59 protected virtual void Dispose(bool disposing)
63 // Dispose managed resources.
64 backgroundImageBorder?.Dispose();
66 // Free native resources.
72 GC.SuppressFinalize(this);