Binding on RotateTransform Angle in DataTemplate not taking effect

前端 未结 3 1692
旧巷少年郎
旧巷少年郎 2021-01-27 01:11

In my WPF UserControl I have this resource, please observe the comments in the Xml sample.


    

        
3条回答
  •  心在旅途
    2021-01-27 01:35

    I recreated similar setting as you and it did not work for me either. Curiously there are no binding errors. I did relativesource binding too and it didnt work.

    Although if I bind tooltip

      
    

    shows the tooltip to me. So I changed the rotate transform,

      
    

    But still the transform did not work. Still no binding errors.

    Then I introduced a dummy converter ...

    public class AngleConverter : IValueConverter
    {
        public object Convert(...)
        {
            return value;
        }
        ....
    }
    
    
    

    and it worked miraculously!!!

    Unexplanable world of WPF???

提交回复
热议问题