我正在初始化这样的值:(MahApps.Metro 1.1.3-ALPHA)
private int currentCulture;
public int CurrentCulture
{
get { return currentCulture; }
set
{
if (currentCulture != value)
{
currentCulture = value;
LocalizeDictionary.Instance.Culture = Languages[value];
NotifyOfPropertyChange(() => CurrentCulture);
}
}
}
protected override void OnInitialize()
{
base.OnInitialize();
Languages.AddRange(BS.Expert.Client.App.Utils.Resources.GetAvailableCultures());
CurrentCulture = Languages.IndexOf(new CultureInfo(LocalizeDictionary.Instance.Culture.Name));
...
问题是当视图启动时我没有看到 dropDown mahApps 控件中设置的值......,这是怎么回事?
<Controls:SplitButton
Orientation="Horizontal"
x:Name="Languages"
cal:Message.Attach="[Event SelectionChanged] = [Action ChangeCulture($eventArgs)]"
DisplayMemberPath="DisplayName"
SelectedIndex="{Binding CurrentCulture, ElementName=SplitButton0, Mode=TwoWay}" >
</Controls:SplitButton>