ich von Stunden/Tagen versucht, eine Datei zu erhalten, die in den PCL-Teil platziert wirdXamarin Forms - Get Pfad eingebettete Datei
ich einige Beispiele gesehen, die BaseURL
mit, aber ich möchte mache etwas Cross Plattform und ich kann nicht finden, wie man es auf UWP implementiert.
Also ich versuche, die URL meiner lokalen Datei zu bekommen. Für Bilder verwende ich ImageSource.FromResource("Gif.example.gif")
, aber es funktioniert nicht ..
Ich versuchte auch GifSource = new Uri(ImageSource.FromResource("Gif.example.gif").ToString());
aber .. Nichts!
Es ist meine individuelle Kontrolle:
public class Gif : WebView
{
public static readonly BindableProperty GifSourceProperty =
BindableProperty.Create(nameof(Uri), typeof(string), typeof(Gif), null);
public string GifSource
{
get { return (string)GetValue(GifSourceProperty); }
set { SetValue(GifSourceProperty, value); }
}
Action<string> action;
public void RegisterAction(Action<string> callback)
{
action = callback;
}
public void Cleanup()
{
action = null;
}
public void InvokeAction(string data)
{
if (action == null || data == null)
{
return;
}
action.Invoke(data);
}
}
Dank für die Hilfe!