I have WPF listbox:
<ListBox Name="FileDownloads" SelectionMode="Extended">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Name="Url" Text="{Binding Url}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
I like the ability to bind ListBox by name from code behind using:
this.OneWayBind(ViewModel, vm => vm.DownloadManager.FileDownloads, v => v.FileDownloads.ItemsSource);
Having binding in code-behind helps with refactoring.
Is there any way to bind Url texbox inside the listbox using code-behind?
Splat.Locator.CurrentMutable.Register(() => new FileDownloadControl(), typeof(IViewFor<FileDownload>));
notSplat.Locator.CurrentMutable.Register(typeof(FileDownloadControl), typeof(IViewFor<FileDownload>));
– Tournament