- remove stuff from first ui design

master
Simon G 5 years ago
parent 9d669fc04a
commit 930db02a93
  1. 2
      Mystify/App.axaml.cs
  2. 31
      Mystify/ViewModels/MainWindowViewModel.cs
  3. 18
      Mystify/Views/MainWindow.axaml

@ -64,7 +64,7 @@ namespace Mystify
private void OpenMainWindow() private void OpenMainWindow()
{ {
_mainWindowViewModel?.UpdateChannelsAndControllables(); _mainWindowViewModel?.UpdateChannels();
_mainWindow?.Show(); _mainWindow?.Show();
} }

@ -8,7 +8,6 @@ using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Windows.Input; using System.Windows.Input;
using Avalonia.Controls; using Avalonia.Controls;
using Lib.Audio.Interfaces;
using Lib.Driver; using Lib.Driver;
using Mystify.Views; using Mystify.Views;
using ReactiveUI; using ReactiveUI;
@ -33,27 +32,6 @@ namespace Mystify.ViewModels
} }
public ObservableCollection<ChannelViewModel>? Channels => _mainModel?.Channels?.Select(c => new ChannelViewModel(c, _mainWindow, _mainModel)).ToObservableCollection(); public ObservableCollection<ChannelViewModel>? Channels => _mainModel?.Channels?.Select(c => new ChannelViewModel(c, _mainWindow, _mainModel)).ToObservableCollection();
public List<IControllable>? Controllables => _mainModel?.Controllables;
public ChannelViewModel? SelectedChannel
{
get => _mainModel?.SelectedChannel == null ? null : new ChannelViewModel(_mainModel.SelectedChannel, _mainWindow, _mainModel);
set
{
if (_mainModel != null)
_mainModel.SelectedChannel = value?.Channel;
}
}
public IControllable? SelectedControllable
{
get => _mainModel?.SelectedControllable;
set
{
if (_mainModel != null)
_mainModel.SelectedControllable = value;
}
}
public bool UseMidiView public bool UseMidiView
{ {
@ -80,15 +58,8 @@ namespace Mystify.ViewModels
RaisePropertyChanged(() => SelectedDeviceText); RaisePropertyChanged(() => SelectedDeviceText);
RaisePropertyChanged(() => Channels); RaisePropertyChanged(() => Channels);
RaisePropertyChanged(() => Controllables);
}); });
public ICommand MapControllableCommand => ReactiveCommand.Create(() => _mainModel?.MapControllable()); public void UpdateChannels() => RaisePropertyChanged(() => Channels);
public void UpdateChannelsAndControllables()
{
RaisePropertyChanged(() => Channels);
RaisePropertyChanged(() => Controllables);
}
} }
} }

@ -44,23 +44,5 @@
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
</ItemsControl> </ItemsControl>
<StackPanel Orientation="Horizontal" Margin="10">
<TextBlock Text="Select Channel:" Margin="12"/>
<ComboBox Items="{Binding Channels}"
SelectedItem="{Binding SelectedChannel}"
Margin="5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10">
<TextBlock Text="Select Controllable:" Margin="12"/>
<ComboBox Items="{Binding Controllables}"
SelectedItem="{Binding SelectedControllable}"
Margin="5"/>
</StackPanel>
<Button Margin="15" Content="Map selected Controllable" Command="{Binding MapControllableCommand}"/>
</StackPanel> </StackPanel>
</Window> </Window>

Loading…
Cancel
Save