Hi Jason -
These are the steps I used to get the SimpleDomEditorWpf working with the external Metro theme lib:
- Nuget or build Mahapps.Metro and add to the sample project.
- Add ATF's AppearanceService to the MEF type catalog
- Override the App::OnCompositionComplete() and add the following:
var appearanceService = Container.GetExportedValueOrDefault<AppearanceService>();
{
var uri = new Uri("SimpleDomEditorWpf;Component/Metro/Metro.xaml", UriKind.RelativeOrAbsolute);
appearanceService.RegisterSkin(new ReferencedAssemblySkin("Metro", uri));
}
- Create and add a ResourceDictionary to SimpleDomEditorWpf/Metro called Metro.xaml containing the Metro styles you want:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
<ResourceDictionary Source="pack://application:,,,/SimpleDomEditorWpf;component/Metro/MetroAtf.xaml" />
<ResourceDictionary Source="pack://application:,,,/SimpleDomEditorWpf;component/Metro/Brushes.xaml" />
<ResourceDictionary Source="pack://application:,,,/SimpleDomEditorWpf;component/Metro/Docking.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/SimpleDomEditorWpf;component/Metro/PropertyEditor.xaml" />
<ResourceDictionary Source="pack://application:,,,/SimpleDomEditorWpf;component/Metro/Icons.xaml" />-->
</ResourceDictionary.MergedDictionaries>
The additional styles for ATF specific controls can be added in the MetroAtf.xaml which is contained in the attachment.
- Finally, you'll need to create a MainWindow which is derived from MetroWindow. This class also needs to import the toolbar, menu bar and status bar viewmodels in the same way that ATF does. There is a basic version also contained in the attachment. Note: You'll also need to replace the MainWindow in the typecatalog to use this new MainWindow.
Note: I've noticed that the latest Metro theme lib uses a different version of System.Windows.Interactivity than ATF. I worked around this by replacing the version in ATF/ThirdParty (and the version reference in Atf.Gui.Wpf.csproj), but it's not ideal and we probably need to sort this out.
Regards,
Des