Files
29WxOrder/Main.Test/MainWindow.xaml
T
2026-10-21 17:11:24 +08:00

62 lines
2.0 KiB
XML

<tf:WindowBase
x:Class="Main.Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:Main.Test"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tf="Trade.Framework"
xmlns:views="clr-namespace:Main.Test.Views"
xmlns:vm="clr-namespace:Main.Test.ViewModels"
Title="MainWindow"
Width="800"
Height="450"
DataContext="{tf:DISource Type=vm:MainViewModel}"
ResizeMode="CanResizeWithGrip"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid Margin="0,0,0,0">
<local:StyledDataGrid
Height="Auto"
d:ItemsSource="{d:SampleData ItemCount=10}"
local:DataGridHelper.ShowBorder="False"
GridLinesVisibility="All"
ItemsSource="{Binding Data}"
SelectedRowForeground="White"
SelectionMode="Extended"
ShowCheckBox="True"
ShowRowNumber="True">
<local:StyledDataGrid.Columns>
<DataGridTextColumn
Width="1*"
MinWidth="100"
Binding="{Binding Code, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Header="编码"
IsReadOnly="True" />
<DataGridTextColumn
Width="1*"
MinWidth="100"
Binding="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Header="名称"
IsReadOnly="True" />
<DataGridTextColumn
Width="1*"
MinWidth="100"
Binding="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Header="值"
IsReadOnly="True" />
<DataGridTextColumn
Width="1*"
MinWidth="100"
Binding="{Binding Qty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
CellStyle="{DynamicResource StyledNumberCellStyle}"
Header="数字"
HeaderStyle="{DynamicResource DefaultNumberCellHeaderStyle}"
IsReadOnly="True" />
</local:StyledDataGrid.Columns>
</local:StyledDataGrid>
</Grid>
</tf:WindowBase>