estara/Estara/Views/ListDetailsDetailControl.xa...

31 lines
966 B
C#

using Estara.Core.Models;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Estara.Views;
public sealed partial class ListDetailsDetailControl : UserControl
{
public SampleOrder? ListDetailsMenuItem
{
get => GetValue(ListDetailsMenuItemProperty) as SampleOrder;
set => SetValue(ListDetailsMenuItemProperty, value);
}
public static readonly DependencyProperty ListDetailsMenuItemProperty = DependencyProperty.Register("ListDetailsMenuItem", typeof(SampleOrder), typeof(ListDetailsDetailControl), new PropertyMetadata(null, OnListDetailsMenuItemPropertyChanged));
public ListDetailsDetailControl()
{
InitializeComponent();
}
private static void OnListDetailsMenuItemPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is ListDetailsDetailControl control)
{
control.ForegroundElement.ChangeView(0, 0, 1);
}
}
}