File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
src/Caliburn.Micro.Platform/Platforms Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,9 @@ public BindableObject AssociatedObject
4646 /// <param name="item">The item that was added.</param>
4747 protected virtual void OnItemAdded ( BindableObject item )
4848 {
49- if ( associatedObject != null && item is IAttachedObject )
49+ if ( associatedObject != null && item is IAttachedObject attached )
5050 {
51- ( ( IAttachedObject ) item ) . Attach ( associatedObject ) ;
51+ attached . Attach ( associatedObject ) ;
5252 }
5353 }
5454
@@ -58,10 +58,10 @@ protected virtual void OnItemAdded(BindableObject item)
5858 /// <param name="item">The item that was removed.</param>
5959 protected virtual void OnItemRemoved ( BindableObject item )
6060 {
61- if ( item is IAttachedObject &&
62- ( ( IAttachedObject ) item ) . AssociatedObject != null )
61+ if ( item is IAttachedObject attached &&
62+ attached . AssociatedObject != null )
6363 {
64- ( ( IAttachedObject ) item ) . Detach ( ) ;
64+ attached . Detach ( ) ;
6565 }
6666 }
6767
Original file line number Diff line number Diff line change @@ -46,9 +46,9 @@ public BindableObject AssociatedObject
4646 /// <param name="item">The item that was added.</param>
4747 protected virtual void OnItemAdded ( BindableObject item )
4848 {
49- if ( associatedObject != null && item is IAttachedObject )
49+ if ( associatedObject != null && item is IAttachedObject attached )
5050 {
51- ( ( IAttachedObject ) item ) . Attach ( associatedObject ) ;
51+ attached . Attach ( associatedObject ) ;
5252 }
5353 }
5454
@@ -58,9 +58,9 @@ protected virtual void OnItemAdded(BindableObject item)
5858 /// <param name="item">The item that was removed.</param>
5959 protected virtual void OnItemRemoved ( BindableObject item )
6060 {
61- if ( item is IAttachedObject && ( ( IAttachedObject ) item ) . AssociatedObject != null )
61+ if ( item is IAttachedObject attached && attached . AssociatedObject != null )
6262 {
63- ( ( IAttachedObject ) item ) . Detach ( ) ;
63+ attached . Detach ( ) ;
6464 }
6565 }
6666
You can’t perform that action at this time.
0 commit comments