ReplaceStringMap change is not reflected
See original GitHub issueDescription
ReplaceStringMap does not change the SVG.
Steps to Reproduce
var dict = new Dictionary<string, string>
{
{ "grey", "red" }
};
var img = new SvgCachedImage
{
Source = "results.svg",
};
img.ReplaceStringMap = dict;
img.ReloadImage();
StackTest.Children.Add( img );
On some SVG that looks like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width='800'
height='400'
xmlns='http://www.w3.org/2000/svg'
version='1.1'
xmlns:xlink='http://www.w3.org/1999/xlink'>
<defs>
<rect id='left-lens' width='30' height='30' x='360' y='185'/>
<rect id='right-lens' width='30' height='30' x='400' y='185'/>
<mask id='mask'>
<rect width='800' height='400' fill='white' />
<use xlink:href='#left-lens'/>
<use xlink:href='#right-lens'/>
</mask>
</defs>
<rect width='800' height='400' fill='white' mask='url(#mask)'/>
<use xlink:href='#left-lens' stroke-width='5' stroke='grey' fill='none'/>
<use xlink:href='#right-lens' stroke-width='5' stroke='grey' fill='none'/>
</svg>
Expected Behavior
The grey stroke should be replace with red.
Actual Behavior
The grey stroke is still shown.
Basic Information
- Version with issue: 2.4.1.823
- Last known good version: I cant seem to find a version where this snippet works.
- Platform: Android
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Xamarin.Forms set Button ImageSource as ffimageloading ...
But it's not working. Moreover I can't make working this syntax. Source="{resource://fullname.svg, Converter={StaticResource ...
Read more >FFImageLoading - Fast & Furious Image Loading changelog
Changes. If both downsampling width / height is set, then height is ignored (better memory cache hit rate). This was eg. iOS package ......
Read more >SVG image is not displaying in android in xamarin.forms
The issue is that background is not changing on Pointer Enter Event. Instead it changes on Pointer Exit. Any help will be appreciated!...
Read more >Excluding some urls for the STREAM conversion
I have the following iRule that converts http to https for external users only as defined on the internal_net However, when the page...
Read more >Xamarin.Forms set Button ImageSource ... - appsloveworld.com
Updated original image resource extension class for Xamarin. OP's class had two issues: Missing ContentProperty attribute which allows to skip "Source" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@daniel-luberda I found the problem in my case. I am using converter as show below
If i define ReplaceStringMap before Source property, it works but other way around like above doesnt work. Please find the repro attached. in the repro change order of source and ReplaceStringMap properties, you will see that it works App1.zip
hey it is strange behavior indeed. I have some svgs ReplaceStringMap works but attached svg doesnt work. it looks like same problem. did you find a solution for this?
I am also doing like
var dict = new Dictionary<string, string> { { “#FFFFFF”, “#2196F3” } };
for example same code works for the below svg