首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

#uwp

X:UWP XAML中的Static?

在UWP上没有静态标记扩展(也没有WinRT平台)。 可能的解决方案之一是创建类,将枚举值作为属性,并将该类的实例存储在ResourceDictionary中。 例子: public enum Weather { Cold, Hot } 下面是具有枚举值的类: public class WeatherEnumValues { public static Weather Cold { get { return Weather.Cold; } } public static Weather Hot { get { return Weather.Hot; } } } 在你的资源字典中: <local:WeatherEnumValues x:Key="WeatherEnumValues" /> 如下: "{Binding whatever, Converter={StaticResource converterName}, ConverterParameter={Binding Hot, Source={StaticResource WeatherEnumValues}}}" />... 展开详请
领券