Fix UserControl Interaction
This commit is contained in:
		@@ -12,14 +12,16 @@ public partial class MainWindowViewModel : ViewModelBase, IActivatableViewModel
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    public ViewModelActivator Activator { get; } = new ViewModelActivator();
 | 
					    public ViewModelActivator Activator { get; } = new ViewModelActivator();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [ObservableAsProperty]
 | 
					    [Reactive]
 | 
				
			||||||
    private string _dbPath = "";
 | 
					    private string _dbPath;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    [Reactive]
 | 
				
			||||||
 | 
					    private BuColViewModel? _buColViewModel = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public MainWindowViewModel()
 | 
					    public MainWindowViewModel()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        using var db = Locator.Current.GetService<StarsDatabase>()!;
 | 
					        using var db = Locator.Current.GetService<StarsDatabase>()!;
 | 
				
			||||||
        _dbPathHelper = Observable.Return(Path.GetFullPath(db.DbPath))
 | 
					        DbPath = Path.GetFullPath(db.DbPath);
 | 
				
			||||||
            .ToProperty(this, x => x.DbPath);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.WhenActivated((CompositeDisposable disposables) => 
 | 
					        this.WhenActivated((CompositeDisposable disposables) => 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					using System.ComponentModel.DataAnnotations;
 | 
				
			||||||
using System.Reactive.Disposables;
 | 
					using System.Reactive.Disposables;
 | 
				
			||||||
using Avalonia;
 | 
					using Avalonia;
 | 
				
			||||||
using Avalonia.Controls;
 | 
					using Avalonia.Controls;
 | 
				
			||||||
@@ -12,13 +13,9 @@ public partial class BuColView : ReactiveUserControl<BuColViewModel>
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    public BuColView()
 | 
					    public BuColView()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /*
 | 
					 | 
				
			||||||
        this.WhenActivated(disposables => 
 | 
					        this.WhenActivated(disposables => 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        this.ViewModel = new BuColViewModel();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        InitializeComponent();
 | 
					        InitializeComponent();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,8 @@
 | 
				
			|||||||
            </Grid>
 | 
					            </Grid>
 | 
				
			||||||
        </TabItem>
 | 
					        </TabItem>
 | 
				
			||||||
        <TabItem Header="BuCol">
 | 
					        <TabItem Header="BuCol">
 | 
				
			||||||
            <views:BuColView />
 | 
					            <views:BuColView x:Name="BuColView" 
 | 
				
			||||||
 | 
					                DataContext="{Binding BuColViewModel}" />
 | 
				
			||||||
        </TabItem>
 | 
					        </TabItem>
 | 
				
			||||||
    </TabControl>
 | 
					    </TabControl>
 | 
				
			||||||
</Window>
 | 
					</Window>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user