Table of Contents

Property Source

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

Source

Gets or sets form designer Source.

[Browsable(false)]
public IFormDesignerBaseDataSource Source { get; set; }

Property Value

IFormDesignerBaseDataSource

Examples

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

using System;

using Alternet.FormDesigner.Wpf;

public partial class MainWindow : Window
{
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var formDesigner = new FormDesignerControl();
        formDesigner.AutoSaveToSource = false;
        string xamlFileName = "myForm.xaml";
        var language = new Language(SupportedLanguages.VisualBasic, ".vb");
        var source = new FormDesignerDataSource(xamlFileName, language);
        formDesigner.Source = new FormDesignerDataSource(xamlFileName, language);
    }
}

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

Imports System

Imports Alternet.FormDesigner.Wpf

Partial Public Class MainWindow
    Inherits Window
    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim formDesigner = New FormDesignerControl()
        formDesigner.AutoSaveToSource = False
        Dim xamlFileName = "myForm.xaml"
        Dim language = New Language(SupportedLanguages.VisualBasic, ".vb")
        Dim source = New FormDesignerDataSource(xamlFileName, language)
        formDesigner.Source = New FormDesignerDataSource(xamlFileName, language)
    End Sub
End Class

Remarks

You can use one of the existing implementations of IFormDesignerBaseDataSource interface, to load/save the form designer content directly to the file, or translate it to the code editor; or provide own implementation of IFormDesignerBaseDataSource interface.