-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocumentViewerControl.cs
More file actions
45 lines (37 loc) · 1.24 KB
/
DocumentViewerControl.cs
File metadata and controls
45 lines (37 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
namespace DocumentViewer.Controls
{
public class DocumentViewerControl : View
{
public static readonly BindableProperty UriProperty =
BindableProperty.Create(nameof(Uri), typeof(string), typeof(DocumentViewerControl), "");
public static readonly BindableProperty PasswordProperty =
BindableProperty.Create(nameof(Password), typeof(string), typeof(DocumentViewerControl), "");
public string Uri
{
get => (string)GetValue(UriProperty);
set => SetValue(UriProperty, value);
}
public string Password
{
get => (string)GetValue(PasswordProperty);
set => SetValue(PasswordProperty, value);
}
public event EventHandler? OpenDocument = delegate { };
public DocumentViewerControl()
{
}
public void Open()
{
OpenDocument?.Invoke(this, EventArgs.Empty);
Handler?.Invoke(nameof(DocumentViewerControl.OpenDocument));
}
public void Open(string uri, string password)
{
if (Uri != uri)
Uri = uri;
if (Password != password)
Password = password;
Open();
}
}
}