Я использую Ретранслятор DottorPagliaccius, вложенный в другой Repeaterview. Команда RSSFeedSelectedCommand не работает, если только на верхнем ретрансляторе, что теоретически имеет смысл, но как я могу заставить ее работать?
Я изучал использование конвертеров и bindtoeventcommand, но не могу заставить их работать.
<repeater:RepeaterView x:Name = "MainRepeater" SeparatorHeight = "25" ItemsSource = {Binding Feeds}">
<repeater:RepeaterView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Spacing = "10">
<Label Text = "{Binding Title}" TextColor = "Blue" />
<Label Text = "{Binding Description}" TextColor = "Red" FontSize = "12" />
<repeater:RepeaterView x:Name = "MainRepeater2" EmptyText = "No elements" ShowSeparator = "true" SeparatorHeight = "2" SeparatorColor = "Silver" ItemsSource = "{Binding Items}" SelectedItemCommand = "{Binding RSSFeedSelectedCommand}">
<repeater`enter code here`:RepeaterView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation = "Horizontal">
<Image Source = "{Binding Image.Url}"></Image>
<StackLayout Orientation = "Vertical">
<Label Text = "{Binding Title}" TextColor = "Black" />
<Label Text = "{Binding Description}" TextColor = "Black" FontSize = "12" />
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</repeater:RepeaterView.ItemTemplate>
</repeater:RepeaterView>
</StackLayout>
</ViewCell>
</DataTemplate>
</repeater:RepeaterView.ItemTemplate>
</repeater:RepeaterView>





Если мое предположение верно, структура вашего класса должна быть примерно такой,
ViewModel
|__List of Feeds
|__List of Items
|__RSSFeedSelectedCommand
Итак, DataContext вашего внутреннего элемента управления повторителем (MainRepeater2) будет Feed. Итак, попробуйте с DataContext управления внешним повторителем. Нравиться,
<repeater:RepeaterView x:Name = "MainRepeater2" ItemsSource = "{Binding Items}"
SelectedItemCommand = "{Binding DataContext.RSSFeedSelectedCommand,
ElementName=MainRepeater}"/>
Для Xamarin:
<repeater:RepeaterView x:Name = "MainRepeater2" ItemsSource = "{Binding Items}"
SelectedItemCommand = "{Binding DataContext.RSSFeedSelectedCommand,
Source = {x:Reference MainRepeater}}"/>
Повторитель пытался найти команду в Feeds, но существует в ViewModel.
<repeater:RepeaterView x:Name = "MainRepeater2" EmptyText = "No elements" ShowSeparator = "true" SeparatorHeight = "2" SeparatorColor = "Silver" ItemsSource = "{Binding Items}" SelectedItemCommand = "{Binding Source = {x:Reference RSSPage}, Path=BindingContext.RSSFeedSelectedCommand}">
и вы должны назвать страницу:
<ContentPage x:Name = "PageName" />