|
|
|
|
@ -0,0 +1,34 @@ |
|
|
|
|
// Author: Gockner, Simon |
|
|
|
|
// Created: 2021-04-14 |
|
|
|
|
// Copyright(c) 2021 SimonG. All Rights Reserved. |
|
|
|
|
|
|
|
|
|
using System.Windows.Input; |
|
|
|
|
using Lib.Audio.Interfaces; |
|
|
|
|
using ReactiveUI; |
|
|
|
|
|
|
|
|
|
namespace Mystify.ViewModels |
|
|
|
|
{ |
|
|
|
|
public class ChannelViewModel : ViewModelBase |
|
|
|
|
{ |
|
|
|
|
private readonly IChannel _channel; |
|
|
|
|
|
|
|
|
|
public ChannelViewModel(IChannel channel) => _channel = channel; |
|
|
|
|
|
|
|
|
|
public IControllable? Controllable |
|
|
|
|
{ |
|
|
|
|
get => _channel.Controllable; |
|
|
|
|
set |
|
|
|
|
{ |
|
|
|
|
if (value != null) |
|
|
|
|
_channel.MapControllable(value); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsControllableMapped => Controllable != null; |
|
|
|
|
public bool IsPopupOpen { get; private set; } |
|
|
|
|
|
|
|
|
|
public ICommand SelectControllableCommand => ReactiveCommand.Create(SelectControllable); |
|
|
|
|
|
|
|
|
|
private void SelectControllable() => IsPopupOpen = true; |
|
|
|
|
} |
|
|
|
|
} |