<Window x:Class="WPFGridTest.MainWindow" ="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ="ht ...
<Window x:Class="WPFGridTest.MainWindow" ="http://schemas.microsoft.com/get='_blank'>winfx/2006/xaml/presentation" ="http://schemas.microsoft.com/winfx/2006/xaml" ="http://schemas.devexpress.com/winfx/2008/xaml/grid" ="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" ="http://schemas.devexpress.com/winfx/2008/xaml/editors" ="http://schemas.devexpress.com/winfx/2008/xaml/core" ="http://schemas.devexpress.com/winfx/2008/xaml/bars" ="http://schemas.microsoft.com/expression/2010/interactivity" ="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" ="clr-namespace:WPFGridTest" Title="MainWindow" Height="350" Width="525"> <Window.DataContext> <local:VM/> </Window.DataContext> <Window.Resources> <local:SaveRestoreCommands x:Key="saveRestoreLayoutCommands" Path="1./> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal"> <Button Content="Save" Command="{Binding Path=SaveLayoutCommand, Source={StaticResource saveRestoreLayoutCommands}}" CommandParameter="{Binding ElementName= g}"/> <Button Content="Restore" Command="{Binding Path=RestoreLayoutCommand, Source={StaticResource saveRestoreLayoutCommands}}" CommandParameter="{Binding ElementName=g}"/> </StackPanel> <dxg:GridControl x:Name="g" Grid.Row="1" ItemsSource="{Binding Source}"> <dxg:GridControl.View> <dxg:TableView x:Name="v"/> </dxg:GridControl.View> <dxg:GridControl.Columns> <dxg:GridColumn x:Name="c1" FieldName="ID"/> <dxg:GridColumn x:Name="c2" FieldName="Value"/> </dxg:GridControl.Columns> </dxg:GridControl> </Grid></Window>
原标题:Saving Grid(Dev Express) Layout with MVVM(code from DevExpress support)
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。