Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ImageViewModel.cs
1
using
CommunityToolkit.Mvvm.ComponentModel;
2
using
NeuroAccessMaui.Services.UI.Photos
;
3
using
NeuroAccessMaui.UI.Pages
;
4
using
System.Collections.ObjectModel;
5
using
Waher.Networking.XMPP.Contracts
;
6
7
namespace
NeuroAccessMaui.UI.Popups.Photos.Image
8
{
12
public
partial class
ImageViewModel
:
BaseViewModel
13
{
14
private
readonly PhotosLoader photosLoader;
15
19
public
ImageViewModel
()
20
{
21
this.Photos = [];
22
this.photosLoader =
new
PhotosLoader(this.
Photos
);
23
}
24
28
public
ObservableCollection<Photo>
Photos
{
get
; }
29
33
[ObservableProperty]
34
private
bool
isSwipeEnabled;
35
40
public
void
LoadPhotos
(
Attachment
[] attachments)
41
{
42
this.photosLoader.CancelLoadPhotos();
43
this.IsSwipeEnabled =
false
;
44
45
_ = this.photosLoader.LoadPhotos(attachments,
SignWith
.LatestApprovedIdOrCurrentKeys, () =>
46
{
47
MainThread.BeginInvokeOnMainThread(() => this.IsSwipeEnabled = this.Photos.Count > 1);
48
});
49
}
50
54
public
void
ClearPhotos
()
55
{
56
this.photosLoader.CancelLoadPhotos();
57
}
58
}
59
}
NeuroAccessMaui.UI.Pages.BaseViewModel
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...
Definition:
BaseViewModel.cs:17
NeuroAccessMaui.UI.Popups.Photos.Image.ImageViewModel
The class to use as binding context for displaying images.
Definition:
ImageViewModel.cs:13
NeuroAccessMaui.UI.Popups.Photos.Image.ImageViewModel.LoadPhotos
void LoadPhotos(Attachment[] attachments)
Loads the attachments photos, if there are any.
Definition:
ImageViewModel.cs:40
NeuroAccessMaui.UI.Popups.Photos.Image.ImageViewModel.ImageViewModel
ImageViewModel()
Creates a new instance of the ImageViewModel class.
Definition:
ImageViewModel.cs:19
NeuroAccessMaui.UI.Popups.Photos.Image.ImageViewModel.Photos
ObservableCollection< Photo > Photos
Holds the list of photos to display.
Definition:
ImageViewModel.cs:28
NeuroAccessMaui.UI.Popups.Photos.Image.ImageViewModel.ClearPhotos
void ClearPhotos()
Clears the currently displayed photos.
Definition:
ImageViewModel.cs:54
Waher.Networking.XMPP.Contracts.Attachment
Contains a reference to an attachment assigned to a legal object.
Definition:
Attachment.cs:9
NeuroAccessMaui.Services.UI.Photos
Definition:
Photo.cs:2
NeuroAccessMaui.UI.Pages
Definition:
ApplicationsPage.xaml.cs:2
NeuroAccessMaui.UI.Popups.Photos.Image
Definition:
ImageView.xaml.cs:5
Waher.Networking.XMPP.Contracts
Definition:
Attachment.cs:4
Waher.Networking.XMPP.Contracts.SignWith
SignWith
Options on what keys to use when signing data.
Definition:
Enumerations.cs:84
NeuroAccessMaui
NeuroAccessMaui
UI
Popups
Photos
Image
ImageViewModel.cs
Generated by
1.9.5