Skip to content

Importing Just ComboBox Fails #3049

@adamhewitt627

Description

@adamhewitt627

Bug explanation

I want to pull in a few Material controls, but I'm not ready to let MDIX drive the entire application. While the below approach works for a CheckBox or RadioButton it fails on ComboBox.

ERROR: Exception: Cannot find resource named 'MaterialDesignThemes.Wpf.ComboBoxPopup.

<Application.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />

      <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ComboBox.xaml" />

      <!-- WORKAROUND: Import this as well, problem goes away
      <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToolBar.xaml" />
      -->
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource MaterialDesignComboBox}" />
  </ResourceDictionary>
</Application.Resources>

Version

4.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions