Reporter | Marcin Wiśnicki (Marcin.Wiśnicki) |
---|---|
Created | May 2, 2014 12:14:05 AM |
Updated | Apr 20, 2018 5:32:18 PM |
Resolved | Apr 20, 2018 5:32:18 PM |
Subsystem | IntelliSense (Code Completion) |
Assignee | Andrew Serebryansky (marcus23) |
Priority | Normal |
State | Can't Reproduce |
Type | Bug |
Fix version | No Fix versions |
Affected versions | 8.2 |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
For example lets say I have dependency property
Now, when I place cursors after
Unfortunately when "Create method..." is selected following code will be generated:
whereas if I type some name, e.g. "OnFooChange" and press Alt+Enter->"Create method" I will get better code:
This time parameter names were obtained from PropertyChangedCallback delegate definition.
I would also like to request that the generated name in the former case should be based on property name (e.g.
public static readonly DependencyProperty FooProperty = DependencyProperty.Register(
"Foo", typeof (bool), typeof (Behaviors), new PropertyMetadata(default(bool)));
Now, when I place cursors after
default(bool)
and type ",
" an intellisense popup will appear and propose to create lambda, delegate or method for propertyChangeCallback
parameter.Unfortunately when "Create method..." is selected following code will be generated:
private static void PropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
throw new NotImplementedException();
}
whereas if I type some name, e.g. "OnFooChange" and press Alt+Enter->"Create method" I will get better code:
private static void OnFooChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
throw new NotImplementedException();
}
This time parameter names were obtained from PropertyChangedCallback delegate definition.
I would also like to request that the generated name in the former case should be based on property name (e.g.
On{Name}Changed
) instead of argument name (PropertyChangedCallback
) since R# is already aware of DependencyProperty pattern. Same thing with coerce callback.