PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/Common/Auxiliary/MarkupExtensions/XbapConditionalExpression.cs

#
C# | 33 lines | 29 code | 4 blank | 0 comment | 0 complexity | 7f98efd51b2f2e0d1991a4c32c3c1888 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.Windows.Markup;
 6using System.Windows;
 7using System.ComponentModel;
 8
 9namespace Microsoft.Research.DynamicDataDisplay.MarkupExtensions
10{
11	[EditorBrowsable(EditorBrowsableState.Never)]
12	public class XbapConditionalExpression : MarkupExtension
13	{
14		public XbapConditionalExpression() { }
15
16		public XbapConditionalExpression(object value)
17		{
18			this.Value = value;
19		}
20
21		[ConstructorArgument("value")]
22		public object Value { get; set; }
23
24		public override object ProvideValue(IServiceProvider serviceProvider)
25		{
26#if RELEASEXBAP
27			return null;
28#else
29			return ((ResourceDictionary)Application.LoadComponent(new Uri("/DynamicDataDisplay;component/Themes/Generic.xaml", UriKind.Relative)))[Value];
30#endif
31		}
32	}
33}