The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))Thank you for the fast respond. Unfortunately we got the same exception. Based on your example I created a new Chart and Model class and created two Chart objects, one at the MainPage and one at the SecondaryPage. But in your example you simply switch between these two pages. We want to open a whole new window (based on SecondaryPage) through the following code:
private async void Button_Click(object sender, RoutedEventArgs e)
So we got a button at the MainPage which executes the code above. The two constructors of the MainPage and SecondaryPage look like the following:
public SecondaryPage() (or MainPage)
{
this.InitializeComponent();
Frame1.Content = chart1.createColumnDiagram();
}
The exception occurs when the Method createColumnDiagram() wants to set the CategoryAxis. It seems like the different properties of a SfChart are exclusively reserved for just one Window but we don't know why it should not be possible to create a diagram in two or more windows.
Maybe we are taking the wrong approach to solve this kind of problem.
Thank you for your help!