Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
Dim p = Product.GetProducts(50)
_flex.ItemsSource = p
'グリッドのスタイルを設定します
_flex.Rows.Frozen = 1
_flex.Columns.Frozen = 1
_flex.Background = Brushes.YellowGreen
_flex.Rows(0).Foreground = Brushes.Red
_flex.Rows(0).Background = Brushes.Yellow
End Sub
Private Sub Save_Click(sender As Object, e As RoutedEventArgs)
Dim settings As New XmlWriterSettings()
settings.Indent = True
settings.IndentChars = vbTab
Dim writer As XmlWriter = XmlWriter.Create("products.xml", settings)
_flex.SaveColumnLayout(writer)
writer.Close()
MessageBox.Show("正常に保存しました!")
End Sub
Private Sub Load_Click(sender As Object, e As RoutedEventArgs)
Dim reader As XmlReader = XmlReader.Create("products.xml")
_flex.LoadColumnLayout(reader)
reader.Close()
End Sub
End Class