Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
3.9 kB
2
Indexable
Never
<ListView x:Name="InfoListView" 
                                  DataContext="{Binding}"
                                  Visibility="Visible"
                                  ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="Тип увеломления" Width="60">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock FontWeight="Bold" FontSize="16" TextWrapping="Wrap" Text="{Binding InfoType}" />
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Header="Дата время" Width="100">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock TextWrapping="Wrap" Text="{Binding DateTime, StringFormat=dd/MM/yyyy HH:mm:ss}" />
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridViewColumn Header="Сообщение" Width="500">
                                        <GridViewColumn.CellTemplate>
                                            <DataTemplate>
                                                <TextBlock TextWrapping="Wrap" Text="{Binding Msg}" />
                                            </DataTemplate>
                                        </GridViewColumn.CellTemplate>
                                    </GridViewColumn>
                                    <GridView.ColumnHeaderContainerStyle>
                                        <Style TargetType="{x:Type GridViewColumnHeader}">
                                            <Setter Property="Visibility" Value="Collapsed"/>
                                        </Style>
                                    </GridView.ColumnHeaderContainerStyle>
                                </GridView>
                            </ListView.View>
                            <ListView.ItemContainerStyle>
                                <Style TargetType="ListViewItem">
                                    <Setter Property="Background" Value="{Binding Path=color}" />
                                    <Setter Property="FontFamily" Value="Consolas" />
                                    <Setter Property="Foreground" Value="Black" />
                                    <Setter Property="FontSize" Value="13" />
                                    <Style.Triggers>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                                            <Setter Property="FontWeight" Value="Bold" />
                                        </Trigger>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" Value="Gainsboro" />
                                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                                
                            </ListView.ItemContainerStyle>
                        </ListView>