Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Spinning Indicator Control Error

Spinning Indicator Control Error

Scheduled Pinned Locked Moved WPF
helpquestion
7 Posts 2 Posters 20 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I have a spinning indicator custom control[^]. It's currently in a UserControl that works fine. But now I want to put it in a CustomControl instead. It's throwing this exception. If I comment out the DoubleAnimation then it doesn't throw, but it also doesn't show anything.

    Cannot resolve all property references in the property path 'RenderTransform.Angle'. Verify that applicable objects support the properties.

    Inner Exception 1:
    InvalidOperationException: Cannot resolve all property references in the property path 'RenderTransform.Angle'. Verify that applicable objects support the properties.

    I'm stumped on this. Anyone know what's wrong? Code behind It has properties for the Indicator Color, Indicator Text Color, and Message:

    public class MaroisSpinningProgress : ControlBase
    {
    #region DP IndicatorColor
    public static readonly DependencyProperty IndicatorColorProperty =
    DependencyProperty.Register("IndicatorColor",
    typeof(SolidColorBrush),
    typeof(MaroisSpinningProgress),
    new PropertyMetadata(new SolidColorBrush(Colors.Black), new PropertyChangedCallback(OnIndicatorColorChanged)));

    public SolidColorBrush IndicatorColor
    {
        get { return (SolidColorBrush)GetValue(IndicatorColorProperty); }
        set { SetValue(IndicatorColorProperty, value); }
    }
    
    private static void OnIndicatorColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        var control = (MaroisSpinningProgress)d;
    }
    #endregion
    
    #region DP IndicatorTextColor
    public static readonly DependencyProperty IndicatorTextColorProperty =
                DependencyProperty.Register("IndicatorTextColor",
                typeof(SolidColorBrush),
                typeof(MaroisSpinningProgress),
                new PropertyMetadata(new SolidColorBrush(Colors.Black)));
    
    public SolidColorBrush IndicatorTextColor
    {
        get { return (SolidColorBrush)GetValue(IndicatorTextColorProperty); }
        set { SetValue(IndicatorTextColorProperty, value); }
    }
    #endregion
    
    #region DP Message
    public static readonly DependencyProperty MessageProperty =
                DependencyProperty.Register("Message",
                typeof(string),
                typeof(MaroisSpinningProgress),
    
    L 1 Reply Last reply
    0
    • K Kevin Marois

      I have a spinning indicator custom control[^]. It's currently in a UserControl that works fine. But now I want to put it in a CustomControl instead. It's throwing this exception. If I comment out the DoubleAnimation then it doesn't throw, but it also doesn't show anything.

      Cannot resolve all property references in the property path 'RenderTransform.Angle'. Verify that applicable objects support the properties.

      Inner Exception 1:
      InvalidOperationException: Cannot resolve all property references in the property path 'RenderTransform.Angle'. Verify that applicable objects support the properties.

      I'm stumped on this. Anyone know what's wrong? Code behind It has properties for the Indicator Color, Indicator Text Color, and Message:

      public class MaroisSpinningProgress : ControlBase
      {
      #region DP IndicatorColor
      public static readonly DependencyProperty IndicatorColorProperty =
      DependencyProperty.Register("IndicatorColor",
      typeof(SolidColorBrush),
      typeof(MaroisSpinningProgress),
      new PropertyMetadata(new SolidColorBrush(Colors.Black), new PropertyChangedCallback(OnIndicatorColorChanged)));

      public SolidColorBrush IndicatorColor
      {
          get { return (SolidColorBrush)GetValue(IndicatorColorProperty); }
          set { SetValue(IndicatorColorProperty, value); }
      }
      
      private static void OnIndicatorColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
      {
          var control = (MaroisSpinningProgress)d;
      }
      #endregion
      
      #region DP IndicatorTextColor
      public static readonly DependencyProperty IndicatorTextColorProperty =
                  DependencyProperty.Register("IndicatorTextColor",
                  typeof(SolidColorBrush),
                  typeof(MaroisSpinningProgress),
                  new PropertyMetadata(new SolidColorBrush(Colors.Black)));
      
      public SolidColorBrush IndicatorTextColor
      {
          get { return (SolidColorBrush)GetValue(IndicatorTextColorProperty); }
          set { SetValue(IndicatorTextColorProperty, value); }
      }
      #endregion
      
      #region DP Message
      public static readonly DependencyProperty MessageProperty =
                  DependencyProperty.Register("Message",
                  typeof(string),
                  typeof(MaroisSpinningProgress),
      
      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The "target" is the RotateTransform; the "target property" is "Angle".

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      K 1 Reply Last reply
      0
      • L Lost User

        The "target" is the RotateTransform; the "target property" is "Angle".

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        K Offline
        K Offline
        Kevin Marois
        wrote on last edited by
        #3

        I'm sorry, I don't think I understand. Isn't that what I have here

        and here

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        L 1 Reply Last reply
        0
        • K Kevin Marois

          I'm sorry, I don't think I understand. Isn't that what I have here

          and here

          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You give the RotateTransform a "Name"; then reference it in "TargetName" of the StoryBoard. Where in "RenderTransform" (abstract Transform) is there an "Angle" property?

          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

          K 2 Replies Last reply
          0
          • L Lost User

            You give the RotateTransform a "Name"; then reference it in "TargetName" of the StoryBoard. Where in "RenderTransform" (abstract Transform) is there an "Angle" property?

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            K Offline
            K Offline
            Kevin Marois
            wrote on last edited by
            #5

            [UPDATE] I found this[^] which works fine. Thanks OK, so I see where you're going with this, except this:

            results in the compilation error

            TargetName property cannot be set on a Style Setter.

            I understand what do do, just not how to do it. As I noted in my posting this is working as a UserControl in production. Here I'm trying to put it into a CustomControl library. I'm wondering if that has some effect I'm not seeing. I put it in a repository here[^]

            If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

            L 1 Reply Last reply
            0
            • K Kevin Marois

              [UPDATE] I found this[^] which works fine. Thanks OK, so I see where you're going with this, except this:

              results in the compilation error

              TargetName property cannot be set on a Style Setter.

              I understand what do do, just not how to do it. As I noted in my posting this is working as a UserControl in production. Here I'm trying to put it into a CustomControl library. I'm wondering if that has some effect I'm not seeing. I put it in a repository here[^]

              If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              This gets into the whole philosophy of when to use a custom control, user control and style versus content; which we differ on. From a "logical" and technical point of view your "target" is the RotateTransform. The fact your user control works testifies to the fact they are different (and easier to implement) and / or you got lucky with the XAML parser. (You're effectively creating a "progress ring" which can be found in the Community Toolkit).

              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

              1 Reply Last reply
              0
              • L Lost User

                You give the RotateTransform a "Name"; then reference it in "TargetName" of the StoryBoard. Where in "RenderTransform" (abstract Transform) is there an "Angle" property?

                "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                K Offline
                K Offline
                Kevin Marois
                wrote on last edited by
                #7

                My message dissappeared :confused::confused::confused: Anyhow, I have been slowly developing my own custom control library and I was hoping to port this to it. I guess I'll leave it in a UserControl. I knew about the Community Toolkit, and also, here's a cool implementation with very little code[^] Thanks

                If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups