You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using WinUI 3, if a XAML data binding uses a value converter it will fail when using the 'Release' configuration. It works fine using the 'Debug' configuration. Somewhat related, a strongly typed binding {x:bind} that uses a value converter doesn't work using either the debug, or release build configuration.
Steps To Reproduce
1.) Attached is a Visual Studio solution created using the Blank App, Packaged (WinUI 3 in Desktop) project template.
2.) I created a MonthConverter class that implements IValueConverter. It converts a DateTime to a string that outputs the month as text.
3.) In the MainWindow class I created a 'Now' property that returns DateTime.Now.
4.) In the MainWindow.xaml file I created a TextBlock that binds to the MainWindow.Now property.
5.) I set the TextBlock's Binding Converter to use a MonthConverter XAML Resource.
6.) Run the app using the 'Debug' build configuration. Everything works great. The month is displayed by the binding within the TextBlock.
7.) Run the app again using the 'Release' build configuration. The binding no longer displays the month.
8.) If you use a strongly typed x:Bind instead, it won't work using either the Debug or Release configuration. It says the resource can't be found.
When you run the application you should see the current month printed in full. It works as expected using the 'Debug' build configuration. Change the build configuration to 'Release' and run the application. The month is no longer printed. The binding no longer outputs a value.
Version Info
Visual Studio 2023 (17.12.3)
Windows App SDK 1.6.250108002
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Description
Using WinUI 3, if a XAML data binding uses a value converter it will fail when using the 'Release' configuration. It works fine using the 'Debug' configuration. Somewhat related, a strongly typed binding {x:bind} that uses a value converter doesn't work using either the debug, or release build configuration.
Steps To Reproduce
1.) Attached is a Visual Studio solution created using the Blank App, Packaged (WinUI 3 in Desktop) project template.
2.) I created a MonthConverter class that implements IValueConverter. It converts a DateTime to a string that outputs the month as text.
3.) In the MainWindow class I created a 'Now' property that returns DateTime.Now.
4.) In the MainWindow.xaml file I created a TextBlock that binds to the MainWindow.Now property.
5.) I set the TextBlock's Binding Converter to use a MonthConverter XAML Resource.
6.) Run the app using the 'Debug' build configuration. Everything works great. The month is displayed by the binding within the TextBlock.
7.) Run the app again using the 'Release' build configuration. The binding no longer displays the month.
8.) If you use a strongly typed x:Bind instead, it won't work using either the Debug or Release configuration. It says the resource can't be found.
BrokenConverterExample.zip
Expected Behavior
When you run the application you should see the current month printed in full. It works as expected using the 'Debug' build configuration. Change the build configuration to 'Release' and run the application. The month is no longer printed. The binding no longer outputs a value.
Version Info
Visual Studio 2023 (17.12.3)
Windows App SDK 1.6.250108002
Additional Context
No response
The text was updated successfully, but these errors were encountered: