using System.Windows;
namespace DragablzExamples
{
public class MainWindowViewModel
{
public string[] Items { get; set; } = new[] { "Item #1", "Item #2", "Item #3" };
}
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
DataContext = new MainWindowViewModel();
InitializeComponent();
}
}
}
When I try to drag a tab I get the System.Reflection.TargetInvocationException. It works perfectly when I add TabItems to the main container manually but it throws exception when I use binding. what is wrong with this simple view?
I have a .NET 7 WPF project where I defined a view and a view model as below:
MainWindow.xaml
MainWindow.xaml.cs
When I try to drag a tab I get the
System.Reflection.TargetInvocationException
. It works perfectly when I addTabItem
s to the main container manually but it throws exception when I use binding. what is wrong with this simple view?