A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
665 B

using System;
using Avalonia.Controls;
using ControlCatalog.ViewModels;
namespace ControlCatalog.Pages
{
public partial class MenuPage : UserControl
{
public MenuPage()
{
InitializeComponent();
DataContext = new MenuPageViewModel();
}
private MenuPageViewModel? _model;
protected override void OnDataContextChanged(EventArgs e)
{
if (_model != null)
_model.View = null;
_model = DataContext as MenuPageViewModel;
if (_model != null)
_model.View = this;
base.OnDataContextChanged(e);
}
}
}