xamarin/Xamarin.Forms
[Bug] Data binding an array item of type enum is incorrect
开放
#5,919 创建于 2019年4月15日
a/binding ⛓e/3 :clock3:help wantedinactivet/bug :bug:up-for-grabs
仓库指标
- 星标
- (5,644 个星标)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
Description
When binding to a particular index in an array, the result is different that if it was a property.
Steps to Reproduce
Given an enum:
public enum Player {
Nobody,
X,
O
}
And 2 properties:
public Player[] Board { get; }
public Player CurrentPlayer { get; set; }
If I add a databinding:
Text="{Binding CurrentPlayer}"
The value will either be "X", "O" or "Nobody". If I bind to an array item:
Text="{Binding Board[1]}"
The value will be "0", "1", or "2".
Expected Behavior
The array data binding uses .ToString().
Actual Behavior
The array binding uses some integer representation.
Basic Information
- Version with issue: 3.6.0.293080
- Last known good version: (not sure)
- IDE: VS 2019
- Platform Target Frameworks:
- iOS:
- Android:
- UWP:
- Android Support Library Version:
- Nuget Packages:
- Affected Devices: