123 lines
3.2 KiB
C#
123 lines
3.2 KiB
C#
using Demo.Common.Helpers;
|
||
using Prism.Mvvm;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Drawing;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
using System.Windows;
|
||
|
||
namespace Demo.Common.Models
|
||
{
|
||
public class User : BindableBase
|
||
{
|
||
private long id;
|
||
public long Id
|
||
{
|
||
get { return id; }
|
||
set { SetProperty(ref id, value); }
|
||
}
|
||
|
||
private string userName;
|
||
public string UserName
|
||
{
|
||
get { return userName; }
|
||
set
|
||
{
|
||
SetProperty(ref userName, value);
|
||
}
|
||
}
|
||
|
||
///// <summary>
|
||
///// 用户头像
|
||
///// </summary>
|
||
//public Bitmap Avatar => AvatatHelper.GetNickNameImage(userName);
|
||
|
||
private bool isManager;
|
||
public bool IsManager
|
||
{
|
||
get { return isManager; }
|
||
set { SetProperty(ref isManager, value); }
|
||
}
|
||
|
||
|
||
private bool isLocal;
|
||
public bool IsLocal
|
||
{
|
||
get { return isLocal; }
|
||
set { SetProperty(ref isLocal, value); }
|
||
}
|
||
|
||
private bool isMuteAudio;
|
||
public bool IsMuteAudio
|
||
{
|
||
get { return isMuteAudio; }
|
||
set
|
||
{
|
||
SetProperty(ref isMuteAudio, value);
|
||
RaisePropertyChanged(nameof(MicoSlashLineVisibility));
|
||
RaisePropertyChanged(nameof(MicStatusText));
|
||
if (value)
|
||
{
|
||
// 静音,音量置为0
|
||
MicoVolume = 0;
|
||
}
|
||
}
|
||
}
|
||
|
||
private bool isMuteVideo;
|
||
public bool IsMuteVideo
|
||
{
|
||
get { return isMuteVideo; }
|
||
set
|
||
{
|
||
SetProperty(ref isMuteVideo, value);
|
||
RaisePropertyChanged(nameof(VideoSlashLineVisibility));
|
||
RaisePropertyChanged(nameof(VideoStatusText));
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 麦克风音量
|
||
/// </summary>
|
||
private uint micoVolume;
|
||
public uint MicoVolume
|
||
{
|
||
get { return micoVolume; }
|
||
set { SetProperty(ref micoVolume, value); }
|
||
}
|
||
|
||
// 用于控制斜线显示的属性
|
||
public Visibility MicoSlashLineVisibility => (IsMuteAudio ? Visibility.Visible : Visibility.Collapsed);
|
||
// 用于控制斜线显示的属性
|
||
public Visibility VideoSlashLineVisibility => (IsMuteVideo ? Visibility.Visible : Visibility.Collapsed);
|
||
|
||
//用于控制麦克风文本显示的属性
|
||
public string MicStatusText => (IsMuteAudio ? "解除静音" : "静音");
|
||
|
||
//用于控制摄像头文本显示的属性
|
||
public string VideoStatusText => (IsMuteVideo ? "开启视频" : "停止视频");
|
||
|
||
|
||
|
||
public static User GetInit()
|
||
{
|
||
return new User
|
||
{
|
||
Id = 0,
|
||
UserName = "待初始化"
|
||
};
|
||
}
|
||
|
||
//void IDisposable.Dispose()
|
||
//{
|
||
// if (Avatar != null)
|
||
// {
|
||
// Avatar.Dispose();
|
||
// }
|
||
//}
|
||
}
|
||
}
|