Closed gmoudry closed 10 years ago
@gmoudry I don't know, having never used the MVVM Light framework. However, when I get some time, I'll give a try and, if I can get it to work, then I'll shout back with a solution.
Thanks Curtis
In the meantime, I have come up with several hacks to ChromeTabControl. Hope to send you a patch submission next week.
Cheers Jiri
On Mon, Sep 23, 2013 at 10:53 AM, Curtis Schlak notifications@github.comwrote:
@gmoudry https://github.com/gmoudry I don't know, having never used the MVVM Light framework. However, when I get some time, I'll give a try and, if I can get it to work, then I'll shout back with a solution.
— Reply to this email directly or view it on GitHubhttps://github.com/realistschuckle/wpfchrometabs/issues/2#issuecomment-24906159 .
@gmoudry I'm having the same issue. Did you find a solution?
Hi Curtis / Nicolas, both of you contacted me this week with Chrome Tabs questions.
I have reviewed my hack from last year. Last year, I could not figure out how to make binding work, so I used a hack - wrote code instead. Instead of binding, ViewModels for binding are cached in ViewModelLocator.s_hack_pendingOutputViewModels variable (I use MvvmLight framework).
Hope the example below helps - give me a shout if it doesn't. Good luck! Jiri
In Xaml designer of MainWindow I pasted a reference to ChromeTabs control as follows:
<chro:ChromeTabControl Name="tabCtrl" Grid.Row="1">
<chro:ChromeTabControl.Resources>
<DataTemplate DataType="{x:Type vm:OutputViewModel}">
<gui:CtrlOutput />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:AViewModel}">
<gui:CtrlA />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:SViewModel}">
<gui:CtrlS />
</DataTemplate>
</chro:ChromeTabControl.Resources>
<chro:ChromeTabItem Header="Settings"
Background="Orange">
I modified this project for my own use recently, and i uploaded the finished project here. It's fully MVVM compatible and has some nifty new features added, like dragging tabs to and from windows.
Hey, that's great! I'll add a note to the README to point over to your repo, in case folks are looking for that.
Is it possible to use the MVVM Light framework and bind ChromeTabControl.ItemsSource to an ObservableCollection? I cannot get it to work - an exception is thrown - see below. I have zipped up a sample project here to illustrate the issue: https://skydrive.live.com/redir?resid=C5AC331FBA959883!141&authkey=!ALrLg9MbSyPXKQI
Here is my attempted XAML, taken from the zip: