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