private void OnTabsNavigated(object sender, NavigationEventArgs e) { if (_list != null) { _list.PropertyChanged -= OnListPropertyChanged; } if (_choosing != null) { _choosing.ItemChosen -= OnItemChosen; } var content = ((ModernTab)sender).Frame.Content; _list = content as ISelectedItemPage <AcObjectNew>; _choosing = content as IChoosingItemControl <AcObjectNew>; if (_list != null) { _list.SelectedItem = Model.SelectedTrackConfiguration?.MainTrackObject; _list.PropertyChanged += OnListPropertyChanged; } if (_choosing != null) { _choosing.ItemChosen += OnItemChosen; } if (content is AcObjectSelectList) { UpdateHint(); } }
private void OnTabsNavigated(object sender, NavigationEventArgs e) { if (_list != null) { _list.PropertyChanged -= List_PropertyChanged; } if (_choosing != null) { _choosing.ItemChosen -= Choosing_ItemChosen; } var content = ((ModernTab)sender).Frame.Content; _list = content as ISelectedItemPage <AcObjectNew>; _choosing = content as IChoosingItemControl <AcObjectNew>; if (_list != null) { _list.SelectedItem = SelectedCar; _list.PropertyChanged += List_PropertyChanged; } if (_choosing != null) { _choosing.ItemChosen += Choosing_ItemChosen; } }
private void Tabs_OnNavigated(object sender, NavigationEventArgs e) { if (_list != null) { _list.PropertyChanged -= List_PropertyChanged; } if (_choosing != null) { _choosing.ItemChosen -= Choosing_ItemChosen; } var content = ((ModernTab)sender).Frame.Content; _list = content as ISelectedItemPage<AcObjectNew>; _choosing = content as IChoosingItemControl<AcObjectNew>; if (_list != null) { _list.SelectedItem = Model.SelectedTrackConfiguration?.MainTrackObject; _list.PropertyChanged += List_PropertyChanged; } if (_choosing != null) { _choosing.ItemChosen += Choosing_ItemChosen; } }