wip..
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Hyperbar.UI.Windows;
|
||||
|
||||
public class ContentControlHandler(IViewModelContentBinder viewModelContentBinder) :
|
||||
INavigationHandler<ContentControl>
|
||||
{
|
||||
public Task Handle(Navigate<ContentControl> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (args.Target is ContentControl contentControl)
|
||||
{
|
||||
contentControl.Content = args.View;
|
||||
contentControl.DataContext = args.ViewModel;
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,7 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Hyperbar.UI.Windows;
|
||||
|
||||
public class ContentControlHandler(IViewModelContentBinder viewModelContentBinder) :
|
||||
INavigationHandler<ContentControl>
|
||||
{
|
||||
public Task Handle(Navigate<ContentControl> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (args.Target is ContentControl contentControl)
|
||||
{
|
||||
contentControl.Content = args.View;
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
public class WindowHandler(IViewModelContentBinder viewModelContentBinder) :
|
||||
INavigationHandler<Window>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user