mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
38 lines
935 B
C#
38 lines
935 B
C#
|
using System;
|
||
|
using System.Reactive.Disposables;
|
||
|
using System.Windows;
|
||
|
using System.Windows.Controls;
|
||
|
using ReactiveUI;
|
||
|
|
||
|
namespace Wabbajack.App.Blazor.Browser;
|
||
|
|
||
|
public partial class BrowserTabView : IDisposable
|
||
|
{
|
||
|
private readonly CompositeDisposable _compositeDisposable;
|
||
|
|
||
|
public BrowserTabView(BrowserTabViewModel vm)
|
||
|
{
|
||
|
_compositeDisposable = new CompositeDisposable();
|
||
|
InitializeComponent();
|
||
|
Browser.Browser.Source = new Uri("http://www.google.com");
|
||
|
DataContext = vm;
|
||
|
|
||
|
vm.WhenAnyValue(vm => vm.HeaderText)
|
||
|
.BindTo(this, view => view.HeaderText.Text)
|
||
|
.DisposeWith(_compositeDisposable);
|
||
|
}
|
||
|
|
||
|
public void Dispose()
|
||
|
{
|
||
|
_compositeDisposable.Dispose();
|
||
|
}
|
||
|
|
||
|
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||
|
{
|
||
|
var tc = (TabControl) this.Parent;
|
||
|
tc.Items.Remove(this);
|
||
|
this.Dispose();
|
||
|
}
|
||
|
}
|
||
|
|