绑定很容易,比如如下的代码即可将一个TimeEditor绑定为另一个的值
我估计你想问的是个在设置了CustomFormat="HH:mm:ss"这个属性时,仍旧给绑定一个string值,这个确实就不行了,绑定一个Datetime值是可以的
- <c1:C1TimeEditor HorizontalAlignment="Left" Margin="49,52,0,0" CustomFormat="HH:mm:ss" Grid.Row="1" Value="{Binding ElementName=time1,Path=Value}" VerticalAlignment="Top"/>
- <c1:C1TimeEditor HorizontalAlignment="Left" Margin="49,92,0,0" CustomFormat="HH:mm:ss" Grid.Row="1" x:Name="time1" VerticalAlignment="Top"/>
复制代码 |