ItemsControl ItemTemplate Binding

Are you sure the code you posted here IS the code you use in your solution? Because, this code works for me : XAML <ItemsControl ItemsSource=”{Binding}”> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text=”{Binding OwnerData.OwnerName}”></TextBlock> <TextBlock Text=”{Binding Credit}” /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> Window’s Loaded Event ObservableCollection<ForDisplay> items = new ObservableCollection<ForDisplay>(); for (int i = 0; i < … Read more

Binding ElementName. Does it use Visual Tree or Logical Tree

I think it’s logical tree. When using ControlTemplates, you’re replacing one visual tree with another, but I don’t think you can reference the names defined inside of the ControlTemplate. For example: <Page xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”> <Grid> <Grid.Resources> <ControlTemplate x:Key=”Foo” TargetType=”Button”> <Border x:Name=”border” Background=”Red”> <Label Content=”{TemplateBinding Content}”></Label> </Border> </ControlTemplate> </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <Button x:Name=”buttonFoo” Background=”Green” … Read more

WPF binding with StringFormat doesn’t work on ToolTips

ToolTips in WPF can contain anything, not just text, so they provide a ContentStringFormat property for the times you just want text. You’ll need to use the expanded syntax as far as I know: <TextBox …> <TextBox.ToolTip> <ToolTip Content=”{Binding ElementName=myTextBlock,Path=Text}” ContentStringFormat=”{}It is: {0}” /> </TextBox.ToolTip> </TextBox> I’m not 100% sure about the validity of binding … Read more

MvvmCross Android – Alternative to RelativeSource binding for button command

See the second option in the answer in MVVMCross changing ViewModel within a MvxBindableListView – this covers one way to do this. Using that approach you’d expose a list of objects like: public class Wrapped { public ICommand GoThruCommand { get; set; } public ICommand OpenCommand { get; set; } public string Name { get; … Read more