Skip to content

Why is this not working ContentPresenter... #17

@nerdkl

Description

@nerdkl

so this is my contentpresenter... inside another contentpresenter with the same mechanic...
first one ist working correctly. why not the second one? i see nothing.

                    <ContentPresenter Grid.Column="1" Grid.Row="1" Margin="10" Content="{Binding Selector}" DataContext="{Binding Selector}">
                        <ContentPresenter.Resources>
                            <DataTemplate DataType="{x:Type vm:MouseSelectorViewModel}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>

                                    <Button Grid.Column="2" Grid.Row="1" Content="Apply" Command="{Binding ApplyCommand}"/>
                                    <Button Grid.Column="3" Grid.Row="1" Content="Cancel" Command="{Binding CancelCommand}"/>
                                </Grid>
                            </DataTemplate>
                            <DataTemplate DataType="{x:Type vm:GameViewModel}">
                                <TextBlock Text="generic selector..."/>
                            </DataTemplate>
                        </ContentPresenter.Resources>
                    </ContentPresenter>


    public SelectorViewModel Selector
    {
        get => selector;
        private set => SetProperty(ref selector, value, nameof(Selector));
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions