-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VB wpfdpro snippet emits wrong code #3469
Comments
@ljw1004 Could you provide an example of how it should look? |
In this case it should look like this: Public ReadOnly Property Prop1 As String
Get
Return CType(GetValue(MainWindow.Prop1Property), String)
End Get
End Property
Private Shared ReadOnly Prop1PropertyKey As DependencyPropertyKey =
DependencyProperty.RegisterReadOnly("Prop1",
GetType(String), GetType(MainWindow),
New PropertyMetadata(Nothing))
Public Shared ReadOnly Prop1Property As DependencyProperty =
Prop1PropertyKey.DependencyProperty CHANGES I EXPECT: (1) Change (2) Change (3) Add the necessary |
Some notes:
This is because the current authoring has the literal defined as However, even then, it will just default to Window1 instead of your actual surrounding class, because it wasn't using the
For things like that, I think we should go through and update all of the existing snippets, rather than just updating individuals as they are noticed. |
CLosing out as we are not investing in these legacy snippets. |
Repro:
(1) File>New>VB>Windows>Desktop>WPF application
(2) open up MainPage.xaml.vb and inside the class type
wpfdpro
and press TAB.What I get: there are two errors because it's failing to pick up the name of the enclosing type. It emits
GetValue(.Prop1Property)
without the classname in front of the dot. And it emitsGetType()
because without the classname inside parentheses.Also, stylistically, it should be using NameOf now instead of the string literal
"Prop1"
.The text was updated successfully, but these errors were encountered: