Error when closing tab item

Topics: Actions & Coroutines
Oct 12, 2011 at 9:00 PM

Hi,

I'm stepping through the SimpleMDI sample in the documentation, and am trying to recreate the sample using Silverlight instead of WPF.

I'm able to create multiple items in a Listbox (instead of a TabControl).  So, that part is working fine.  However, when I click the 'x' to close a tab item, I get an unhandled exception  with the error 'No target found for method CloseItem()'

Any ideas how to troubleshoot this?

Thanks.

 

 

Oct 12, 2011 at 9:17 PM
Edited Oct 12, 2011 at 9:24 PM

Part of the problem is that I wasn't sure how to create a 'horizontal listbox'.  Here is the ShellView I'm using:

<UserControl x:Class="CaliburnTest.ShellView"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"           
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:tc="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
             xmlns:cal="http://www.caliburnproject.org">
    <tc:DockPanel>
        <Button x:Name="OpenTab"
                Content="Open Tab" 
                tc:DockPanel.Dock="Top" />
        <ListBox x:Name="Items">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding DisplayName}" />
                        <Button Content="X"
                                cal:Message.Attach="CloseItem($dataContext)" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Top"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
    </tc:DockPanel>

</UserControl>
Jan 19, 2012 at 10:20 PM

I also have the same problem, Is there a solution to this?

Coordinator
Jan 20, 2012 at 3:11 AM

Please create a ticket and attach your sample with instructions to reproduce ASAP. I'm doing a release tomorrow (Friday). So, if there is a bug, I'd like to try to fix it if I can.

Jan 20, 2012 at 9:22 PM

Just re-got the v1.2 RTW release and the SimpleMDI project is working correctly, 

Thanks

Chris