зеркало из https://github.com/DeGsoft/maui-linux.git
Change StateTriggerBase OnAttached and OnDetached methods to be public (#9888)
* Change OnAttached and OnDetached to be public * Fixed build error * Removed unnecessary virtual methods * Fixed build error
This commit is contained in:
Родитель
c838f3db4f
Коммит
8ce4b7db73
|
@ -39,7 +39,7 @@ namespace Xamarin.Forms
|
|||
((AdaptiveTrigger)bindable).UpdateState();
|
||||
}
|
||||
|
||||
internal override void OnAttached()
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace Xamarin.Forms
|
|||
}
|
||||
}
|
||||
|
||||
internal override void OnDetached()
|
||||
protected override void OnDetached()
|
||||
{
|
||||
base.OnDetached();
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace Xamarin.Forms
|
|||
((CompareStateTrigger)bindable).UpdateState();
|
||||
}
|
||||
|
||||
internal override void OnAttached()
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
UpdateState();
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Xamarin.Forms
|
|||
((OrientationStateTrigger)bindable).UpdateState();
|
||||
}
|
||||
|
||||
internal override void OnAttached()
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace Xamarin.Forms
|
|||
}
|
||||
}
|
||||
|
||||
internal override void OnDetached()
|
||||
protected override void OnDetached()
|
||||
{
|
||||
base.OnDetached();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
internal override void OnAttached()
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
UpdateState();
|
||||
|
|
|
@ -27,6 +27,8 @@ namespace Xamarin.Forms
|
|||
|
||||
internal VisualState VisualState { get; set; }
|
||||
|
||||
public bool IsAttached { get; private set; }
|
||||
|
||||
protected void SetActive(bool active)
|
||||
{
|
||||
IsActive = active;
|
||||
|
@ -34,14 +36,30 @@ namespace Xamarin.Forms
|
|||
VisualState?.VisualStateGroup?.UpdateStateTriggers();
|
||||
}
|
||||
|
||||
internal virtual void OnAttached()
|
||||
protected virtual void OnAttached()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal virtual void OnDetached()
|
||||
protected virtual void OnDetached()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal void SendAttached()
|
||||
{
|
||||
if (IsAttached)
|
||||
return;
|
||||
OnAttached();
|
||||
IsAttached = true;
|
||||
}
|
||||
|
||||
internal void SendDetached()
|
||||
{
|
||||
if (!IsAttached)
|
||||
return;
|
||||
OnDetached();
|
||||
IsAttached = false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -847,9 +847,9 @@ namespace Xamarin.Forms
|
|||
foreach (var stateTrigger in state.StateTriggers)
|
||||
{
|
||||
if(attach)
|
||||
stateTrigger.OnAttached();
|
||||
stateTrigger.SendAttached();
|
||||
else
|
||||
stateTrigger.OnDetached();
|
||||
stateTrigger.SendDetached();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Xamarin.Forms.DualScreen
|
|||
_info = new DualScreenInfo(_visualElement);
|
||||
}
|
||||
|
||||
internal override void OnAttached()
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace Xamarin.Forms.DualScreen
|
|||
}
|
||||
}
|
||||
|
||||
internal override void OnDetached()
|
||||
protected override void OnDetached()
|
||||
{
|
||||
base.OnDetached();
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Xamarin.Forms.DualScreen
|
|||
((WindowSpanModeStateTrigger)bindable).UpdateState();
|
||||
}
|
||||
|
||||
internal override void OnAttached()
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace Xamarin.Forms.DualScreen
|
|||
}
|
||||
}
|
||||
|
||||
internal override void OnDetached()
|
||||
protected override void OnDetached()
|
||||
{
|
||||
base.OnDetached();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче