Interaction logic for BitlyLoginView.xaml
コード例 #1
0
        private Task<string> setupView_Closed(BitlyLoginView view, String Url)
        {
            if (view.ModalResult != true) return null;
            Credentials = view.Credentials;
            var _eventAggregator = CompositionManager.Get<IEventAggregator>();
            _eventAggregator.GetEvent<UrlShortenerAdded>().Publish(this);

            return Shorten(Url);
        }
コード例 #2
0
        private void ShowSettings(string Url)
        {
            var plugins = CompositionManager.Get<IPluginRepository>();
            IUrlShortener bitlyPlugin = plugins.UrlShorteners.FirstOrDefault(t => t.Protocol == Protocol);

            if (Credentials == null && bitlyPlugin != null)
                Credentials = bitlyPlugin.Credentials;

            var setupView = new BitlyLoginView(Credentials);
            setupView.Closed += (s, e) => setupView_Closed(setupView, Url);
            var _eventAggregator = CompositionManager.Get<IEventAggregator>();
            _eventAggregator.Show(setupView);
        }