CommandService and Silverlight 3 Navigation Application

Developer
Aug 10, 2009 at 1:38 PM

Hello,

when i navigate in our Silverlight 3 Application with Navigation Frame, i have the problem with a double registration to CommandService from view (xaml). When i use the Commands on Button comes double values... what i can do for this problem?

best regards,
BFreakout

Developer
Aug 10, 2009 at 3:30 PM

Okay, i write self a solution... the GetCommand Method give a command instance back.. and open instance was kill with remove... this works with Silverlight 3 Navigation.
Command selectedCommand = GetCommand("ProjectListSelectedCommand");
selectedCommand.Executed += SelectedCommandExecuted;

private static Command GetCommand(string key)
{
	Command.CommandCache.Remove(key);

	return new Command(key);
}
best Regards,
BFreakout