locked
Roncas RRS feed

  • Question

  • CA0001 Error Running Code Analysis CA0001 : Rule=Microsoft.Reliability#CA2002, Target=newponsDesign.CouponPage.#loadInnerBorders() : The following error was encountered while reading module 'newponsDesign': Could not resolve member reference: [Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null]Windows.UI.Xaml.Controls.Border::put_CornerRadius. [Errors and Warnings] (Global)

     have this

            public struct CornerRadius
            {
                public Double cornerradius { get; set; }
            }

    I need something like this1

    public CornerRadius (double topLeft, double topRight, double bottomRight, double bottomLeft);

    Don't know how to do it.

    Wednesday, November 25, 2020 8:30 PM

All replies

  • Hi Roncas,

    Thank you for posting here.

    Every struct implicitly has a parameterless instance constructor which always returns the value that results from setting all value type fields to their default value and all reference type fields to null.

    If you customize a parameterized constructor, then you need to manually assign values ​​to these fields, or you can call the parameterless constructor from this constructor.

            public CornerRadius(double topLeft, double topRight, double bottomRight, double bottomLeft)
            {
                cornerradius = 10;
            }

    Or

            public CornerRadius(double topLeft, double topRight, double bottomRight, double bottomLeft):this()
            {
            }

    Hope this could be helpful.

    Best Regards,

    Timon


    "Visual C#" forum will be migrating to a new home on Microsoft Q&A ! We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A ! For more information, please refer to the sticky post.

    Thursday, November 26, 2020 6:25 AM
  • Hi,

    Has your issue been resolved?

    If so, please click on the "Mark as answer" option of the reply that solved your question, so that it will help other members to find the solution quickly if they face a similar issue. If you still have questions, please feel free to ask.

    Best Regards,

    Timon


    "Visual C#" forum will be migrating to a new home on Microsoft Q&A ! We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A ! For more information, please refer to the sticky post.

    Monday, November 30, 2020 8:55 AM