1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media.Effects;
namespace MaterialDesignThemes.Wpf.Converters
{
internal static class ShadowInfo
{
private static readonly IDictionary<ShadowDepth, DropShadowEffect> ShadowsDictionary;
static ShadowInfo()
{
var resourceDictionary = new ResourceDictionary { Source = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml", UriKind.Absolute) };
ShadowsDictionary = new Dictionary<ShadowDepth, DropShadowEffect>
{
{ ShadowDepth.Depth0, null },
{ ShadowDepth.Depth1, (DropShadowEffect)resourceDictionary["MaterialDesignShadowDepth1"] },
{ ShadowDepth.Depth2, (DropShadowEffect)resourceDictionary["MaterialDesignShadowDepth2"] },
{ ShadowDepth.Depth3, (DropShadowEffect)resourceDictionary["MaterialDesignShadowDepth3"] },
{ ShadowDepth.Depth4, (DropShadowEffect)resourceDictionary["MaterialDesignShadowDepth4"] },
{ ShadowDepth.Depth5, (DropShadowEffect)resourceDictionary["MaterialDesignShadowDepth5"] },
};
}
public static DropShadowEffect GetDropShadow(ShadowDepth depth)
{
return ShadowsDictionary[depth];
}
}
}
|