-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.net core 3 build 9748 has fixed the type converter and inheritance issues
- Loading branch information
1 parent
5976a1e
commit 8cf7727
Showing
17 changed files
with
133 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Infragistics.Controls.Editors; | ||
using Infragistics.Documents.RichText; | ||
using Infragistics.Documents.RichText.Rtf; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Text; | ||
using System.Windows; | ||
|
||
namespace IgOutlook.Core.Controls | ||
{ | ||
public class XamRichTextEditorBehavior : DependencyObject | ||
{ | ||
#region InsertRtfContent | ||
|
||
public static readonly DependencyProperty InsertRtfContentProperty = DependencyProperty.RegisterAttached("InsertRtfContent", typeof(string), typeof(XamRichTextEditorBehavior), new PropertyMetadata(null, OnInsertRtfContentChanged)); | ||
|
||
public static void SetInsertRtfContent(XamRichTextEditor editor, object value) | ||
{ | ||
editor.SetValue(InsertRtfContentProperty, value); | ||
} | ||
|
||
public static string GetInsertRtfContent(XamRichTextEditor editor) | ||
{ | ||
return editor.GetValue(InsertRtfContentProperty) as string; | ||
} | ||
|
||
private static void OnInsertRtfContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
{ | ||
XamRichTextEditor editor = (XamRichTextEditor)d; | ||
editor.DocumentContentChanged -= Document_ContentChanged; | ||
editor.DocumentContentChanged += Document_ContentChanged; | ||
} | ||
|
||
static void Document_ContentChanged(object sender, DocumentContentChangedEventArgs e) | ||
{ | ||
if (e.ChangeType == Infragistics.Documents.RichText.DocumentChangeType.Content) | ||
{ | ||
var xamRichTextEditor = sender as XamRichTextEditor; | ||
|
||
xamRichTextEditor.DocumentContentChanged -= Document_ContentChanged; | ||
|
||
var rtfString = (string)xamRichTextEditor.GetValue(XamRichTextEditorBehavior.InsertRtfContentProperty); | ||
|
||
RichTextDocument doc = new RichTextDocument(); | ||
var stream = new MemoryStream(Encoding.UTF8.GetBytes(rtfString)); | ||
doc.LoadFromRtf(stream); | ||
|
||
string error; | ||
|
||
xamRichTextEditor.Document.InsertContent(0, doc.RootNode, out error, true, true); | ||
} | ||
} | ||
|
||
#endregion //InsertRtfContent | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
IgOutlook.Modules.Calendar/Converters/XamDateNavigatorSelectedDatesConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Infragistics.Controls.Editors; | ||
using Infragistics.Controls.Schedules; | ||
using System; | ||
using System.Collections.ObjectModel; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace IgOutlook.Modules.Calendar.Converters | ||
{ | ||
public class XamDateNavigatorSelectedDatesConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var dateNav = parameter as XamDateNavigator; | ||
if (dateNav != null) | ||
return new ObservableCollection<DateTime>(dateNav.SelectedDates); | ||
|
||
else | ||
{ | ||
var args = (SelectedDatesChangedEventArgs)value; | ||
return new ObservableCollection<DateTime>(args.AddedDates); | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.