Class CallViewModel
The call bar: the voice call that rings or runs, with answering, declining, hanging up, muting and the loudspeaker, and the caller's video when they send it; it tells about a call for a while after it ends.
Inheritance
CallViewModel
Assembly: Uniform.Chat.Avalonia.dll
public sealed class CallViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging, IDisposable
Constructors
|
Edit this page
View Source
Follow the calls of calls.
Declaration
public CallViewModel(CallService calls, IUiDispatcher ui, GuiPlatform platform, Func<string, string> nameOf, Func<bool>? mayRing = null)
Parameters
| Type |
Name |
Description |
| CallService |
calls |
The account's calls.
|
| IUiDispatcher |
ui |
Dispatcher of the user interface thread.
|
| GuiPlatform |
platform |
The platform's audio, permissions, notifications, ringing and keeping calls alive.
|
| Func<string, string> |
nameOf |
Returns a user's display name.
|
| Func<bool> |
mayRing |
Returns whether incoming calls ring and notify, as the settings choose; null always rings.
|
Properties
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.AnswerAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand AnswerCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.AnswerWithVideoAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand AnswerWithVideoCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("CameraText")]
[ExcludeFromCodeCoverage]
public bool CameraOff { get; set; }
Property Value
|
Edit this page
View Source
CameraText
Text of the camera button.
Declaration
public string CameraText { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool CanAnswerWithVideo { get; set; }
Property Value
|
Edit this page
View Source
Whether the platform has audio, so calls can be made.
Declaration
public bool CanCall { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool CanSwitchCamera { get; set; }
Property Value
|
Edit this page
View Source
Whether this device has a camera, so video calls can be made.
Declaration
public bool CanVideoCall { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("IsVisible")]
[ExcludeFromCodeCoverage]
public VoiceCall? Current { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Error { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ShowsFullScreen", new string[] { "ScreenText" })]
[ExcludeFromCodeCoverage]
public bool FullScreen { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.HangupAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand HangupCommand { get; }
Property Value
|
Edit this page
View Source
Whether the loudspeaker is a choice.
Declaration
public bool HasEarpiece { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ShowsVideo", new string[] { "ShowsFullScreen", "MainVideo", "ShowsCornerPreview" })]
[ExcludeFromCodeCoverage]
public bool HasPreview { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ShowsVideo", new string[] { "ShowsFullScreen", "MainVideo", "ShowsCornerPreview" })]
[ExcludeFromCodeCoverage]
public bool HasVideo { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsActive { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("MuteText")]
[ExcludeFromCodeCoverage]
public bool IsMuted { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsRinging { get; set; }
Property Value
|
Edit this page
View Source
Declaration
public bool IsVisible { get; }
Property Value
|
Edit this page
View Source
This side's camera, small, while it sends.
Declaration
public VideoFeed LocalVideo { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("SpeakerText")]
[ExcludeFromCodeCoverage]
public bool Loudspeaker { get; set; }
Property Value
|
Edit this page
View Source
MainVideo
The video shown large: the other side's, or this side's own camera while the other side sends none.
Declaration
public VideoFeed MainVideo { get; }
Property Value
|
Edit this page
View Source
MuteText
Declaration
public string MuteText { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string PeerName { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.RejectAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand RejectCommand { get; }
Property Value
|
Edit this page
View Source
The other user's video, while the call runs.
Declaration
public VideoFeed RemoteVideo { get; }
Property Value
|
Edit this page
View Source
ScreenText
Text of the button that switches between the full video and the chat.
Declaration
public string ScreenText { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool SendsVideo { get; set; }
Property Value
|
Edit this page
View Source
Whether this side's camera shows small in the corner, over the other side's video.
Declaration
public bool ShowsCornerPreview { get; }
Property Value
|
Edit this page
View Source
Whether the call fills the screen: video shown, either side's, and wanted so; only the other side's video asks for it by itself.
Declaration
public bool ShowsFullScreen { get; }
Property Value
|
Edit this page
View Source
Whether the call has video to show, the other side's or this side's own camera, as when only this side sends; the switch between video and chat shows then.
Declaration
public bool ShowsVideo { get; }
Property Value
|
Edit this page
View Source
SpeakerText
Text of the speaker button.
Declaration
public string SpeakerText { get; }
Property Value
|
Edit this page
View Source
StateText
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string StateText { get; set; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.SwitchCamera().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand SwitchCameraCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.ToggleCamera().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand ToggleCameraCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.ToggleMute().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand ToggleMuteCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.ToggleScreen().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand ToggleScreenCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.CallViewModel.ToggleSpeakerAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ToggleSpeakerCommand { get; }
Property Value
Methods
|
Edit this page
View Source
Stop following the calls.
Declaration
|
Edit this page
View Source
Call the other member of a direct room, asking for the microphone first where needed.
Declaration
public Task PlaceCallAsync(string roomId, bool video = false)
Parameters
Returns
Implements