UI - Fix build warnings

UI - Add remote controller
This commit is contained in:
Robert committed 2022-08-20 13:42:45 +02:00
1 parent 1779629bc6
commit a2a063c136
19 files changed
+687 -102

No files matched your search

@@ -15,14 +15,10 @@ public class DebugViewModel : ActivatableViewModelBase, IScreen
{
private ViewModelBase _selectedItem;
public DebugViewModel(IDebugService debugService,
RenderDebugViewModel render,
DataModelDebugViewModel dataModel,
PerformanceDebugViewModel performance,
LogsDebugViewModel logs)
public DebugViewModel(IDebugService debugService, RenderDebugViewModel render, DataModelDebugViewModel dataModel, PerformanceDebugViewModel performance, LogsDebugViewModel logs)
{
Items = new ObservableCollection<ViewModelBase> {render, dataModel, performance, logs};
SelectedItem = render;
_selectedItem = render;
this.WhenActivated(d => Disposable.Create(debugService.ClearDebugger).DisposeWith(d));
}
@@ -28,7 +28,7 @@ public abstract class TimelineSegmentViewModel : ActivatableViewModelBase
private ObservableAsPropertyHelper<bool>? _showAddEnd;
private ObservableAsPropertyHelper<bool>? _showAddMain;
private ObservableAsPropertyHelper<bool>? _showAddStart;
private ReactiveCommand<Unit, Unit> _removeSegment;
private ReactiveCommand<Unit, Unit>? _removeSegment;
protected TimelineSegmentViewModel(IProfileEditorService profileEditorService, IWindowService windowService)
{
@@ -102,7 +102,7 @@ public abstract class TimelineSegmentViewModel : ActivatableViewModelBase
public ReactiveCommand<Unit, Unit> EditTime { get; }
public ReactiveCommand<Unit, Unit> RemoveSegment
public ReactiveCommand<Unit, Unit>? RemoveSegment
{
get => _removeSegment;
set => RaiseAndSetIfChanged(ref _removeSegment, value);
@@ -27,11 +27,11 @@ public class ProfileEditorViewModel : MainScreenViewModel
private ObservableAsPropertyHelper<ProfileEditorHistory?>? _history;
private ObservableAsPropertyHelper<ProfileConfiguration?>? _profileConfiguration;
private ObservableAsPropertyHelper<bool>? _suspendedEditing;
private StatusBarViewModel _statusBarViewModel;
private DisplayConditionScriptViewModel _displayConditionScriptViewModel;
private PropertiesViewModel _propertiesViewModel;
private ProfileTreeViewModel _profileTreeViewModel;
private VisualEditorViewModel _visualEditorViewModel;
private StatusBarViewModel? _statusBarViewModel;
private DisplayConditionScriptViewModel? _displayConditionScriptViewModel;
private PropertiesViewModel? _propertiesViewModel;
private ProfileTreeViewModel? _profileTreeViewModel;
private VisualEditorViewModel? _visualEditorViewModel;
/// <inheritdoc />
public ProfileEditorViewModel(IScreen hostScreen,
@@ -79,31 +79,31 @@ public class ProfileEditorViewModel : MainScreenViewModel
ToggleAutoSuspend = ReactiveCommand.Create(ExecuteToggleAutoSuspend);
}
public VisualEditorViewModel VisualEditorViewModel
public VisualEditorViewModel? VisualEditorViewModel
{
get => _visualEditorViewModel;
set => RaiseAndSetIfChanged(ref _visualEditorViewModel, value);
}
public ProfileTreeViewModel ProfileTreeViewModel
public ProfileTreeViewModel? ProfileTreeViewModel
{
get => _profileTreeViewModel;
set => RaiseAndSetIfChanged(ref _profileTreeViewModel, value);
}
public PropertiesViewModel PropertiesViewModel
public PropertiesViewModel? PropertiesViewModel
{
get => _propertiesViewModel;
set => RaiseAndSetIfChanged(ref _propertiesViewModel, value);
}
public DisplayConditionScriptViewModel DisplayConditionScriptViewModel
public DisplayConditionScriptViewModel? DisplayConditionScriptViewModel
{
get => _displayConditionScriptViewModel;
set => RaiseAndSetIfChanged(ref _displayConditionScriptViewModel, value);
}
public StatusBarViewModel StatusBarViewModel
public StatusBarViewModel? StatusBarViewModel
{
get => _statusBarViewModel;
set => RaiseAndSetIfChanged(ref _statusBarViewModel, value);
+13 -11
View File
@@ -67,7 +67,6 @@ namespace Artemis.UI.Screens.Root
registrationService.RegisterBuiltInDataModelDisplays();
registrationService.RegisterBuiltInDataModelInputs();
registrationService.RegisterBuiltInPropertyEditors();
registrationService.RegisterBuiltInNodeTypes();
});
}
@@ -156,23 +155,26 @@ namespace Artemis.UI.Screens.Root
/// <inheritdoc />
public void OpenMainWindow()
{
if (_lifeTime.MainWindow == null)
Dispatcher.UIThread.Post(() =>
{
SidebarViewModel = _sidebarVmFactory.SidebarViewModel(this);
_lifeTime.MainWindow = new MainWindow {DataContext = this};
_lifeTime.MainWindow.Show();
_lifeTime.MainWindow.Closing += CurrentMainWindowOnClosing;
}
if (_lifeTime.MainWindow == null)
{
SidebarViewModel = _sidebarVmFactory.SidebarViewModel(this);
_lifeTime.MainWindow = new MainWindow {DataContext = this};
_lifeTime.MainWindow.Show();
_lifeTime.MainWindow.Closing += CurrentMainWindowOnClosing;
}
_lifeTime.MainWindow.WindowState = WindowState.Normal;
_lifeTime.MainWindow.Activate();
OnMainWindowOpened();
_lifeTime.MainWindow.WindowState = WindowState.Normal;
_lifeTime.MainWindow.Activate();
OnMainWindowOpened();
});
}
/// <inheritdoc />
public void CloseMainWindow()
{
_lifeTime.MainWindow?.Close();
Dispatcher.UIThread.Post(() => { _lifeTime.MainWindow?.Close(); });
}
/// <inheritdoc />
@@ -42,6 +42,7 @@ public class ScriptsDialogViewModel : DialogViewModelBase<object?>
AddScriptConfiguration = ReactiveCommand.CreateFromTask(ExecuteAddScriptConfiguration, Observable.Return(ScriptingProviders.Any()));
this.WhenAnyValue(vm => vm.SelectedScript).Subscribe(s => SetupScriptEditor(s?.ScriptConfiguration));
_scriptConfigurations = new ReadOnlyObservableCollection<ScriptConfigurationViewModel>(new ObservableCollection<ScriptConfigurationViewModel>());
// TODO: When not bound to a profile, base the contents of the UI on the ScriptingService
}
@@ -64,7 +65,7 @@ public class ScriptsDialogViewModel : DialogViewModelBase<object?>
.Subscribe()
.DisposeWith(d);
ScriptConfigurations = scriptConfigurationViewModels;
_scriptConfigurations = scriptConfigurationViewModels;
SelectedScript = ScriptConfigurations.FirstOrDefault();
Disposable.Create(() => profileService.SaveProfile(Profile, false)).DisposeWith(d);
});
@@ -134,7 +134,7 @@ namespace Artemis.UI.Screens.Sidebar
public ReactiveCommand<Unit, Unit> Confirm { get; }
public ReactiveCommand<Unit, Unit> Import { get; }
public ReactiveCommand<Unit, Unit> Delete { get; }
public new ReactiveCommand<Unit, Unit> Cancel { get; }
public ReactiveCommand<Unit, Unit> Cancel { get; }
private async Task ExecuteImport()
{