summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/AppLinkEntry.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/AppLinkEntry.cs')
-rw-r--r--Xamarin.Forms.Core/AppLinkEntry.cs62
1 files changed, 62 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/AppLinkEntry.cs b/Xamarin.Forms.Core/AppLinkEntry.cs
new file mode 100644
index 00000000..6942aa10
--- /dev/null
+++ b/Xamarin.Forms.Core/AppLinkEntry.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+
+namespace Xamarin.Forms
+{
+ public class AppLinkEntry : Element, IAppLinkEntry
+ {
+ public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(AppLinkEntry), default(string));
+
+ public static readonly BindableProperty DescriptionProperty = BindableProperty.Create(nameof(Description), typeof(string), typeof(AppLinkEntry), default(string));
+
+ public static readonly BindableProperty ThumbnailProperty = BindableProperty.Create(nameof(Thumbnail), typeof(ImageSource), typeof(AppLinkEntry), default(ImageSource));
+
+ public static readonly BindableProperty AppLinkUriProperty = BindableProperty.Create(nameof(AppLinkUri), typeof(Uri), typeof(AppLinkEntry), null);
+
+ public static readonly BindableProperty IsLinkActiveProperty = BindableProperty.Create(nameof(IsLinkActive), typeof(bool), typeof(AppLinkEntry), false);
+
+ public Uri AppLinkUri
+ {
+ get { return (Uri)GetValue(AppLinkUriProperty); }
+ set { SetValue(AppLinkUriProperty, value); }
+ }
+
+ public string Description
+ {
+ get { return (string)GetValue(DescriptionProperty); }
+ set { SetValue(DescriptionProperty, value); }
+ }
+
+ public bool IsLinkActive
+ {
+ get { return (bool)GetValue(IsLinkActiveProperty); }
+ set { SetValue(IsLinkActiveProperty, value); }
+ }
+
+ public IDictionary<string, string> KeyValues => new Dictionary<string, string>();
+
+ public ImageSource Thumbnail
+ {
+ get { return (ImageSource)GetValue(ThumbnailProperty); }
+ set { SetValue(ThumbnailProperty, value); }
+ }
+
+ public string Title
+ {
+ get { return (string)GetValue(TitleProperty); }
+ set { SetValue(TitleProperty, value); }
+ }
+
+ public static AppLinkEntry FromUri(Uri uri)
+ {
+ var appEntry = new AppLinkEntry();
+ appEntry.AppLinkUri = uri;
+ return appEntry;
+ }
+
+ public override string ToString()
+ {
+ return AppLinkUri.ToString();
+ }
+ }
+} \ No newline at end of file