Repository navigation
ReactiveUI with WinUI 3 Support #4342
Replies: 2 comments
|
WinUI 3 is supported through the
// MainView.xaml.cs
public partial class MainViewBase : ReactiveUserControl<MainViewModel> { }
public sealed partial class MainView : MainViewBase
{
public MainView()
{
InitializeComponent();
ViewModel = new MainViewModel();
this.WhenActivated(d =>
{
this.OneWayBind(ViewModel, vm => vm.Title, v => v.TitleText.Text).DisposeWith(d);
this.BindCommand(ViewModel, vm => vm.Refresh, v => v.RefreshButton).DisposeWith(d);
});
}
}<!-- MainView.xaml -->
<views:MainViewBase
x:Class="MyApp.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="using:MyApp.Views">
<StackPanel>
<TextBlock x:Name="TitleText" />
<Button x:Name="RefreshButton" Content="Refresh" />
</StackPanel>
</views:MainViewBase>// MainWindow.xaml.cs
public sealed partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Content = new MainView(); // or put <views:MainView /> in MainWindow.xaml
}
}The same pattern works for pages: |
|
The answer above is right: WinUI 3 is supported through |
Uh oh!
There was an error while loading. Please reload this page.
I was trying to follow the documentation on the site for WinUI 3 but it doesn't appear that any of it is supported? Unless I'm doing something wrong, the ReactiveWindow and ReactiveUserControl sections just don't work. Is WinUI 3 actually supported? If so could someone show me a working example of it with WinUI 3
All reactions