Exemple #1
0
        private async void resolverEditBtn_Click(object sender, RoutedEventArgs e)
        {
            await this.ShowOverlayAsync();

            if (SelectedResolver is TextResolver)
            {
                TextResolverForm trf = new TextResolverForm((name, content) =>
                {
                    SelectedResolver.Name = name;
                    (SelectedResolver as TextResolver).Content = content;
                }, SelectedResolver.Name, (SelectedResolver as TextResolver).Content);
                trf.Closed += async(a, b) => { await this.HideOverlayAsync(); this.Activate(); };
                trf.Owner   = this;
                trf.Show();
            }
            else if (SelectedResolver is ImageResolver)
            {
                ImageResolverForm irf = new ImageResolverForm((name, src, fullSrc) =>
                {
                    SelectedResolver.Name = name;
                    (SelectedResolver as ImageResolver).ImageSrc     = src;
                    (SelectedResolver as ImageResolver).FullImageSrc = fullSrc;
                }, _current.Root.ID, SelectedResolver.Name, (SelectedResolver as ImageResolver).ImageSrc, (SelectedResolver as ImageResolver).FullImageSrc);
                irf.Closed += async(a, b) => { await this.HideOverlayAsync(); this.Activate(); };
                irf.Owner   = this;
                irf.Show();
            }
        }
Exemple #2
0
        private async void resolverTextAddBtn_Click(object sender, RoutedEventArgs e)
        {
            await this.ShowOverlayAsync();

            TextResolverForm trf = new TextResolverForm((name, content) =>
            {
                SelectedQuestion.Resolvers.Add(new TextResolver()
                {
                    Name = name, Content = content
                });
            });

            trf.Closed += async(a, b) => { await this.HideOverlayAsync(); this.Activate(); };
            trf.Owner   = this;
            trf.Show();
        }