| 69 | } |
| 70 | |
| 71 | void ColorPicker::OnApplyTemplate() |
| 72 | { |
| 73 | ConnectEvents(false); |
| 74 | |
| 75 | #define GET_TEMPLATE_CHILD(NAME) m_ ## NAME = GetTemplateChild(UTIL_STRINGIFY(NAME)).try_as<decltype(m_ ## NAME)>() |
| 76 | |
| 77 | GET_TEMPLATE_CHILD(AlphaChannelSlider); |
| 78 | GET_TEMPLATE_CHILD(AlphaChannelTextBox); |
| 79 | GET_TEMPLATE_CHILD(Channel1Slider); |
| 80 | GET_TEMPLATE_CHILD(Channel1TextBox); |
| 81 | GET_TEMPLATE_CHILD(Channel2Slider); |
| 82 | GET_TEMPLATE_CHILD(Channel2TextBox); |
| 83 | GET_TEMPLATE_CHILD(Channel3Slider); |
| 84 | GET_TEMPLATE_CHILD(Channel3TextBox); |
| 85 | GET_TEMPLATE_CHILD(CheckeredBackground1Border); |
| 86 | GET_TEMPLATE_CHILD(CheckeredBackground2Border); |
| 87 | GET_TEMPLATE_CHILD(CheckeredBackground3Border); |
| 88 | GET_TEMPLATE_CHILD(CheckeredBackground4Border); |
| 89 | GET_TEMPLATE_CHILD(CheckeredBackground5Border); |
| 90 | GET_TEMPLATE_CHILD(CheckeredBackground6Border); |
| 91 | GET_TEMPLATE_CHILD(CheckeredBackground7Border); |
| 92 | GET_TEMPLATE_CHILD(CheckeredBackground8Border); |
| 93 | GET_TEMPLATE_CHILD(CheckeredBackground9Border); |
| 94 | GET_TEMPLATE_CHILD(CheckeredBackground10Border); |
| 95 | GET_TEMPLATE_CHILD(ColorSpectrumControl); |
| 96 | GET_TEMPLATE_CHILD(ColorSpectrumAlphaSlider); |
| 97 | GET_TEMPLATE_CHILD(ColorSpectrumThirdDimensionSlider); |
| 98 | GET_TEMPLATE_CHILD(HexInputTextBox); |
| 99 | GET_TEMPLATE_CHILD(HsvToggleButton); |
| 100 | GET_TEMPLATE_CHILD(RgbToggleButton); |
| 101 | GET_TEMPLATE_CHILD(P1PreviewBorder); |
| 102 | GET_TEMPLATE_CHILD(P2PreviewBorder); |
| 103 | GET_TEMPLATE_CHILD(N1PreviewBorder); |
| 104 | GET_TEMPLATE_CHILD(N2PreviewBorder); |
| 105 | |
| 106 | #undef GET_TEMPLATE_CHILD |
| 107 | |
| 108 | base_type::OnApplyTemplate(); |
| 109 | UpdateVisualState(false); |
| 110 | SetActiveColorRepresentation(txmp::ColorRepresentation::Rgba); |
| 111 | m_IsInitialized = true; |
| 112 | UpdateColorControlValues(); |
| 113 | ConnectEvents(true); |
| 114 | } |
| 115 | |
| 116 | void ColorPicker::ConnectEvents(bool connected) |
| 117 | { |
nothing calls this directly
no outgoing calls
no test coverage detected