Beispiel #1
0
        private void DoAddStuff()
        {
            if (!Validate())
            {
                return;
            }

            // if Validate is happy, create an ItemOfStuff to be added to the inbox
            // TODO: Hard coded to Trusted System 1 for now.

            var itemOfStuff = new ItemOfStuff()
            {
                TrustedSystemId  = "1", StuffId = Guid.NewGuid().ToString(),
                StuffDescription = StuffDescription,
                TimeUtc          = DateTime.UtcNow
            };

            // time to store it
            _inboxService.AddStuffToInbox(itemOfStuff);

            // probably want to close our own ViewModel after
            // the "Add Screen" has finished with its purpose, adding stuff
            // uses the Close method on the MvxNavigatingObject base class to close our MvxViewModel.
            // Close TRIES (can't guarantee it) within the platform-specific UI View layer to close
            // the current ViewModel. // TODO more on that later, depends on how you design UI.
            // Close sends a msg to the UI Layer and asks,
            // "Can you close the View that Corresponds to this ViewModel?" and makes best effort to do it.
            // On closure the previous ViewModel on nav stack should be displayed (likely InboxViewModel)
            Close(this);
        }