Table of Contents

Property IsSmartDiffCodeSerializationRequired

Namespace
Alternet.FormDesigner.Wpf
Assembly
Alternet.FormDesigner.Wpf.v10.dll

IsSmartDiffCodeSerializationRequired

Gets or sets method used to identify whether FormDesignerControl content should be saved only by taking into account code difference.

[Browsable(false)]
public Func<IFormDesignerControl, bool> IsSmartDiffCodeSerializationRequired { get; set; }

Property Value

Func<IFormDesignerControl, bool>

Examples

Here is how to use a IsSmartDiffCodeSerializationRequired in the C# code:

using System;

using Alternet.Editor.Wpf;

public partial class MainWindow : Window
{
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var formDesigner = new Alternet.FormDesigner.Wpf.FormDesignerControl();
        formDesigner.IsSmartDiffCodeSerializationRequired = d => ((ITextSource)((EditorFormDesignerDataSource)d.Source).XamlTextSource).Edits.Any();
    }
}

Here is how to use a IsSmartDiffCodeSerializationRequired in the Visual Basic code:

Imports System
Imports Alternet.Editor.Wpf

Partial Public Class MainWindow
    Inherits Window

    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim formDesigner = New Alternet.FormDesigner.Wpf.FormDesignerControl()
        formDesigner.IsSmartDiffCodeSerializationRequired = Function(d) (CType((CType(d.Source, EditorFormDesignerDataSource)).XamlTextSource, ITextSource)).Edits.Any()
    End Sub
End Class

Remarks

When the Form Designer's content is changed and AutoSaveToSource is true, Form Designer attempts to save its content to the source automatically. IsSmartDiffCodeSerializationRequired allows you to specify whether the designer should translate a list of changes to the underlying source file rather than the entire content. This is particularly useful when the source of the designed form is displayed in the code editor, making changed lines clearly marked.