diff --git a/Wabbajack.App/Controls/LogViewModel.cs b/Wabbajack.App/Controls/LogViewModel.cs index 9d330c76..c9c65f88 100644 --- a/Wabbajack.App/Controls/LogViewModel.cs +++ b/Wabbajack.App/Controls/LogViewModel.cs @@ -30,14 +30,8 @@ public class LogViewModel : ViewModelBase, IActivatableViewModel .Bind(out _messagesFiltered) .Subscribe(); - this.WhenActivated(disposables => - { - _provider.Messages - .Subscribe(m => _messages.AddOrUpdate(m)) - .DisposeWith(disposables); - }); - - + _provider.Messages + .Subscribe(m => _messages.AddOrUpdate(m)); } } \ No newline at end of file diff --git a/Wabbajack.App/Controls/RemovableListItem.axaml b/Wabbajack.App/Controls/RemovableListItem.axaml new file mode 100644 index 00000000..13fe4182 --- /dev/null +++ b/Wabbajack.App/Controls/RemovableListItem.axaml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/Wabbajack.App/Controls/RemovableListItem.axaml.cs b/Wabbajack.App/Controls/RemovableListItem.axaml.cs new file mode 100644 index 00000000..b05a688d --- /dev/null +++ b/Wabbajack.App/Controls/RemovableListItem.axaml.cs @@ -0,0 +1,24 @@ +using Avalonia.Controls.Mixins; +using Avalonia.ReactiveUI; +using ReactiveUI; +using Wabbajack.App.ViewModels; + +namespace Wabbajack.App.Controls; + +public partial class RemovableListItem : ReactiveUserControl, IActivatableView +{ + public RemovableListItem() + { + InitializeComponent(); + this.WhenActivated(disposables => + { + this.OneWayBind(ViewModel, vm => vm.Text, view => view.Text.Text) + .DisposeWith(disposables); + + this.BindCommand(ViewModel, vm => vm.DeleteCommand, view => view.DeleteButton) + .DisposeWith(disposables); + + }); + } + +} \ No newline at end of file diff --git a/Wabbajack.App/Controls/RemovableListItemViewModel.cs b/Wabbajack.App/Controls/RemovableListItemViewModel.cs new file mode 100644 index 00000000..7aca36b2 --- /dev/null +++ b/Wabbajack.App/Controls/RemovableListItemViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Reactive; +using ReactiveUI; +using ReactiveUI.Fody.Helpers; +using Wabbajack.App.ViewModels; + +namespace Wabbajack.App.Controls; + +public class RemovableItemViewModel : ViewModelBase +{ + [Reactive] + public string Text { get; set; } + + [Reactive] + public ReactiveCommand DeleteCommand { get; set; } + + public RemovableItemViewModel() + { + Activator = new ViewModelActivator(); + + } +} \ No newline at end of file diff --git a/Wabbajack.App/Screens/CompilerConfigurationView.axaml b/Wabbajack.App/Screens/CompilerConfigurationView.axaml index 74231acc..0b680147 100644 --- a/Wabbajack.App/Screens/CompilerConfigurationView.axaml +++ b/Wabbajack.App/Screens/CompilerConfigurationView.axaml @@ -8,7 +8,7 @@ x:Class="Wabbajack.App.Screens.CompilerConfigurationView"> Compiler Configuration - + @@ -27,6 +27,29 @@ + + + + + + + + + + + + + + + + + + + + +