Skip to content

Commit

Permalink
Merge pull request #775 from TimLariviere/fix-collections-diff
Browse files Browse the repository at this point in the history
Fix for v0.55 collections diffing
  • Loading branch information
TimLariviere authored Jul 15, 2020
2 parents 535ca91 + 351393c commit 58aec20
Show file tree
Hide file tree
Showing 15 changed files with 851 additions and 618 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ module CodeGenerator =
// Check if the property is a collection
match p.CollectionDataElementType with
| Some collectionDataElementType when not hasApply ->
w.printfn " ChildrenUpdaters.updateChildren prev%sOpt curr%sOpt target.%s" p.UniqueName p.UniqueName p.Name
w.printfn " Collections.updateChildren prev%sOpt curr%sOpt target.%s" p.UniqueName p.UniqueName p.Name
w.printfn " (fun x -> x.Create() :?> %s)" collectionDataElementType
w.printfn " ChildrenUpdaters.updateChild"
w.printfn " Collections.updateChild"
w.printfn " (match registry.TryGetValue(%s.KeyValue) with true, func -> func | false, _ -> (fun _ _ _ -> ()))" attributeKey

| Some _ when hasApply ->
Expand Down
4 changes: 2 additions & 2 deletions Fabulous.XamarinForms/extensions/Maps/ViewUpdaters.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ module ViewUpdaters =
| _ -> ()

let updatePolygonGeopath (prevCollOpt: Position array voption) (currCollOpt: Xamarin.Forms.Maps.Position array voption) (target: Xamarin.Forms.Maps.Polygon) _ =
ItemsUpdaters.updateItems prevCollOpt currCollOpt target.Geopath
Collections.updateItems prevCollOpt currCollOpt target.Geopath
(fun _ -> ValueNone)
(fun prev curr -> prev = curr)
id
(fun _ _ _ -> ())
(fun _ _ _ -> ())

let updatePolylineGeopath (prevCollOpt: Xamarin.Forms.Maps.Position array voption) (currCollOpt: Xamarin.Forms.Maps.Position array voption) (target: Xamarin.Forms.Maps.Polyline) _ =
ItemsUpdaters.updateItems prevCollOpt currCollOpt target.Geopath
Collections.updateItems prevCollOpt currCollOpt target.Geopath
(fun _ -> ValueNone)
(fun prev curr -> prev = curr)
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ module App =
for ((row,col) as pos) in positions ->
let item =
if canPlay model model.Board.[pos] then
View.Button(command=(fun () -> dispatch (Play pos)), backgroundColor=Color.LightBlue)
View.Button(key = sprintf "Button%i_%i" row col, command=(fun () -> dispatch (Play pos)), backgroundColor=Color.LightBlue)
else
View.Image(source=imageForPos model.Board.[pos],
View.Image(key = sprintf "Image%i_%i" row col,
source=imageForPos model.Board.[pos],
margin=Thickness(10.0), horizontalOptions=LayoutOptions.Center,
verticalOptions=LayoutOptions.Center)
item.Row(row*2).Column(col*2) ],
Expand Down

This file was deleted.

Loading

0 comments on commit 58aec20

Please sign in to comment.