GetDependencyObjectForXBind() not found in a usercontrol #9191
Replies: 2 comments
-
I've just rebuilt my library in WinUi. In the hope that would fix the problem but I'm having what appears to be the same issue: Error CS1061: 'DependencyObject' does not contain a definition for 'SetBinding' and no accessible extension method 'SetBinding' accepting a first argument of type 'DependencyObject' could be found (are you missing a using directive or an assembly reference?) |
Beta Was this translation helpful? Give feedback.
-
I seem to have solved it by adding in the parent class into the .cs file. e.g: |
Beta Was this translation helpful? Give feedback.
-
Still in the process of upgrading from Uno 3.4 to 4.4. I now have a new problem that I cannot figure out. I've got a control derived from UserControl and in the autogenerated output .g.cs file, it's telling me that the HorizontalAlignment property doesn't exist on that control:
and nor can it set the binding, with this error:
Error CS1061: 'DependencyObject' does not contain a definition for 'SetBinding' and no accessible extension method 'SetBinding' accepting a first argument of type 'DependencyObject' could be found (are you missing a using directive or an assembly reference?)
xaml code for above:
<controls1:BorderControl HorizontalAlignment="Right" Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Visibility="{Binding ShowTemplatesBar, Converter={StaticResource BooleanToVisibilityConverter}}"/>
So I've copied the control to another project and it doesn't have this problem. The difference is that both controls are in a class library.
So I must be missing something. What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions