-
Couldn't load subscription status.
- Fork 773
Open
Labels
area-XamlWindowdocumentationAn issue with existing documentation or a request for documenation of a new topicAn issue with existing documentation or a request for documenation of a new topicteam-MarkupIssue for the Markup teamIssue for the Markup teamwpf-vs-winui-mismatch
Description
Describe the bug
Hi, I've tried to use the x:Bind with IValueConverter. But the project doesn't compile - CS1503 Argument 1: cannot convert from 'TestApp.MainWindow' to 'Microsoft.UI.Xaml.FrameworkElement'. Please take a look at the following code. What I do wrong?
Steps to reproduce the bug
<Window
x:Class="TestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid RowDefinitions="Auto, *" x:Name="root">
<Grid.Resources>
<local:MyConverter x:Key="MyConverter"/>
</Grid.Resources>
<StackPanel Spacing="12"
Grid.Row="1">
<TextBlock Text="{x:Bind MyProperty, Converter={StaticResource MyConverter}}"/>
</StackPanel>
</Grid>
</Window> public class MyConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, string language) => value;
public object ConvertBack(object value, Type targetType, object parameter, string language) => value;
}
public sealed partial class MainWindow : Window {
public MainWindow() {
this.InitializeComponent();
}
public string MyProperty { get; } = "Test";Expected behavior
Version Info
NuGet package version:
[WinUI 3 - Project Reunion 0.5: 0.5.6]
Windows app type:
| UWP | Win32 |
|---|---|
| Yes |
| Windows 10 version | Saw the problem? |
|---|---|
| Insider Build (xxxxx) | |
| October 2020 Update (19042) | Yes |
| May 2020 Update (19041) | |
| November 2019 Update (18363) | |
| May 2019 Update (18362) | |
| October 2018 Update (17763) | |
| April 2018 Update (17134) | |
| Fall Creators Update (16299) | |
| Creators Update (15063) |
| Device form factor | Saw the problem? |
|---|---|
| Desktop | Yes |
| Xbox | |
| Surface Hub | |
| IoT |
Additional context
fman028, shelllet, EjiHuang, adamjones-lhpt, torum and 14 morelavinders and SlionWufus, CarteKiwi and Slion
Metadata
Metadata
Assignees
Labels
area-XamlWindowdocumentationAn issue with existing documentation or a request for documenation of a new topicAn issue with existing documentation or a request for documenation of a new topicteam-MarkupIssue for the Markup teamIssue for the Markup teamwpf-vs-winui-mismatch
Type
Projects
Status
Backlog
