You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only if you want to dynamically add or remove shade during the view lifetime.
156
+
157
+
#### 3. All other IEnumerable<Shade>
158
+
159
+
If you want to modify a shade property during the view lifetime.
160
+
161
+
**IMPORTANT**: if you don't use a `ReadOnlyCollection<Shade>` please be sure to declare your `Shade` as transient.
162
+
It means you should declare a new instance of `Shade` for each `Shadows` views. For example, in code-behind with `new Shade()`, or in xaml with `Shades` property.
163
+
Just don't reference static instances of shade from `ResourceDictionary` with `StaticResource` references, or even in a C# class.
164
+
110
165
### Shades
111
166
112
167
The `Shadows` component has only 2 properties:
@@ -252,8 +307,8 @@ Have a look at the `BeCreative.xaml` file and its code-behind.
252
307
253
308
To have a better control of your shades, `Shadows` provides 2 kinds of `MarkupExtension`:
254
309
255
-
1. One immutable collection of shades: `ImmutableShades`
256
-
2. One mutable collection: `ShadesStack`
310
+
1. One immutable collection of shades: `ImmutableShades` (readonly type)
311
+
2. One mutable collection: `ShadeStack` (observable collection type)
257
312
258
313
Use the first one if the shade collection will not change and the second one if you want to dynamically add or remove shades.
259
314
@@ -297,7 +352,7 @@ It will remove some xaml elements:
297
352
298
353
## Performance
299
354
300
-
* On `Android`, shadows are created thanks to `RenderScript`. Bitmaps are cached and only recreated when needed
355
+
* On `Android`, shadows are created thanks to `RenderScript`. Bitmaps are cached in a global `BitmapCache`. For a particular color, size and blur, you will only have one instance alive.
301
356
* On `iOS`, a `Shade` is implemented with a simple `CALayer`
302
357
* On `UWP`, `Shade` is implemented with `SpriteVisual` drop shadows.
303
358
* On `Tizen`, `Shade` is implemented with `SkiaSharp`.
0 commit comments