Skip to content
Discussion options

You must be logged in to vote

for #⁠2, I don't know much about uno.ext.nav. But you can use this hack at the view level to blocks the null ones:

namespace DMXCore.DMXCore100.Views;
public partial class ViewBase : Page
{
	public ViewBase()
	{
		DataContextChanged += OnDataContextChanged;
	}

	private void OnDataContextChanged(FrameworkElement s, DataContextChangedEventArgs e)
	{
		if (e.NewValue is null) return;

		if (Content is UIElement uie)
		{
			uie.DataContext = e.NewValue;
		}
	}
}
public sealed partial class MenuPage : ViewBase, IFocusableItemsProvider, ICanSetFocus
...
<views:ViewBase
	x:Class="DMXCore.DMXCore100.Views.MenuPage"
	xmlns:views="using:DMXCore.DMXCore100.Views" ...

The idea to let the null flow t…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@HakanL
Comment options

@Xiaoy312
Comment options

Answer selected by HakanL
@HakanL
Comment options

@Xiaoy312
Comment options

@HakanL
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants