- leonid_golovko
- Posts: 13
- Joined:
Binding from a few view models
I have two view models and the second one is not seen by the system.
How to make the xaml see this second view model?
The second view model called CircleViewModel.
Thank you for the answer in advance!
<Image Source="{StaticResource CenterCircleButtonOff}" Stretch="Uniform" Visibility="{Binding CircleCenterOffMouseVisibility, Converter={StaticResource BooleanToVisibilityConverter}}"/>
[NOESIS/E] Binding failed: Path=CircleCenterOffMouseVisibility, Source=DataModelApp.ViewModel(''), Target=Image(''), TargetProperty=UIElement.Visibility
How to make the xaml see this second view model?
The second view model called CircleViewModel.
Thank you for the answer in advance!
<Image Source="{StaticResource CenterCircleButtonOff}" Stretch="Uniform" Visibility="{Binding CircleCenterOffMouseVisibility, Converter={StaticResource BooleanToVisibilityConverter}}"/>
[NOESIS/E] Binding failed: Path=CircleCenterOffMouseVisibility, Source=DataModelApp.ViewModel(''), Target=Image(''), TargetProperty=UIElement.Visibility
-
sfernandez
Site Admin
- Posts: 3112
- Joined:
Re: Binding from a few view models
If you manually set the Visibility of the Image to "Visible", does it show as expected?
In that case, are you sure that the viewmodel is available to that Image? If you bind the property CircleCenterOffMouseVisibility to a TextBlock.Text for example, does it show the correct value?
In that case, are you sure that the viewmodel is available to that Image? If you bind the property CircleCenterOffMouseVisibility to a TextBlock.Text for example, does it show the correct value?
- leonid_golovko
- Posts: 13
- Joined:
Re: Binding from a few view models
I just wanted to print the same class 4 times in a diagonal and it print four circles but not in the right coordinates.
It did not change no matter what I did.
It did not change no matter what I did.
-
sfernandez
Site Admin
- Posts: 3112
- Joined:
Re: Binding from a few view models
Could this be related to your other post: viewtopic.php?p=17268#p17268
As I pointed out there, each item in an ItemsControl is wrapped by a ContentPresenter, so canvas position must be set in that element, not in the root of the ItemTemplate.
As I pointed out there, each item in an ItemsControl is wrapped by a ContentPresenter, so canvas position must be set in that element, not in the root of the ItemTemplate.
- leonid_golovko
- Posts: 13
- Joined:
Re: Binding from a few view models
Yes. Now this problem was solved! Thank you!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest