/// <summary>
 /// Method will be called when the view is attached to the window
 /// </summary>
 /// <param name="bindable">SampleView type parameter as bindable</param>
 protected override void OnAttachedTo(ContentPage bindable)
 {
     this.sfChat    = bindable.FindByName <SfChat>("sfChat");
     this.viewModel = bindable.FindByName <FlightBookingViewModel>("viewModel");
     this.viewModel.Messages.CollectionChanged += OnMessagesCollectionChanged;
     base.OnAttachedTo(bindable);
 }
 /// <summary>
 /// Method will be called when the view is detached from window
 /// </summary>
 /// <param name="bindable">SampleView type of bindAble parameter</param>
 protected override void OnDetachingFrom(ContentPage bindable)
 {
     this.viewModel.Messages.CollectionChanged -= OnMessagesCollectionChanged;
     Connectivity.ConnectivityChanged          -= this.viewModel.BotService.OnConnectivityChanged;
     this.sfChat    = null;
     this.viewModel = null;
     base.OnDetachingFrom(bindable);
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of <see cref="BotService"/> class.
 /// </summary>
 /// <param name="viewModel">view model as paramter.</param>
 public BotService(FlightBookingViewModel viewModel)
 {
     this.ViewModel = viewModel;
     InitializeHttpConnection();
 }