-
Notifications
You must be signed in to change notification settings - Fork 814
Updating ResourceDictionary in code behind doesn't fire change notification #4443
Copy link
Copy link
Open
Labels
area-Resourcesfeature proposalNew feature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)react-native-windowsteam-MarkupIssue for the Markup teamIssue for the Markup teamwpf-vs-winui-mismatch
Description
XAML Version: System XAML
Scenario: When doing Hot reload in React Native, some styling needs to change as a response to the user changing app code out from under the app
void SetResources(const xaml::FrameworkElement& fe, const JSValueObject& dict) {
auto rd = ResourceDictionary();
for (auto const& entry : dict) {
const auto& name = entry.first;
const auto& value = entry.second;
auto brush = ColorUtils::SolidColorBrushFrom(value);
rd.Insert(winrt::box_value(winrt::to_hstring(name)), brush);
}
fe.Resources(rd);
}Running through this code the first time correctly sets the value and it renders.
The second time this code runs through, the control does not re-render.
Removing the element from the ResourceDictionary does not fix it either
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Resourcesfeature proposalNew feature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)react-native-windowsteam-MarkupIssue for the Markup teamIssue for the Markup teamwpf-vs-winui-mismatch
Type
Projects
Status
Backlog