public NotificationDetailPage(NotificationItem notification)
        {
            InitializeComponent();

            this.ViewModel = new NotificationDetailPageViewModel(notification)
            {
                Title = this.Title
            };
            this.BindingContext = this.ViewModel;
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if (e.NavigationMode == NavigationMode.New)
            {
                object[] parameters = e.Parameter as object[];
                if (parameters[0] != null)
                {
                    Notification notification = parameters[0] as Notification;

                    this.DataContext = _viewModel = new NotificationDetailPageViewModel(notification.ObjectId);
                }
            }
        }
        public NotificationDetailPage(NotificationModel notification, int index)
        {
            NavigationPage.SetHasNavigationBar(this, false);

            _index        = index;
            _notification = notification;

            _model = new NotificationDetailPageViewModel
            {
                Loading       = true,
                Notification  = notification,
                ShowGoDetails = !string.IsNullOrEmpty(notification.ContentId) && notification.ContentId != "0"
            };

            this.BindingContext = _model;

            // Mark as read
            notification.TextStyle = FontAttributes.None;
            notification.Header    = "";
            AsyncHelper.RunSync(() => NotificationsStore.Instance.SetNotificationRead(notification.Id));

            InitializeComponent();
        }