MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

MaterialDataGridComboBoxColumn display nothing

Open jebissey opened this issue 1 year ago • 2 comments

Bug explanation

A very little program created with code from MaterialDesignToolKit shows no combobox 2023-06-01_11h26_53 MaterialDesignPoc.zip

Version

4.9

jebissey avatar Jun 01 '23 09:06 jebissey

Thanks to https://thomaslevesque.fr/2011/03/21/wpf-comment-faire-un-binding-dans-les-cas-o-on-nhrite-pas-du-datacontext/ 2023-06-01_13h33_44 MaterialDesignPoc.zip

I added BindingProxy class. A nearly equivalent class seems to exist in MaterialDesign. I wonder what is missing in the first program.

jebissey avatar Jun 01 '23 11:06 jebissey

@jebissey I took a look at your first program, and I was able to fix the issue by moving the code below out of MainWindowView.xaml and into App.xaml instead:

<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <materialDesign:CustomColorTheme BaseTheme="Light" PrimaryColor="ForestGreen" SecondaryColor="DarkGreen" />
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.DataGrid.xaml" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

I think @Keboo looked into a similar issue at some point, but I don't recall if he came to a conclusion as to why it does not work "at the window level".

nicolaihenriksen avatar Oct 27 '23 19:10 nicolaihenriksen