-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFullScreenImageViewController.cs
73 lines (59 loc) · 1.94 KB
/
FullScreenImageViewController.cs
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Developed by Softeq Development Corporation
// http://www.softeq.com
using ObjCRuntime;
using Softeq.XToolkit.Bindings.iOS.Gestures;
using Softeq.XToolkit.WhiteLabel.Essentials.FullScreenImage;
using Softeq.XToolkit.WhiteLabel.iOS;
using Softeq.XToolkit.WhiteLabel.iOS.Interfaces;
using UIKit;
namespace Softeq.XToolkit.WhiteLabel.Essentials.iOS.FullScreenImage
{
public partial class FullScreenImageViewController : ViewControllerBase<FullScreenImageViewModel>
{
public FullScreenImageViewController(NativeHandle handle)
: base(handle)
{
}
private bool StatusBarHidden
{
set
{
var keyWindow = UIApplication.SharedApplication.KeyWindow;
if (keyWindow != null)
{
keyWindow.WindowLevel = value
? UIWindowLevel.StatusBar
: UIWindowLevel.Normal;
}
}
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
InitView();
LoadImage();
}
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
StatusBarHidden = true;
}
protected override void ViewWillReallyDisappear(bool animated)
{
base.ViewWillReallyDisappear(animated);
StatusBarHidden = false;
}
private void InitView()
{
View!.Swipe(UISwipeGestureRecognizerDirection.Down).SetCommand(ViewModel.DialogComponent.CloseCommand);
}
private void LoadImage()
{
var imageService = Dependencies.Container.Resolve<IIosImageService>();
var url = string.IsNullOrEmpty(ViewModel.ImagePath)
? ViewModel.ImageUrl
: ViewModel.ImagePath;
imageService.LoadImage(url!, ImageView);
}
}
}