You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
we have following pattern in UIButton. In order to retrieve temlateImage/Text, we invoke xamlButton applyTemplate and hope it force load all templated parts. But this pattern is not guaranteed to work until layout happen. Currently UIButton is working but might as well be lucky. We need come up with a solid pattern to make this approach more determinstic.
On the other hand hand, a separate pattern is being used in UITextField, which utilizes onLoadedEvent. But this requires caching value which isn't idea.
(void)_initUIButton {
_xamlButton = rt_dynamic_cast([self xamlElement]);
...
// Force-load the template, and get the TextBlock and Image for use in our proxies.
[_xamlButton applyTemplate];
...
WXCImage* templateImage = rt_dynamic_cast([WXCImage class], [_xamlButton getTemplateChild:@"buttonImage"]);
WXCTextBlock* templateText = rt_dynamic_cast([WXCTextBlock class], [_xamlButton getTemplateChild:@"buttonText"]);
we have following pattern in UIButton. In order to retrieve temlateImage/Text, we invoke xamlButton applyTemplate and hope it force load all templated parts. But this pattern is not guaranteed to work until layout happen. Currently UIButton is working but might as well be lucky. We need come up with a solid pattern to make this approach more determinstic.
On the other hand hand, a separate pattern is being used in UITextField, which utilizes onLoadedEvent. But this requires caching value which isn't idea.
_xamlButton = rt_dynamic_cast([self xamlElement]);
...
// Force-load the template, and get the TextBlock and Image for use in our proxies.
[_xamlButton applyTemplate];
...
WXCImage* templateImage = rt_dynamic_cast([WXCImage class], [_xamlButton getTemplateChild:@"buttonImage"]);
WXCTextBlock* templateText = rt_dynamic_cast([WXCTextBlock class], [_xamlButton getTemplateChild:@"buttonText"]);
...
}