Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bug:Since 2.0.240111.5, I get a compile error with the GetTemplateChild function. #1393

Copy link
Copy link
@takatsuka2022

Description

@takatsuka2022
Issue body actions

Version

2.0.240111.5

Summary

I think GetTemplateChild was a public function, but since 2.0.240111.5 it has been changed to protected, so I cannot access it from outside the class.
Is there a workaround for this?

Reproducible example

.xaml
<ColorPicker x:Name="MemoColorPicker" Grid.Row="0" Grid.Column="1" Margin="20,10,30,0"
 ColorSpectrumShape="Box" IsAlphaSliderVisible="False" IsColorPreviewVisible="False"
 IsColorChannelTextInputVisible="False" IsHexInputVisible="False" IsColorSliderVisible="False"/>


.cpp
auto spectrum = MemoColorPicker().GetTemplateChild(L"ColorSpectrum").try_as<Controls::Primitives::ColorSpectrum>();
if (spectrum != nullptr) {
    auto tool_chip = spectrum.GetTemplateChild(L"ColorNameToolTip").try_as<Controls::ToolTip>();
    if (tool_chip != nullptr) tool_chip.Visibility(Visibility::Collapsed);
}

Expected behavior

No response

Actual behavior

No response

Additional comments

No response

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.