Вы можете создать пользовательский Frame
для добавления пользовательских привязываемых свойств для его реализации. Например, добавить три свойства для CustomFrame
. Вы можете добавить другое более настраиваемое свойство, если нужно.
public class CustomFrame :Frame
{
public static readonly BindableProperty CustomFocusedProperty = BindableProperty.Create("CustomFocused", typeof(bool), typeof(CustomFrame), null);
public bool CustomFocused
{
get { return (bool)GetValue(CustomFocusedProperty); }
set { SetValue(CustomFocusedProperty, value); }
}
public static readonly BindableProperty CustomClickedProperty = BindableProperty.Create("CustomClicked", typeof(bool), typeof(CustomFrame), null);
public bool CustomClicked
{
get { return (bool)GetValue(CustomClickedProperty); }
set { SetValue(CustomClickedProperty, value); }
}
public static readonly BindableProperty CustomDisabledProperty = BindableProperty.Create("DisabledFocused", typeof(bool), typeof(CustomFrame), null);
public bool DisabledFocused
{
get { return (bool)GetValue(CustomDisabledProperty); }
set { SetValue(CustomDisabledProperty, value); }
}
}
Uesd в Xaml : <local:CustomFrame x:Name="CustomFrame" />
Затем вы можете установить или получить значение из пользовательского свойства:
CustomFrame.CustomClicked = true;
CustomFrame.CustomFocused = true;
CustomFrame.CustomDisabled = true;