I don't see an easy way to do this. I Selected the added item in the view model and then sent a message to the view to get it to call the Begin Edit method, but that didn't cause the card to go into edit mode.
Even though I added an item to the list that was bound to the Items source of the RadCardView, I noticed when I made the below call (from the view code behind), the list of cardViewItems did not contain the newly added object that I added to the source. Not sure why it is not automatically updating the cardviewitems, as the itemsSource is bound to an Observable Collection.
IEnumerable<RadCardViewItem> cardViewItems = cardView.ChildrenOfType<RadCardViewItem>();
I think that when BeginEdit is called, it is not finding the CardViewItem and therefore it does nothing. Not sure how to fix that. Maybe there is a bug in the cardview class.
Here is some of my code:
public InstrumentTopographyControl(){
InitializeComponent();
InstrumentListAddMessage.Register(this, HandleInstrumentListAdd);
}
private void HandleInstrumentListAdd(InstrumentListAddMessage obj)
{
OnCardBeginEdit(null, null);
}
private void OnCardBeginEdit(object sender, MouseButtonEventArgs e)
{
// start editing
cardView.PendingCommands.Add(Telerik.Windows.Controls.RadCardViewCommands.BeginEdit);
cardView.ExecutePendingCommand();
}