Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:37:57+00:00 2026-06-11T22:37:57+00:00

First I will give you my code and after that I will ask my

  • 0

First I will give you my code and after that I will ask my question.

namespace LinearGradientBrushBinding
{
    public partial class LinearGradBrush : UserControl
    {
        public LinearGradBrush()
        {
            InitializeComponent();
        }

        class LinearGradBrushProp : DependencyObject
        {
            public static DependencyProperty _background;

            static void BackgroundBrush()
            {
                _background = DependencyProperty.Register(
                    "_background", typeof(Brush), typeof(LinearGradBrushProp));
            }

            [Description("CuloareBG"), Category("Z")]
            public Brush Background
            {
                get { return (Brush)GetValue(_background); }
                set { SetValue(_background, value); }
            }
        }
    }
}

As you can see I have an UserControl which has in it a class. My question is why I don’t see in the Property window (right side of UserControl.Xaml) of my control the category Z with a brush in it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:37:58+00:00Added an answer on June 11, 2026 at 10:37 pm

    why I don’t see in the Property window (right side of UserControl.Xaml) of my control the category Z with a brush in it.

    Quite simply because your LinearGradBrush doesn’t contain a property annotated with the category Z.

    Your LinearGradBrush contains a (private) inner class that does have such a property, but there’s no way the property editor can know which instance of this inner class to assign a property value to. (The property editor might not even be able to see this inner class, given that it is private.)

    I recommend that you move this property out of your inner class and get rid of the class. I cannot honestly see a reason why you would need to use an inner class here.

    Also, I’d like to point out that your dependency property isn’t declared correctly. It doesn’t use the correct naming conventions, and I cannot see any call to the BackgroundBrush() method which initialises the dependency property. I would expect the property to be declared as follows (note the name of the field, the fact that it is readonly and that the first parameter of the Register method is the name of the property):

    public static readonly DependencyProperty BackgroundProperty =
        DependencyProperty.Register("Background", typeof(Brush), typeof(LinearGradBrush));
    
    [Description("CuloareBG"), Category("Z")]
    public Brush Background
    {
        get { return (Brush)GetValue(BackgroundProperty); }
        set { SetValue(BackgroundProperty, value); }
    }
    

    I made this change to your code, switched to another XAML page (i.e. not LinearGradBrush.xaml), and added your control to this XAML page as an element <local:LinearGradBrush />. While the text cursor was over this element, the Background property appeared in the Z category of the properties window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will first illustrate my issue with some code: class ExampleClass { private Vector2
I want to define that the first element will be of a specific type,
I have two desktop applications. After closing the first application, the first application will
Give the following code: class A { Boolean b; A easyMethod(A a){ a =
This is easier to explain with some code so I'll give an example first:
We're after an ORM/Domain Modelling tool that will allow us to generate several related
First I will try to explain what I want to do. The app loads
First I will explain what I am trying to do. I am trying to
I have a CSV file. The first row will always contain column headers. Depending
I want to display a UITableView with Multiple Columns. The first column will have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.