PC Review


Reply
Thread Tools Rate Thread

C# Vocabulary

 
 
Gordon Padwick
Guest
Posts: n/a
 
      17th Apr 2009
As a newcomer to C# and WPF I'm having much difficulty understanding
terminology. I come across such terms as "Dependency Property" and need to
know what that term means. The help file in Visual Studio 2008 contains much
information about Dependency Properties, but doesn't tell me what a
dependency property is. Likewise, the several books about C# and WPF I have
contain information about dependency properties, but don't tell me what a
dependency property is.

Can someone give me, in two or three sentences, an explanation of what a
dependeny propery is?

I find it very frustrating that book authors refer to terms without
adequately defining the meaning of those terms. All books should include
definitions of terms, preferably in a glossary or, lacking that, by
including those terms in an index that refers the reader to the place in the
text where the term is defined.

Gordon Padwick

 
Reply With Quote
 
 
 
 
Pavel Minaev
Guest
Posts: n/a
 
      17th Apr 2009
On Apr 16, 7:29*pm, "Gordon Padwick" <gpadw...@earthlink.net> wrote:
> As a newcomer to C# and WPF I'm having much difficulty understanding
> terminology. I come across such terms as "Dependency Property" and need to
> know what that term means. The help file in Visual Studio 2008 contains much
> information about Dependency Properties, but doesn't tell me what a
> dependency property is. Likewise, the several books about C# and WPF I have
> contain information about dependency properties, but don't tell me what a
> dependency property is.
>
> Can someone give me, in two or three sentences, an explanation of what a
> dependeny propery is?


Sure. A dependency property is a property implemented using
DependencyProperty class.

That's really all there is to it. There no specific theory behind it,
that's why there's no "proper" definition.

From this definition follows that dependency properties are strictly a
WPF feature, and have nothing to do with C# specifically.
 
Reply With Quote
 
Chris Nahr
Guest
Posts: n/a
 
      17th Apr 2009
On Thu, 16 Apr 2009 19:29:01 -0700, "Gordon Padwick"
<(E-Mail Removed)> wrote:

>As a newcomer to C# and WPF I'm having much difficulty understanding
>terminology. I come across such terms as "Dependency Property" and need to
>know what that term means. The help file in Visual Studio 2008 contains much
>information about Dependency Properties, but doesn't tell me what a
>dependency property is. Likewise, the several books about C# and WPF I have
>contain information about dependency properties, but don't tell me what a
>dependency property is.


These can't be very good books! Dependency properties are a core WPF
concept, and any decent WPF books should explain them. Try Adam
Nathan, "Windows Presentation Foundation Unleashed", which is very
good despite being published by Sams.

I also recommend that you get a strong footing with C# itself before
moving into WPF -- it's a very complex framework with plenty of its
own higher-level concepts.
--
http://www.kynosarges.de
 
Reply With Quote
 
Gordon Padwick
Guest
Posts: n/a
 
      18th Apr 2009
Thanks for the answer to my question, but what you say really isn't very
helpful. If I asked you what a car is, would you reply that it's anything
provided by an automobile manufacturer? No, I think you would reply by
describing that a car looks like, what its principal components are, and
what it's purpose is.

What I'm looking for is information about what a dependency property is,
what it consists of, and what its purpose is.

In a similar vein, I have problems with the words "attribute" and
"property." Some of what I read seems to treat these two words as synonyms.
In other places, "attribute" seems to refer to any characteristic of an
object, whereas other texts seem to use the word "property" to refer only to
physical aspects of an object, such as its color and size.

I would find it helpful to see some examples of properties that are
dependency properties and other properties that are not dependency
properties.

Thanks for your help.

In a similar vein, I'd like to understand what the words "attribute" and
"property" mean within the context of C# and WPF.
"Pavel Minaev" <(E-Mail Removed)> wrote in message
news:a222d2c2-705b-48a1-97eb-(E-Mail Removed)...
On Apr 16, 7:29 pm, "Gordon Padwick" <gpadw...@earthlink.net> wrote:
> As a newcomer to C# and WPF I'm having much difficulty understanding
> terminology. I come across such terms as "Dependency Property" and need to
> know what that term means. The help file in Visual Studio 2008 contains
> much
> information about Dependency Properties, but doesn't tell me what a
> dependency property is. Likewise, the several books about C# and WPF I
> have
> contain information about dependency properties, but don't tell me what a
> dependency property is.
>
> Can someone give me, in two or three sentences, an explanation of what a
> dependeny propery is?


Sure. A dependency property is a property implemented using
DependencyProperty class.

That's really all there is to it. There no specific theory behind it,
that's why there's no "proper" definition.

From this definition follows that dependency properties are strictly a
WPF feature, and have nothing to do with C# specifically.

 
Reply With Quote
 
Gordon Padwick
Guest
Posts: n/a
 
      18th Apr 2009
I do have Adam Nathans's book and, yes, it does contain information about
dependency properties. But, it doesn't tell me what a dependency property
is. The book's index contains refereneces to "dependency property" but
doesn't refer to the page on which the subject of dependency properties is
introduced.

Books, such as Nathan's, should provide a basic definition ot terms such as
"dependency property."

I strongly protest your comment "despite being published by Sams." In my
judgement, books published by SAMS are amomg the best written and best
edited books available on computer subjects.

Gordon

"Chris Nahr" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Thu, 16 Apr 2009 19:29:01 -0700, "Gordon Padwick"
> <(E-Mail Removed)> wrote:
>
>>As a newcomer to C# and WPF I'm having much difficulty understanding
>>terminology. I come across such terms as "Dependency Property" and need to
>>know what that term means. The help file in Visual Studio 2008 contains
>>much
>>information about Dependency Properties, but doesn't tell me what a
>>dependency property is. Likewise, the several books about C# and WPF I
>>have
>>contain information about dependency properties, but don't tell me what a
>>dependency property is.

>
> These can't be very good books! Dependency properties are a core WPF
> concept, and any decent WPF books should explain them. Try Adam
> Nathan, "Windows Presentation Foundation Unleashed", which is very
> good despite being published by Sams.
>
> I also recommend that you get a strong footing with C# itself before
> moving into WPF -- it's a very complex framework with plenty of its
> own higher-level concepts.
> --
> http://www.kynosarges.de


 
Reply With Quote
 
Pavel Minaev
Guest
Posts: n/a
 
      18th Apr 2009
On Apr 17, 7:56*pm, "Gordon Padwick" <gpadw...@earthlink.net> wrote:
> Thanks for the answer to my question, but what you say really isn't very
> helpful. If I asked you what a car is, would you reply that it's anything
> provided by an automobile manufacturer? No, I think you would reply by
> describing that a car looks like, what its principal components are, and
> what it's purpose is.
>
> What I'm looking for is information about what a dependency property is,
> what it consists of, and what its purpose is.


No, in your original post, you were not. You were asking for a
definition, which is a different thing.

The question of what a dependency property consists of is answered by
the statement that it is implemented via a DependencyProperty pattern
(i.e. it consists of a DependencyProperty object, and normally also
exposed via a plain property in the class itself). Its purpose is to
enable attached properties, property inheritance, and advanced change
notification. All this is described on MSDN in article on dependency
properties, and a search in it will give you more (basically, just
look for "... can only be done if target property is a dependency
property", and you can make the list of what DPs are about).

A concise definition is a very different thing, but I'm not aware of
one for DPs. The best you can get is the one I gave you originally. Of
course it's not very useful, but you don't need to have a definition
to use DPs. You just need to know how to define them, how to use them,
and what they can do.

> In a similar vein, I have problems with the words "attribute" and
> "property." Some of what I read seems to treat these two words as synonyms.
> In other places, "attribute" seems to refer to any characteristic of an
> object, whereas other texts seem to use the word "property" to refer onlyto
> physical aspects of an object, such as its color and size.


There are two distinct definitions of the word "attribute", one in OOD
theory context (and some languages and frameworks that follow that),
another specifically in .NET.

In OOD, "attribute" is typically some named piece of data that applies
to a specific object instance. Attributes represent state, as opposed
to methods, which represent behavior.

In .NET, the same thing is described as "field" or "property",
depending on implementation. On the other hand, "attribute" in .NET
always refers to a class derived from System.Attribute (which
represents custom arbitrary metadata attached to various .NET entities
such as assemblies, types, and members, or to an instance of such a
class. These definitions are common to CLR object model, and not
specific to C# (and most definitely not to WPF).

> I would find it helpful to see some examples of properties that are
> dependency properties and other properties that are not dependency
> properties.


Go to MSDN, find documentation on namespace System.Windows.Controls,
and pick a class at random. Any property for which it says "This is a
dependency property", is, well, a dependency property. Any property
for which it doesn't say that is not a dependency property. E.g.
ContentControl.Content is a dependency property,
FrameworkElement.Parent is not.
 
Reply With Quote
 
Chris Nahr
Guest
Posts: n/a
 
      18th Apr 2009
On Fri, 17 Apr 2009 20:20:57 -0700, "Gordon Padwick"
<(E-Mail Removed)> wrote:

>I do have Adam Nathans's book and, yes, it does contain information about
>dependency properties. But, it doesn't tell me what a dependency property
>is. The book's index contains refereneces to "dependency property" but
>doesn't refer to the page on which the subject of dependency properties is
>introduced.


??? This is patently wrong. The main index entry for "dependency
property" in Nathan's book refers to page 51 where an entire section
on the subject starts, complete with a thorough explanation and
example implementation.

>I strongly protest your comment "despite being published by Sams." In my
>judgement, books published by SAMS are amomg the best written and best
>edited books available on computer subjects.


Nathan's book is certainly excellent, and I heard good things about
other entries in the recent "Unleashed" series as well, but Sams is
rather notorious for its "Teach Yourself <Arbitrarily Complex
Technology> in 24 Hours" trash.
--
http://www.kynosarges.de
 
Reply With Quote
 
Gordon Padwick
Guest
Posts: n/a
 
      18th Apr 2009
Many thanks, Pavel, for taking the time to write the detailed reply. Now,
I'm on my way to a better understanding. Gordon.
"Pavel Minaev" <(E-Mail Removed)> wrote in message
news:630320e3-9208-45f7-9a5b-(E-Mail Removed)...
On Apr 17, 7:56 pm, "Gordon Padwick" <gpadw...@earthlink.net> wrote:
> Thanks for the answer to my question, but what you say really isn't very
> helpful. If I asked you what a car is, would you reply that it's anything
> provided by an automobile manufacturer? No, I think you would reply by
> describing that a car looks like, what its principal components are, and
> what it's purpose is.
>
> What I'm looking for is information about what a dependency property is,
> what it consists of, and what its purpose is.


No, in your original post, you were not. You were asking for a
definition, which is a different thing.

The question of what a dependency property consists of is answered by
the statement that it is implemented via a DependencyProperty pattern
(i.e. it consists of a DependencyProperty object, and normally also
exposed via a plain property in the class itself). Its purpose is to
enable attached properties, property inheritance, and advanced change
notification. All this is described on MSDN in article on dependency
properties, and a search in it will give you more (basically, just
look for "... can only be done if target property is a dependency
property", and you can make the list of what DPs are about).

A concise definition is a very different thing, but I'm not aware of
one for DPs. The best you can get is the one I gave you originally. Of
course it's not very useful, but you don't need to have a definition
to use DPs. You just need to know how to define them, how to use them,
and what they can do.

> In a similar vein, I have problems with the words "attribute" and
> "property." Some of what I read seems to treat these two words as
> synonyms.
> In other places, "attribute" seems to refer to any characteristic of an
> object, whereas other texts seem to use the word "property" to refer only
> to
> physical aspects of an object, such as its color and size.


There are two distinct definitions of the word "attribute", one in OOD
theory context (and some languages and frameworks that follow that),
another specifically in .NET.

In OOD, "attribute" is typically some named piece of data that applies
to a specific object instance. Attributes represent state, as opposed
to methods, which represent behavior.

In .NET, the same thing is described as "field" or "property",
depending on implementation. On the other hand, "attribute" in .NET
always refers to a class derived from System.Attribute (which
represents custom arbitrary metadata attached to various .NET entities
such as assemblies, types, and members, or to an instance of such a
class. These definitions are common to CLR object model, and not
specific to C# (and most definitely not to WPF).

> I would find it helpful to see some examples of properties that are
> dependency properties and other properties that are not dependency
> properties.


Go to MSDN, find documentation on namespace System.Windows.Controls,
and pick a class at random. Any property for which it says "This is a
dependency property", is, well, a dependency property. Any property
for which it doesn't say that is not a dependency property. E.g.
ContentControl.Content is a dependency property,
FrameworkElement.Parent is not.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA vocabulary Tom Microsoft Excel Misc 4 3rd May 2010 06:58 AM
VBA keywords vocabulary HappySenior Microsoft Excel Programming 3 13th Jul 2008 09:50 PM
Array vocabulary Laurent Longre Microsoft Excel Worksheet Functions 4 24th Oct 2007 11:54 PM
Need a vocabulary for describing IE JMH Windows XP Internet Explorer 1 26th Nov 2003 01:51 PM
Vocabulary Wizard cold cast mold Freeware 1 24th Oct 2003 08:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:35 PM.