Hi,
Want to know how can i implement EditCommand in Silverlight. My node is using a template that a ListBox. The ItemsSource has been bound to Data.Members Property. Here is the snippet:
<Border BorderThickness="1" BorderBrush="Green" Padding="0,0,0,0" CornerRadius="4" Background="{Binding Path=Part.IsDropOntoAccepted, Converter={StaticResource theBooleanBrushConverter}}" go:Part.DropOntoBehavior="AddsLinkFromNode" go:Part.SelectionAdorned="True" MinWidth="100" MouseLeftButtonDown="Node_MouseLeftButtonDown" go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions> <RowDefinition MinHeight="22" Height="auto" /> <RowDefinition MinHeight="60" Height="auto" /> </Grid.RowDefinitions> <Border Grid.Row="0" Background="{Binding Path=Data.NodeBackground}" BorderThickness="0.5" BorderBrush="LightGreen" CornerRadius="4,4,0,0"><TextBlock Text="{Binding Path=Data.Title, Mode=TwoWay}" FontWeight="Bold" go:Part.TextEditable="True" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontFamily="Arial" />
</Border>
<ListBox Grid.Row="1" Background="Transparent" VerticalAlignment="Stretch" BorderThickness="0" ItemsSource="{Binding Data.Members}">
<ListBox.ItemTemplate>
<DataTemplate><Grid Margin="5,0,4,5" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.345*"/> <ColumnDefinition Width="0.655*"/> </Grid.ColumnDefinitions> <TextBlock Text="Name: " VerticalAlignment="Center" /> <TextBlock Grid.Column="1" TextWrapping="Wrap" Text="{Binding Name, Mode=TwoWay}" go:Part.TextEditable="True" VerticalAlignment="Center" Margin="5,0,0,0" /> <TextBlock Grid.Row="1" Text="Contact No.:" VerticalAlignment="Center" /> <TextBlock Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Text="{Binding ContactNo, Mode=TwoWay}" go:Part.TextEditable="True" VerticalAlignment="Center" Margin="5,0,0,0" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox></Grid>
</Border>Now when I click on text inside list Item, it is uneditable. what do I have to do to make it editable. And secondly I want to fire Delete Node command explicitly eg. On Rightclick or on a button click the selected node should get deleted.