예제 #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();
            }
        }
예제 #2
0
        private async void resolverImageAddBtn_Click(object sender, RoutedEventArgs e)
        {
            await this.ShowOverlayAsync();

            ImageResolverForm irf = new ImageResolverForm((name, src, fullSrc) =>
            {
                SelectedQuestion.Resolvers.Add(new ImageResolver()
                {
                    Name = name, ImageSrc = src, FullImageSrc = fullSrc
                });
            }, _current.Root.ID);

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