Binding Problem RRS feed

  • Question

  • HI 

    I'm a newbie to XAML

    When I use Windows Azure table storage, I need to use DynamicTableEntity class which is:

        public sealed class DynamicTableEntity : ITableEntity
            public DynamicTableEntity();
            public DynamicTableEntity(string partitionKey, string rowKey);
            public DynamicTableEntity(string partitionKey, string rowKey, string etag, IDictionary<string, EntityProperty> properties);
            public string ETag { get; set; }
            public string PartitionKey { get; set; }
            public IDictionary<string, EntityProperty> Properties { get; set; }
            public string RowKey { get; set; }
            public DateTimeOffset Timestamp { get; set; }
            public void ReadEntity(IDictionary<string, EntityProperty> properties, OperationContext operationContext);
            public IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext);

    I would like to bind Properties[1].Value.StringValue to a text

    so I write the code below:

     <ListView x:Name="lstEntities" HorizontalAlignment="Left" Height="504" Margin="34,153,0,0" VerticalAlignment="Top" Width="1267">
                        <StackPanel Orientation="Vertical" Margin="5,0">
                            <TextBlock Text="{Binding Path=Properties[1].Value.StringValue}" FontSize="24" FontWeight="Bold"/>
                            <TextBlock Text="{Binding PartitionKey}" TextWrapping="Wrap" />

    But it doesn't work..

    What should I do?


    Please mark post as answered if it helped!

    • Edited by Yuan2013 Sunday, March 9, 2014 12:04 PM
    Sunday, March 9, 2014 11:58 AM


  • Bind the textblock to the properties.  Use an IValueConverter to return the value for properties[1].Value.StringValue
    • Marked as answer by Anne Jing Monday, March 17, 2014 1:58 AM
    Sunday, March 9, 2014 12:32 PM