• HOME
  • PRODUCTS
  • DEMOS
  • DOWNLOAD
  • BUY
  • BLOG
  • FORUM
  • DOCUMENTATION
  • ABOUT
Search Results for

    Show / Hide Table of Contents

    Source Property

    Source

    Gets or sets form designer Source.

    Declaration
    [Browsable(false)]
    public IFormDesignerBaseDataSource Source { get; set; }
    Property Value
    Type Description
    IFormDesignerBaseDataSource
    Implements
    IFormDesignerControl.Source
    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.

    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
    
    In This Article
    Back to top Copyright AlterNET Software Download PDF