1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using PDF_Master.Helper;
- using Prism.Commands;
- using Prism.Mvvm;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
- {
- public class ChatGPTAIRewritingContentViewModel : BindableBase
- {
- private string inputText;
- public string InputText
- {
- get { return inputText; }
- set
- {
- SetProperty(ref inputText, value);
- }
- }
- private string rewriteText;
- public string RewriteText
- {
- get { return rewriteText; }
- set
- {
- SetProperty(ref rewriteText, value);
- }
- }
- public DelegateCommand CopyCommand { get; set; }
- public DelegateCommand RewriteCommand { get; set; }
- public ChatGPTAIRewritingContentViewModel()
- {
- CopyCommand = new DelegateCommand(copy);
- RewriteCommand = new DelegateCommand(rewrite);
- }
- public void copy()
- {
- try
- {
- Clipboard.SetText(RewriteText);
- }
- catch { }
- }
- public async void rewrite() {
- await Task.Run(async delegate
- {
- RewriteText = await ChatGTPAIHelper.Rewrite(InputText);
- });
- }
- }
- }
|