Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1812 XAML Add new event handler failes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

HBTeun
Senior Member

33 Posts

Posted - Feb 22 2010 :  04:48:34 AM  Show Profile  Reply with Quote
When I want to add a event handler to a control in XAML (in the WPF/Silverlight editor). The first time the list box opens I get the option to create a new event handler, but it only enters the following string between quotes: "operator<New Event Handler>" and does not add the event handler to code behind. The second time that option is not shown only the already existing event handlers in the code behind are shown.

When I disable VAX it works as it should be.

I use version 1812 in VS2010 RC.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 24 2010 :  3:49:20 PM  Show Profile  Reply with Quote
I am seeing the same effect here:

case=40179

I was able to reproduce this via using a button:

1. Placed a button on the "form" or whatever it is called so I got button1
2. I wrote button1.Click +=
and got this with Visual Assist disabled

            button1.Click += new RoutedEventHandler(button1_Click);

and a new function

        void button1_Click(object sender, RoutedEventArgs e)
        {
            throw new NotImplementedException();
        }

With Visual Assist enabled I got

            button1.Click += new button1.Click

This is a good start. But can you please explain what handler did you use? (by step-by-step please, since I am not a WPF expert )
I will add your steps to the bug report as an additional test case, just for sure.

Edited by - accord on Feb 24 2010 3:58:32 PM
Go to Top of Page

HBTeun
Senior Member

33 Posts

Posted - Feb 24 2010 :  5:05:23 PM  Show Profile  Reply with Quote
Place a button inside the Grid:
<Grid x:Name="LayoutRoot" Background="White">
<Button />
</Grid>

Add a Click event: (with VAX On)
<Grid x:Name="LayoutRoot" Background="White">
<Button Click="operator<New Event Handler>" />
</Grid>
In the listbox the following option is displayed:
operator<New Event Handler>


(With VAX disabled)
<Grid x:Name="LayoutRoot" Background="White">
<Button Click="Button_Click" />
</Grid>
and in code-behind an event handler is created.

Listbox with VAX Disabled:


Listbox with VAX Enabled: (had to press ctrl)



BTW, had not discovered it also happen in code-behind. :)
So both use cases work to display the error.

Also if there is already a handler in the code-behind it is listed in the listbox and you can use it as the handler (this is correct behavior). But the option to create a new handler still goes wrong.

Edited by - HBTeun on Feb 24 2010 5:30:59 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 28 2010 :  7:46:54 PM  Show Profile  Reply with Quote
I have put in a separate bug report for this:

case=40335

and mentioned the original one. Now, I tried this in the XAML file and I was seeing a similar problem there.
Thank you for the clear description
Go to Top of Page

HBTeun
Senior Member

33 Posts

Posted - Mar 11 2010 :  09:25:30 AM  Show Profile  Reply with Quote
I noticed the same happening when adding new namespaces in the XAML file.

To reproduce:
1. Start new silverlight project and name it for example "Test".
2. In the mainpage XAML file and type the following:

xmlns:local=

3. At this point a dropdown listbox is opened with the possible namespaces. Choose "Test (Test)" and press Tab.
The following line is produced:

xmlns:local="Test (Test)"

It should be:

xmlns:local="clr-namespace:Test"

Pressing enter does insert the correct string.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Mar 11 2010 :  4:30:28 PM  Show Profile  Reply with Quote
I may write this to an incorrect place, but got this:

Go to Top of Page

HBTeun
Senior Member

33 Posts

Posted - Mar 12 2010 :  07:34:49 AM  Show Profile  Reply with Quote
quote:
Originally posted by accord

I may write this to an incorrect place, but got this:





It's the correct place. Go on with step 3 but instead of "Test (Test)" use in your case "WpfApplication2 (WpfApplication2)"
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Mar 12 2010 :  7:14:15 PM  Show Profile  Reply with Quote
*ah* That's why you recommended the name "Test" for the project Sorry.
Now, I am seeing the same effect here:

case=40890

Thank you for the clear description.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Apr 10 2010 :  9:25:57 PM  Show Profile  Reply with Quote
case=40890 is fixed in build 1819

Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000