【问题标题】:XAML ExtendedPicker - invoke code in a ViewModelXAML ExtendedPicker - 在 ViewModel 中调用代码
【发布时间】:2017-05-23 12:26:09
【问题描述】:

有没有办法更改此 ExtendedPicker 以便在用户更改选择数据时调用 ViewModel 中的 MyCode()?

<controls:ExtendedPicker 
        Style="{StaticResource FormEntry}" 
        x:Name="carTypePicker" 
        Picker.Title="{i18n:Translate SelectCar}" 
        ItemsSource="{Binding carTypes}" 
        DisplayProperty="Name" SelectedItem="{Binding SelectedCarType, Mode=TwoWay}">
</controls:ExtendedPicker>

【问题讨论】:

    标签: visual-studio xaml xamarin mvvm xamarin.forms


    【解决方案1】:

    你不能只从SelectedCarType 属性的设置器中调用MyCode() 吗?:

    private YourType _selectedCarType;
    public YourType SelectedCarType
    {
        get { return _canFilterByOrderId; }
        set { _selectedCarType = value; MyCode(); }
    }
    

    【讨论】:

      猜你喜欢
      • 2013-09-18
      • 2011-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-11
      • 2012-01-29
      • 2014-02-15
      相关资源
      最近更新 更多