简体   繁体   English

在XAML中设置可为空的TimeSpan

[英]Setting nullable TimeSpan in XAML

I am creating a Style for the Player from MediaPlayerFramework and in this XAML style I want to set two properties ( SkipAheadInterval and SkipBackInterval ) which are of type TimeSpan? 我正在从MediaPlayerFramework为播放器创建Style ,并且以这种XAML样式设置两个TimeSpan?类型的属性( SkipAheadIntervalSkipBackIntervalTimeSpan? .

I tried 我试过了

<Setter Property="SkipAheadInterval" Value="00:00:20.00" />

But I am getting 但是我越来越

Cannot assign to nullable type on property SkipAheadInterval

Is there a way to do it in XAML? 有没有办法在XAML中做到这一点?

您是否考虑过使用ValueConverter并在ValueConverter范围内处理nullable?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM