Loading...
Loading...
Compare original and translation side by side
IChatInferenceServiceConfigureSyncfusionAIServices()IChatInferenceServiceConfigureSyncfusionAIServices()Install-Package Syncfusion.SfSmartComponents.WPFInstall-Package Syncfusion.SfSmartComponents.WPF<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
x:Class="YourApp.MainWindow">
<Grid>
<syncfusion:SfSmartTextEditor
x:Name="smartTextEditor"
Placeholder="Type your response..."
UserRole="Customer support agent responding to inquiries">
<syncfusion:SfSmartTextEditor.UserPhrases>
<x:String>Thank you for reaching out.</x:String>
<x:String>We'll investigate and get back to you shortly.</x:String>
</syncfusion:SfSmartTextEditor.UserPhrases>
</syncfusion:SfSmartTextEditor>
</Grid>
</Window><Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
x:Class="YourApp.MainWindow">
<Grid>
<syncfusion:SfSmartTextEditor
x:Name="smartTextEditor"
Placeholder="Type your response..."
UserRole="Customer support agent responding to inquiries">
<syncfusion:SfSmartTextEditor.UserPhrases>
<x:String>Thank you for reaching out.</x:String>
<x:String>We'll investigate and get back to you shortly.</x:String>
</syncfusion:SfSmartTextEditor.UserPhrases>
</syncfusion:SfSmartTextEditor>
</Grid>
</Window>using Azure.AI.OpenAI;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;
using Syncfusion.UI.Xaml.SmartComponents;
using System.ClientModel;
using System.Windows;
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Configure Azure OpenAI
string azureApiKey = "<YOUR-API-KEY>";
Uri azureEndpoint = new Uri("<YOUR-ENDPOINT>");
string deploymentName = "<YOUR-DEPLOYMENT>";
AzureOpenAIClient azureClient = new AzureOpenAIClient(
azureEndpoint,
new ApiKeyCredential(azureApiKey)
);
IChatClient chatClient = azureClient
.GetChatClient(deploymentName)
.AsIChatClient();
SyncfusionAIExtension.Services.AddSingleton<IChatClient>(chatClient);
SyncfusionAIExtension.ConfigureSyncfusionAIServices();
}
}using Azure.AI.OpenAI;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;
using Syncfusion.UI.Xaml.SmartComponents;
using System.ClientModel;
using System.Windows;
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Configure Azure OpenAI
string azureApiKey = "<YOUR-API-KEY>";
Uri azureEndpoint = new Uri("<YOUR-ENDPOINT>");
string deploymentName = "<YOUR-DEPLOYMENT>";
AzureOpenAIClient azureClient = new AzureOpenAIClient(
azureEndpoint,
new ApiKeyCredential(azureApiKey)
);
IChatClient chatClient = azureClient
.GetChatClient(deploymentName)
.AsIChatClient();
SyncfusionAIExtension.Services.AddSingleton<IChatClient>(chatClient);
SyncfusionAIExtension.ConfigureSyncfusionAIServices();
}
}<syncfusion:SfSmartTextEditor
Placeholder="Write your response..."
UserRole="Technical support engineer helping customers with product issues"
MaxLength="2000"
SuggestionDisplayMode="Inline">
<syncfusion:SfSmartTextEditor.UserPhrases>
<x:String>Thanks for contacting Syncfusion support.</x:String>
<x:String>Could you please share a reproducible sample?</x:String>
<x:String>We've logged this as a bug and will update you soon.</x:String>
<x:String>Let us know if you need further assistance.</x:String>
</syncfusion:SfSmartTextEditor.UserPhrases>
</syncfusion:SfSmartTextEditor><syncfusion:SfSmartTextEditor
Placeholder="Write your response..."
UserRole="Technical support engineer helping customers with product issues"
MaxLength="2000"
SuggestionDisplayMode="Inline">
<syncfusion:SfSmartTextEditor.UserPhrases>
<x:String>Thanks for contacting Syncfusion support.</x:String>
<x:String>Could you please share a reproducible sample?</x:String>
<x:String>We've logged this as a bug and will update you soon.</x:String>
<x:String>Let us know if you need further assistance.</x:String>
</syncfusion:SfSmartTextEditor.UserPhrases>
</syncfusion:SfSmartTextEditor><syncfusion:SfSmartTextEditor
Placeholder="Compose your email..."
UserRole="Professional email author"
SuggestionDisplayMode="Popup"
MaxLength="5000">
<syncfusion:SfSmartTextEditor.Style>
<Style TargetType="{x:Type syncfusion:SfSmartTextEditor}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="#333333"/>
<Setter Property="FontFamily" Value="Segoe UI"/>
</Style>
</syncfusion:SfSmartTextEditor.Style>
<syncfusion:SfSmartTextEditor.SuggestionPopupStyle>
<Style TargetType="syncfusion:SuggestionPopup">
<Setter Property="Background" Value="#0078D4"/>
<Setter Property="Foreground" Value="White"/>
</Style>
</syncfusion:SfSmartTextEditor.SuggestionPopupStyle>
</syncfusion:SfSmartTextEditor><syncfusion:SfSmartTextEditor
Placeholder="Compose your email..."
UserRole="Professional email author"
SuggestionDisplayMode="Popup"
MaxLength="5000">
<syncfusion:SfSmartTextEditor.Style>
<Style TargetType="{x:Type syncfusion:SfSmartTextEditor}">
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="#333333"/>
<Setter Property="FontFamily" Value="Segoe UI"/>
</Style>
</syncfusion:SfSmartTextEditor.Style>
<syncfusion:SfSmartTextEditor.SuggestionPopupStyle>
<Style TargetType="syncfusion:SuggestionPopup">
<Setter Property="Background" Value="#0078D4"/>
<Setter Property="Foreground" Value="White"/>
</Style>
</syncfusion:SfSmartTextEditor.SuggestionPopupStyle>
</syncfusion:SfSmartTextEditor><syncfusion:SfSmartTextEditor
x:Name="smartTextEditor"
TextChangedCommand="{Binding TextChangedCommand}"
Placeholder="Start typing..."/>public class EditorViewModel : INotifyPropertyChanged
{
public ICommand TextChangedCommand { get; }
public EditorViewModel()
{
TextChangedCommand = new RelayCommand(OnTextChanged);
}
private void OnTextChanged()
{
// Auto-save, validation, or tracking logic
Debug.WriteLine("Text changed - triggering auto-save");
}
}<syncfusion:SfSmartTextEditor
x:Name="smartTextEditor"
TextChangedCommand="{Binding TextChangedCommand}"
Placeholder="Start typing..."/>public class EditorViewModel : INotifyPropertyChanged
{
public ICommand TextChangedCommand { get; }
public EditorViewModel()
{
TextChangedCommand = new RelayCommand(OnTextChanged);
}
private void OnTextChanged()
{
// Auto-save, validation, or tracking logic
Debug.WriteLine("Text changed - triggering auto-save");
}
}<syncfusion:SfSmartTextEditor
Placeholder="Type your message..."
UserRole="Sales representative responding to leads">
<syncfusion:SfSmartTextEditor.UserPhrases>
<x:String>Thank you for your interest in our products.</x:String>
<x:String>I'd be happy to schedule a demo.</x:String>
<x:String>Our pricing starts at $99 per month.</x:String>
<x:String>Let me connect you with our solutions team.</x:String>
<x:String>Feel free to reach out with any questions.</x:String>
</syncfusion:SfSmartTextEditor.UserPhrases>
</syncfusion:SfSmartTextEditor><syncfusion:SfSmartTextEditor
Placeholder="Type your message..."
UserRole="Sales representative responding to leads">
<syncfusion:SfSmartTextEditor.UserPhrases>
<x:String>Thank you for your interest in our products.</x:String>
<x:String>I'd be happy to schedule a demo.</x:String>
<x:String>Our pricing starts at $99 per month.</x:String>
<x:String>Let me connect you with our solutions team.</x:String>
<x:String>Feel free to reach out with any questions.</x:String>
</syncfusion:SfSmartTextEditor.UserPhrases>
</syncfusion:SfSmartTextEditor>| Property | Type | Description | Default |
|---|---|---|---|
| | Gets or sets the text content | |
| | Placeholder text when editor is empty | |
| | Describes who is typing and intent (shapes AI suggestions) | |
| | Custom phrase library for offline suggestions | |
| | Display mode: | |
| | Maximum character limit | |
| | Command triggered when text changes | |
| | Text style (FontSize, Foreground, etc.) | Default |
| | Placeholder styling | Default |
| | Inline suggestion text style | Default |
| | Popup suggestion background style | Default |
| 属性 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| | 获取或设置文本内容 | |
| | 编辑器为空时的占位符文本 | |
| | 描述输入者身份和意图(影响AI建议) | |
| | 用于离线建议的自定义短语库 | |
| | 显示模式: | |
| | 最大字符限制 | |
| | 文本变更时触发的命令 | |
| | 文本样式(FontSize、Foreground等) | 默认样式 |
| | 占位符样式 | 默认样式 |
| | 内联建议文本样式 | 默认样式 |
| | 弹窗建议背景样式 | 默认样式 |
SuggestionDisplayMode="Inline"SuggestionDisplayMode="Inline"SuggestionDisplayMode="Popup"SuggestionDisplayMode="Popup"AzureOpenAIClientAzureOpenAIClientIChatInferenceServiceIChatInferenceServiceMaxLengthMaxLengthTextChangedCommandTextChangedCommandUserPhrasesUserPhrasesStylePlaceholderStyleSuggestionInlineStyleStylePlaceholderStyleSuggestionInlineStyle