'宣言 Public Shared ReadOnly SaveInLayoutProperty As DependencyProperty
public static readonly DependencyProperty SaveInLayoutProperty
Imports Infragistics.Windows.DockManager Private Const LayoutPath As String = "C:\layout.xml" Private Sub mnuSaveToFile_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Using stream As System.IO.Stream = New System.IO.FileStream(LayoutPath, System.IO.FileMode.Create) Me.dmLoadFile.SaveLayout(stream) End Using End Sub Private Sub mnuLoadFromFile_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) If System.IO.File.Exists(LayoutPath) Then Using stream As System.IO.Stream = New System.IO.FileStream(LayoutPath, System.IO.FileMode.Open) Me.dmLoadFile.LoadLayout(stream) End Using End If End Sub
using Infragistics.Windows.DockManager; private const string LayoutPath = @"C:\layout.xml"; private void mnuSaveToFile_Click(object sender, RoutedEventArgs e) { using (System.IO.Stream stream = new System.IO.FileStream(LayoutPath, System.IO.FileMode.Create)) this.dmLoadFile.SaveLayout(stream); } private void mnuLoadFromFile_Click(object sender, RoutedEventArgs e) { if (System.IO.File.Exists(LayoutPath)) { using (System.IO.Stream stream = new System.IO.FileStream(LayoutPath, System.IO.FileMode.Open)) this.dmLoadFile.LoadLayout(stream); } }