Skip to content

Commit 8cf866b

Browse files
committed
Don't turn all static resources dynamic
Make sure users explicitly enable this feature, because otherwise it produces too many false positives and breaks things. Fixes #9 Also see #24
1 parent c9cda65 commit 8cf866b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

samples/HotReloadDemo/Views/AddItemView.axaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
Command="{Binding OkCommand}">
2626
Ok
2727
</Button>
28-
<TextBox x:Name="DescriptionTextBox" AcceptsReturn="true" Text="{Binding Description}" Watermark="{StaticResource AddItemWatermark}"/>
28+
<TextBox x:Name="DescriptionTextBox" AcceptsReturn="true" Text="{Binding Description}" Watermark="{'StaticResource' AddItemWatermark}"/>
2929
</DockPanel>
3030

3131
</UserControl>

src/HotAvalonia/Helpers/AvaloniaControlHelper.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ private static void Attach(object? control, ILogical? logicalParent, AvaloniaObj
230230
/// <returns>The XAML markup with static resources replaced by their dynamic counterparts.</returns>
231231
private static string MakeStaticComponentsDynamic(string xaml)
232232
{
233-
const string staticResourceName = "\"{StaticResource ";
234-
const string dynamicResourceName = "\"{DynamicResource ";
233+
const string StaticResourceName = "\"{'StaticResource' ";
234+
const string DynamicResourceName = "\"{'DynamicResource' ";
235235

236-
return xaml.Replace(staticResourceName, dynamicResourceName);
236+
return xaml.Replace(StaticResourceName, DynamicResourceName);
237237
}
238238
}
239239

0 commit comments

Comments
 (0)