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

#xaml

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}}}" />... 展开详请

为什么每次双击都会引发TreeViewItem的MouseDoubleClick事件?

可以尝试使用这个:

代码语言:javascript
复制
...
TreeViewItem tviSender = sender as TreeViewItem;

if (tviSender.IsSelected)
    DoAction();
...
领券