From 38e023e1858d6242abd1e893d9d3bf0e73d53dba Mon Sep 17 00:00:00 2001 From: David Date: Fri, 17 Jan 2025 20:48:45 -0500 Subject: [PATCH] fix(hr): Fix invalid code gen when using x:bBind on resource --- .../0/p1/MainPage.xaml | 18 +++++++++++ .../0/p1/MainPage.xaml.cs | 26 +++++++++++++++ .../1/p1/MainPage.xaml | 18 +++++++++++ .../1/p1/MainPage.xaml.cs | 28 ++++++++++++++++ .../When_Page_Res_xBind_Add/Scenario.json | 24 ++++++++++++++ .../0/p1/MainPage.xaml | 18 +++++++++++ .../0/p1/MainPage.xaml.cs | 26 +++++++++++++++ .../1/p1/MainPage.xaml | 18 +++++++++++ .../1/p1/MainPage.xaml.cs | 28 ++++++++++++++++ .../2/p1/MainPage.xaml | 18 +++++++++++ .../2/p1/MainPage.xaml.cs | 26 +++++++++++++++ .../Scenario.json | 32 +++++++++++++++++++ .../0/p1/MainPage.xaml | 18 +++++++++++ .../0/p1/MainPage.xaml.cs | 28 ++++++++++++++++ .../1/p1/MainPage.xaml | 18 +++++++++++ .../1/p1/MainPage.xaml.cs | 26 +++++++++++++++ .../When_Page_Res_xBind_Remove/Scenario.json | 26 +++++++++++++++ .../0/p1/MainPage.xaml | 18 +++++++++++ .../0/p1/MainPage.xaml.cs | 28 ++++++++++++++++ .../1/p1/MainPage.xaml | 18 +++++++++++ .../1/p1/MainPage.xaml.cs | 28 ++++++++++++++++ .../When_Page_Res_xBind_Update/Scenario.json | 24 ++++++++++++++ ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 2 +- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 2 +- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 4 +-- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 2 +- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 2 +- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 4 +-- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 2 +- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 2 +- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 2 +- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 6 ++-- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 6 ++-- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 6 ++-- ...inPage_d6cd66944958ced0c513e0a04797b51d.cs | 6 ++-- .../XamlGenerator/XamlFileGenerator.cs | 12 ++----- 36 files changed, 538 insertions(+), 32 deletions(-) create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/Scenario.json create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/Scenario.json create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/Scenario.json create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml.cs create mode 100644 src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/Scenario.json diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml new file mode 100644 index 000000000000..566f28d4c5ba --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..bf23475c241c --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/0/p1/MainPage.xaml.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml new file mode 100644 index 000000000000..d038ea970660 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..5d931c42b14f --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/1/p1/MainPage.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } + + public Color MyColor => Colors.DeepPink; +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/Scenario.json b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/Scenario.json new file mode 100644 index 000000000000..902d6383b5fd --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add/Scenario.json @@ -0,0 +1,24 @@ +{ + "Scenarios": [ + { + "IsDebug": true, + "IsMono": false, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + }, + { + "IsDebug": true, + "IsMono": true, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + } + ] +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml new file mode 100644 index 000000000000..566f28d4c5ba --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..bf23475c241c --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/0/p1/MainPage.xaml.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml new file mode 100644 index 000000000000..d038ea970660 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..5d931c42b14f --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/1/p1/MainPage.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } + + public Color MyColor => Colors.DeepPink; +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml new file mode 100644 index 000000000000..566f28d4c5ba --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..bf23475c241c --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/2/p1/MainPage.xaml.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/Scenario.json b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/Scenario.json new file mode 100644 index 000000000000..3c52d719dc04 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Add_Remove/Scenario.json @@ -0,0 +1,32 @@ +{ + "Scenarios": [ + { + "IsDebug": true, + "IsMono": false, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + }, + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + }, + { + "IsDebug": true, + "IsMono": true, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + }, + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + } + ] +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml new file mode 100644 index 000000000000..d038ea970660 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..5d931c42b14f --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/0/p1/MainPage.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } + + public Color MyColor => Colors.DeepPink; +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml new file mode 100644 index 000000000000..566f28d4c5ba --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..bf23475c241c --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/1/p1/MainPage.xaml.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/Scenario.json b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/Scenario.json new file mode 100644 index 000000000000..0082bb971c68 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Remove/Scenario.json @@ -0,0 +1,26 @@ +{ + "Scenarios": [ + { + "IsDebug": true, + "IsMono": false, + "IsCrashingRoslyn": true, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + }, + { + "IsDebug": true, + "IsMono": true, + "IsCrashingRoslyn": true, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + } + ] +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml new file mode 100644 index 000000000000..d038ea970660 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..5d931c42b14f --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/0/p1/MainPage.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } + + public Color MyColor => Colors.DeepPink; +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml new file mode 100644 index 000000000000..f4f6a78d2088 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml.cs new file mode 100644 index 000000000000..b86875aa0471 --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/1/p1/MainPage.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.UI; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +namespace Test01; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.InitializeComponent(); + } + + public Color MyColor2 => Colors.DeepPink; +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/Scenario.json b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/Scenario.json new file mode 100644 index 000000000000..902d6383b5fd --- /dev/null +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Scenarios/When_Page_Res_xBind_Update/Scenario.json @@ -0,0 +1,24 @@ +{ + "Scenarios": [ + { + "IsDebug": true, + "IsMono": false, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + }, + { + "IsDebug": true, + "IsMono": true, + "PassResults": [ + { + "MetadataUpdates": 1, + "Diagnostics": [] + } + ] + } + ] +} diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TAA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TAA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index ae0cdd46d8c3..4e511947d358 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TAA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TAA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -69,7 +69,7 @@ private void InitializeComponent() { Mode = BindingMode.OneTime, } - .BindingApply(___b => /*defaultBindModeOneTime MyArray.Length*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), null )) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime MyArray.Length*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), null )) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TIDFA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TIDFA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 659994de7711..79b42bd2f3bf 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TIDFA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TIDFA/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -69,7 +69,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime MyFooInterface.Name*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.MyFooInterface.Name)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) ___tctx.MyFooInterface.Name = (string)global::Microsoft.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(typeof(string), __value); } , new [] {"MyFooInterface.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime MyFooInterface.Name*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.MyFooInterface.Name)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) ___tctx.MyFooInterface.Name = (string)global::Microsoft.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(typeof(string), __value); } , new [] {"MyFooInterface.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TPXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TPXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 16dec2879e8c..eff4642d6ebe 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TPXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TPXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -94,7 +94,7 @@ private void InitializeComponent() Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, Converter = (global::Microsoft.UI.Xaml.Data.IValueConverter)global::Uno.UI.ResourceResolverSingleton.Instance.ResolveResourceStatic("NullableBoolConverter", typeof(global::Microsoft.UI.Xaml.Data.IValueConverter), context: global::MyProject.GlobalStaticResources.__ParseContext_), } - .BindingApply(___b => /*defaultBindModeOneTime ToggleLoad.IsChecked*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ToggleLoad.IsChecked)) : (false, default), null , new [] {"ToggleLoad.IsChecked"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ToggleLoad.IsChecked*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ToggleLoad.IsChecked)) : (false, default), null , new [] {"ToggleLoad.IsChecked"})) ); __that._component_1 = __p1; var _component_1_update_That = (this as global::Uno.UI.DataBinding.IWeakReferenceProvider).WeakReference; @@ -148,7 +148,7 @@ void _component_1_materializing(object sender) { Mode = BindingMode.OneTime, } - .BindingApply(___b => /*defaultBindModeOneTime */ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___ctx)) : (false, default), null )) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime */ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___ctx)) : (false, default), null )) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTIXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTIXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index c361fb6ce554..d8027f12930f 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTIXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTIXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -168,7 +168,7 @@ private void InitializeComponent() { Mode = BindingMode.OneTime, } - .BindingApply(___b => /*defaultBindModeOneTime IsLoaded*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), null )) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime IsLoaded*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), null )) ); __that._component_1 = __p1; var _component_1_update_That = (this as global::Uno.UI.DataBinding.IWeakReferenceProvider).WeakReference; diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTW/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTW/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 4ef8ea923aaa..84d45d52ebd4 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTW/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TTW/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -69,7 +69,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.P*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) TrySetInstance_xBind_1(___tctx, __value); } , new [] {"ViewModel.P"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.P*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) TrySetInstance_xBind_1(___tctx, __value); } , new [] {"ViewModel.P"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 04a78ae5a2a3..95683d318817 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/TXBRXLE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -94,7 +94,7 @@ private void InitializeComponent() Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, Converter = (global::Microsoft.UI.Xaml.Data.IValueConverter)global::Uno.UI.ResourceResolverSingleton.Instance.ResolveResourceStatic("NullableBoolConverter", typeof(global::Microsoft.UI.Xaml.Data.IValueConverter), context: global::MyProject.GlobalStaticResources.__ParseContext_), } - .BindingApply(___b => /*defaultBindModeOneTime ToggleLoad.IsChecked*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ToggleLoad.IsChecked)) : (false, default), null , new [] {"ToggleLoad.IsChecked"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ToggleLoad.IsChecked*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ToggleLoad.IsChecked)) : (false, default), null , new [] {"ToggleLoad.IsChecked"})) ); __that._component_1 = __p1; var _component_1_update_That = (this as global::Uno.UI.DataBinding.IWeakReferenceProvider).WeakReference; @@ -149,7 +149,7 @@ void _component_1_materializing(object sender) Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, Converter = (global::Microsoft.UI.Xaml.Data.IValueConverter)global::Uno.UI.ResourceResolverSingleton.Instance.ResolveResourceStatic("NullableBoolConverter", typeof(global::Microsoft.UI.Xaml.Data.IValueConverter), context: global::MyProject.GlobalStaticResources.__ParseContext_), } - .BindingApply(___b => /*defaultBindModeOneTime LoadElement.IsChecked*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.LoadElement.IsChecked)) : (false, default), null , new [] {"LoadElement.IsChecked"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime LoadElement.IsChecked*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.LoadElement.IsChecked)) : (false, default), null , new [] {"LoadElement.IsChecked"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index b4d2cb15eb3c..e678b23652dd 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -71,7 +71,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.IsEnabled*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.IsEnabled)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) ___tctx.ViewModel.IsEnabled = (bool)global::Microsoft.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(typeof(bool), __value); } , new [] {"ViewModel.IsEnabled"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.IsEnabled*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.IsEnabled)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) ___tctx.ViewModel.IsEnabled = (bool)global::Microsoft.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(typeof(bool), __value); } , new [] {"ViewModel.IsEnabled"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WLCHB/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WLCHB/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 56f440117fa9..fba4b829862a 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WLCHB/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WLCHB/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -74,7 +74,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, } - .BindingApply(___b => /*defaultBindModeOneTime InnerText*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), null , new [] {"InnerText"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime InnerText*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? (TryGetInstance_xBind_1(___tctx, out var bindResult1) ? (true, bindResult1) : (false, default)) : (false, default), null , new [] {"InnerText"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WNBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WNBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 2d33b95efc60..849b58dab433 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WNBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WNBOP/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -71,7 +71,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.SubModel.IsEnabled*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.SubModel.IsEnabled)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) ___tctx.ViewModel.SubModel.IsEnabled = (bool)global::Microsoft.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(typeof(bool), __value); } , new [] {"ViewModel.SubModel.IsEnabled"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.SubModel.IsEnabled*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.SubModel.IsEnabled)) : (false, default), (___ctx, __value) => { if(___ctx is global::TestRepro.MainPage ___tctx) ___tctx.ViewModel.SubModel.IsEnabled = (bool)global::Microsoft.UI.Xaml.Markup.XamlBindingHelper.ConvertValue(typeof(bool), __value); } , new [] {"ViewModel.SubModel.IsEnabled"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPADNE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPADNE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 996b6e0904dd..51ef4c8cd70a 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPADNE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPADNE/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -69,7 +69,7 @@ private void InitializeComponent() { Mode = BindingMode.OneTime, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -91,7 +91,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -113,7 +113,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE__name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE__name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 996b6e0904dd..51ef4c8cd70a 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE__name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE__name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -69,7 +69,7 @@ private void InitializeComponent() { Mode = BindingMode.OneTime, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -91,7 +91,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -113,7 +113,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_m_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_m_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 996b6e0904dd..51ef4c8cd70a 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_m_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_m_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -69,7 +69,7 @@ private void InitializeComponent() { Mode = BindingMode.OneTime, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -91,7 +91,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -113,7 +113,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs index 996b6e0904dd..51ef4c8cd70a 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/WOPAE_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs @@ -69,7 +69,7 @@ private void InitializeComponent() { Mode = BindingMode.OneTime, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null )) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -91,7 +91,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.OneWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), null , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); @@ -113,7 +113,7 @@ private void InitializeComponent() { Mode = global::Microsoft.UI.Xaml.Data.BindingMode.TwoWay, } - .BindingApply(___b => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, __that, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) + .BindingApply(__that, (___b, ___t) => /*defaultBindModeOneTime ViewModel.Name.ToUpper()*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => ___ctx is global::TestRepro.MainPage ___tctx ? ((true, ___tctx.ViewModel.Name.ToUpper())) : (false, default), (___tctx, __value) => ViewModel.MyBindBack((string)__value) , new [] {"ViewModel.Name"})) ); global::Uno.UI.FrameworkElementHelper.SetBaseUri(__p1, __baseUri_MainPage_d6cd66944958ced0c513e0a04797b51d); __p1.CreationComplete(); diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs b/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs index cef68b5ec94c..a04022fc8d9e 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs @@ -3082,7 +3082,7 @@ private void BuildExtendedProperties(IIndentedStringBuilder outerwriter, XamlObj extractionTargetMembers = _uiAutomationMappings ?.FirstOrDefault(m => _metadataHelper.FindTypeByFullName(m.Key) is INamedTypeSymbol mappingKeySymbol && (IsType(objectDefinitionType, mappingKeySymbol) || IsImplementingInterface(objectDefinitionType, mappingKeySymbol))) .Value - ?.ToArray() ?? Array.Empty(); + ?.ToArray() ?? []; } if (hasChildrenWithPhase) @@ -4265,12 +4265,6 @@ private string BuildXBindEvalFunction(XamlMemberDefinition member, XamlObjectDef var modeMember = bindNode.Members.FirstOrDefault(m => m.Member.Name == "Mode")?.Value?.ToString() ?? GetDefaultBindMode(); var rawBindBack = bindNode.Members.FirstOrDefault(m => m.Member.Name == "BindBack")?.Value?.ToString(); - var sourceInstance = CurrentResourceOwner is not null ? CurrentResourceOwnerName : "__that"; - - var applyBindingParameters = _isHotReloadEnabled - ? $"{sourceInstance}, (___b, __that)" - : "___b"; - if (isInsideDataTemplate) { var dataTypeObject = FindMember(dataTemplateObject!, "DataType", XamlConstants.XamlXmlNamespace); @@ -4346,7 +4340,7 @@ string buildBindBack() } } - return $".BindingApply({applyBindingParameters} => /*defaultBindMode{GetDefaultBindMode()}*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, null, ___ctx => ___ctx is {GetType(dataType).GetFullyQualifiedTypeIncludingGlobal()} ___tctx ? ({contextFunction.Expression}) : (false, default), {buildBindBack()} {pathsArray}))"; + return $".BindingApply(___b => /*defaultBindMode{GetDefaultBindMode()}*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, null, ___ctx => ___ctx is {GetType(dataType).GetFullyQualifiedTypeIncludingGlobal()} ___tctx ? ({contextFunction.Expression}) : (false, default), {buildBindBack()} {pathsArray}))"; } else { @@ -4433,7 +4427,7 @@ string buildBindBack() ? ", new [] {" + string.Join(", ", formattedPaths) + "}" : ""; - return $".BindingApply({applyBindingParameters} => /*defaultBindMode{GetDefaultBindMode()} {rawFunction}*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, {sourceInstance}, ___ctx => {bindFunction}, {buildBindBack()} {pathsArray}))"; + return $".BindingApply(__that, (___b, ___t) => /*defaultBindMode{GetDefaultBindMode()} {rawFunction}*/ global::Uno.UI.Xaml.BindingHelper.SetBindingXBindProvider(___b, ___t, ___ctx => {bindFunction}, {buildBindBack()} {pathsArray}))"; } }