protected override void OnNavigatedTo(NavigationEventArgs e) { _lastArgs = e.Parameter as MalMessageDetailsNavArgs; if (_lastArgs.WorkMode == MessageDetailsWorkMode.Message) ViewModelLocator.NavMgr.RegisterBackNav(PageIndex.PageMessanging, null); else ViewModelLocator.NavMgr.RegisterBackNav(PageIndex.PageProfile, new ProfilePageNavigationArgs {TargetUser = MobileViewModelLocator.ProfilePage.CurrentData.User.Name}); base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(NavigationEventArgs e) { _lastArgs = e.Parameter as MalMessageDetailsNavArgs; base.OnNavigatedTo(e); }
public async void Init(MalMessageDetailsNavArgs args,bool force = false) { if (args.WorkMode == MessageDetailsWorkMode.Message) { var arg = args.Arg as MalMessageModel; if (arg == null) //compose new { _newMessage = true; MessageSet.Clear(); NewMessageFieldsVisibility = true; return; } NewMessageFieldsVisibility = false; _newMessage = false; if (!force &&_prevMsg?.Id == arg.Id) return; _prevMsg = arg; MessageSet.Clear(); LoadingVisibility = true; if (MessageThreads.ContainsKey(arg.ThreadId)) { MessageSet.AddRange(MessageThreads[arg.ThreadId]); } else { var msgs = await new MalMessageDetailsQuery().GetMessagesInThread(arg); msgs.Reverse(); MessageSet.AddRange(msgs); } } else { NewMessageFieldsVisibility = false; var arg = args.Arg as MalComment; if(!force && arg.ComToCom == (_prevArgs?.Arg as MalComment)?.ComToCom) return; _prevMsg = null; LoadingVisibility = true; MessageSet.Clear(); MessageSet = new SmartObservableCollection<MalMessageModel>( (await ProfileCommentQueries.GetComToComMessages(arg.ComToCom))); RaisePropertyChanged(() => MessageSet); } _prevArgs = args; LoadingVisibility = false; }