Files
BeWoPlaner/BeWo/View/Document/RtfEditView.xaml.cs

95 lines
2.2 KiB
C#
Raw Normal View History

2025-04-17 01:11:16 +02:00
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using BeWo.Controls;
using BeWo.Core;
using BeWo.ServiceProxy;
using BeWo.Validation;
using BeWo.View.Search;
using BeWo.ViewModel;
using BeWo.ViewModel.ListViewModel;
using BeWo.Core.Service;
using BS.Shared;
using BS.Shared.Extensions;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.ClientPartials;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Translation;
using DevExpress.Xpf.RichEdit;
using SupportConceptService = BeWo.Core.Service.SupportConceptService;
using DevExpress.XtraRichEdit.API.Native;
using System.Drawing;
using DevExpress.Office.Utils;
using System.Windows.Media.Imaging;
namespace BeWo.View.Document
{
public partial class RtfEditView
{
2025-04-17 01:11:16 +02:00
public event Action ButtonSavedClicked;
public event Action ButtonCancelClicked;
public RtfEditView()
{
InitializeComponent();
}
2025-04-17 01:11:16 +02:00
public void InitView(String rtfText)
2025-04-17 01:11:16 +02:00
{
InitializeComponent();
RtfText = rtfText;
2025-04-17 01:11:16 +02:00
Focus();
}
public String RtfText
2025-04-17 01:11:16 +02:00
{
get
2025-04-17 01:11:16 +02:00
{
return EditorControl.RtfText;
2025-04-17 01:11:16 +02:00
}
set
2025-04-17 01:11:16 +02:00
{
EditorControl.RtfText = value;
2025-04-17 01:11:16 +02:00
}
}
private void btnSave_Click(object sender, RoutedEventArgs e)
{
ButtonSavedClicked?.Invoke();
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
bool close = true;
if (MessageBox.Show(
Translator.Translate("Möchten Sie wirklich abbrechen und das Dokument verwerfen?"),
2025-04-17 01:11:16 +02:00
"BeWoPlaner", MessageBoxButton.OKCancel, MessageBoxImage.Question) == MessageBoxResult.Cancel)
{
close = false;
2025-04-17 01:11:16 +02:00
}
2025-04-17 01:11:16 +02:00
if (close)
{
ButtonCancelClicked?.Invoke();
}
}
}
}