Ejemplo n.º 1
0
        private void EnterData_DialogClosing(object sender, DialogClosingEventArgs eventArgs)
        {
            if (Equals(eventArgs.Parameter, false))
            {
                return;
            }

            if (!(eventArgs.Parameter is EnterDataViewModel enterDataViewModel))
            {
                return;
            }

            string googleDriveFilename = enterDataViewModel.Name;

            if (string.IsNullOrWhiteSpace(googleDriveFilename))
            {
                eventArgs.Cancel();
                return;
            }

            var thingsData = ThingsDataToAppraise.Create(
                DataSource.GoogleDrive, googleDriveFilename
                );

            _eventAggregator
            .GetEvent <AppraiseGoogleDriveThingsFileMessage>()
            .Publish(thingsData);
        }
Ejemplo n.º 2
0
        private void InputThing_DialogClosing(object sender, DialogClosingEventArgs eventArgs)
        {
            if (Equals(eventArgs.Parameter, false))
            {
                return;
            }

            if (!(eventArgs.Parameter is InputThingViewModel inputThingViewModel))
            {
                return;
            }

            IReadOnlyList <string> thingList = inputThingViewModel.ThingList.ToReadOnlyList();

            if (thingList.IsNullOrEmpty())
            {
                return;
            }

            var thingsData = ThingsDataToAppraise.Create(
                DataSource.InputThing, "User input", thingList
                );

            _eventAggregator
            .GetEvent <AppraiseInputThingsMessage>()
            .Publish(thingsData);
        }