Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataContext binding error in 11.2.2 #75

Open
Coloryr opened this issue Dec 10, 2024 · 2 comments
Open

DataContext binding error in 11.2.2 #75

Coloryr opened this issue Dec 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Coloryr
Copy link

Coloryr commented Dec 10, 2024

at 11.1.4
image

at 11.2.2
image

@Coloryr
Copy link
Author

Coloryr commented Dec 10, 2024

but in TabControl is work
image

<DataTemplate DataType="dialogmodel:CreateInstanceOtherModel">
    <DockPanel>
        <StackPanel
            HorizontalAlignment="Center"
            DockPanel.Dock="Bottom"
            Orientation="Horizontal">
            <Button
                Width="100"
                Height="35"
                Classes="top"
                Command="{Binding Done}"
                Content="{lang:Localize Button.Confirm}" />
            <Button
                Width="100"
                Height="35"
                Margin="20,0,0,0"
                Classes="top"
                Command="{Binding Cancel}"
                Content="{lang:Localize Button.Cancel}"
                IsVisible="{Binding HaveCancel}" />
        </StackPanel>
        <!--  is no work  -->
        <dialogview:InstanceSettingControl DataContext="{Binding}" />
        <TabControl Margin="0,0,0,10">
            <TabItem>
                <TabItem.Header>
                    <TextBlock FontSize="16" Text="{lang:Localize MainWindow.Text42}" />
                </TabItem.Header>
                <!--  is work  -->
                <dialogview:InstanceSettingControl DataContext="{Binding}" />
            </TabItem>
            <TabItem>
                <TabItem.Header>
                    <TextBlock FontSize="16" Text="{lang:Localize MainWindow.Text23}" />
                </TabItem.Header>
                <Decorator Child="{Binding Control}" />
            </TabItem>
        </TabControl>
    </DockPanel>
</DataTemplate>

@SKProCH SKProCH added the bug Something isn't working label Dec 10, 2024
@SKProCH
Copy link
Member

SKProCH commented Dec 10, 2024

Sounds like an avalonia bug...

Btw, why you are setting DataContext to the current DataContext (DataContext="{Binding}")?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants