Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab3fe0ee70 | |||
| 3d7ed15ef1 | |||
| 1e216d5ff4 | |||
| 4ac9ecdd9a | |||
| 9cd7ccadfd | |||
| e7de252948 | |||
| b8f3213257 | |||
| 60cff9dca3 | |||
| 9bec5d4b13 | |||
| db6c33b0b4 |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,9 @@
|
||||
<Application x:Class="Application"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgwWPFBaseLib.DemoApplication"
|
||||
StartupUri="MainWindow\MainWindowV.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,6 @@
|
||||
Class Application
|
||||
|
||||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
|
||||
' can be handled in this file.
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,154 @@
|
||||
<UserControl x:Class="EgwDataGridPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:EgwWPFBaseLib.DemoApplication"
|
||||
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<EgwWPFBaseLib:EgwDataGrid ItemsSource="{Binding ItemList_View}"
|
||||
ColumnLayouts="{Binding ColumnList}"
|
||||
RowDetailsVisibilityMode="VisibleWhenSelected"
|
||||
EnableColumnVirtualization="True">
|
||||
<EgwWPFBaseLib:EgwDataGrid.RowDetailsTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="Lime">
|
||||
<TextBlock Text="{Binding sDescription}"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGrid.RowDetailsTemplate>
|
||||
<EgwWPFBaseLib:EgwDataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Margin" Value="0,0,0,5"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}"
|
||||
Margin="0,0,5,0" FontSize="14"/>
|
||||
<Button ToolTip="Tooltip test"
|
||||
Height="20" Width="20" Margin="5,0,0,0">
|
||||
<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<Expander.Content>
|
||||
<ItemsPresenter />
|
||||
</Expander.Content>
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</EgwWPFBaseLib:EgwDataGrid.GroupStyle>
|
||||
<EgwWPFBaseLib:EgwDataGrid.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="Height" Value="24"/>
|
||||
<Setter Property="Foreground" Value="Purple" />
|
||||
<Style.Resources>
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="Black" />
|
||||
</Style.Resources>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="BorderBrush" Value="Green" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
<Setter Property="Background" Value="Red" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</EgwWPFBaseLib:EgwDataGrid.CellStyle>
|
||||
<EgwWPFBaseLib:EgwDataGrid.RowStyle>
|
||||
<Style TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="Foreground" Value="Red" />
|
||||
<Style.Resources>
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="Black" />
|
||||
</Style.Resources>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="BorderBrush" Value="Red"/>
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="Foreground" Value="LightBlue"/>
|
||||
<Setter Property="Background" Value="Green" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</EgwWPFBaseLib:EgwDataGrid.RowStyle>
|
||||
<EgwWPFBaseLib:EgwDataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="Background" Value="LightBlue" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="Padding" Value="0,2,0,2" />
|
||||
</Style>
|
||||
</EgwWPFBaseLib:EgwDataGrid.ColumnHeaderStyle>
|
||||
<EgwWPFBaseLib:EgwDataGrid.Resources>
|
||||
<DataGridTextColumn x:Key="colId"
|
||||
Header="Pizza"
|
||||
Binding="{Binding nId}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="PDN"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.HeaderStyle>
|
||||
<Style TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="Background" Value="green" />
|
||||
<Setter Property="Foreground" Value="purple" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="Padding" Value="0,2,0,2" />
|
||||
</Style>
|
||||
</DataGridTextColumn.HeaderStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn x:Key="colName"
|
||||
Header="Name"
|
||||
Binding="{Binding sName}"/>
|
||||
<DataGridTextColumn x:Key="colDescription"
|
||||
Header="Description"
|
||||
Binding="{Binding sDescription}"/>
|
||||
<DataGridTextColumn x:Key="colName2"
|
||||
Header="Name2"
|
||||
Binding="{Binding sName}"/>
|
||||
<DataGridTextColumn x:Key="colDescription2"
|
||||
Header="Description2"
|
||||
Binding="{Binding sDescription}"/>
|
||||
<DataGridTextColumn x:Key="colName3"
|
||||
Header="Name3"
|
||||
Binding="{Binding sName}"/>
|
||||
<DataGridTemplateColumn x:Key="colDescription3"
|
||||
Header="Description3">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="{Binding sDescription}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridComboBoxColumn x:Key="colComboBox"
|
||||
Header="ComboBox"
|
||||
ItemsSource="{Binding ComboList}"
|
||||
SelectedItemBinding="{Binding sSelCombo, UpdateSourceTrigger=PropertyChanged}">
|
||||
</DataGridComboBoxColumn>
|
||||
|
||||
</EgwWPFBaseLib:EgwDataGrid.Resources>
|
||||
|
||||
</EgwWPFBaseLib:EgwDataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class EgwDataGridPageV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,136 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Class EgwDataGridPageVM
|
||||
Inherits VMBase
|
||||
|
||||
Private JsonPath As String = "c:/Temp/DatagridJson.json"
|
||||
|
||||
Private m_ItemList_View As CollectionView = Nothing
|
||||
Public ReadOnly Property ItemList_View As CollectionView
|
||||
Get
|
||||
Return m_ItemList_View
|
||||
End Get
|
||||
End Property
|
||||
Private m_ItemList As New ObservableCollection(Of DataGridItem)
|
||||
Public ReadOnly Property ItemList As ObservableCollection(Of DataGridItem)
|
||||
Get
|
||||
Return m_ItemList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ColumnList As New ObservableCollection(Of ColumnLayout)
|
||||
Public Property ColumnList As ObservableCollection(Of ColumnLayout)
|
||||
Get
|
||||
Return m_ColumnList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of ColumnLayout))
|
||||
m_ColumnList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in Map
|
||||
Map.SetRefEgwDataGridPageVM(Me)
|
||||
If Not EgwDataGrid.ReadColumnLayout(JsonPath, "TestGrid", m_ColumnList) Then
|
||||
m_ColumnList = New ObservableCollection(Of ColumnLayout)()
|
||||
End If
|
||||
m_ItemList_View = CollectionViewSource.GetDefaultView(m_ItemList)
|
||||
m_ItemList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(DataGridItem.nGroup)))
|
||||
Dim ComboList As New List(Of String)({"Pasta", "Past2", "Pasta3", "Past4"})
|
||||
ItemList.Add(New DataGridItem(1, "Pizza1", "Ottimo pasto1!", ComboList))
|
||||
ItemList.Add(New DataGridItem(2, "Pizza2", "Ottimo pasto2!", ComboList))
|
||||
ItemList.Add(New DataGridItem(3, "Pizza3", "Ottimo pasto3!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(4, "Pizza4", "Ottimo pasto4!", ComboList))
|
||||
ItemList.Add(New DataGridItem(5, "Pizza5", "Ottimo pasto5!", ComboList, 1, "Pasta"))
|
||||
ItemList.Add(New DataGridItem(6, "Pizza6", "Ottimo pasto6!", ComboList))
|
||||
ItemList.Add(New DataGridItem(7, "Pizza7", "Ottimo pasto7!", ComboList))
|
||||
ItemList.Add(New DataGridItem(8, "Pizza8", "Ottimo pasto8!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(9, "Pizza9", "Ottimo pasto9!", ComboList))
|
||||
ItemList.Add(New DataGridItem(10, "Pizza10", "Ottimo pasto10!", ComboList, 1, "Pasta"))
|
||||
ItemList.Add(New DataGridItem(11, "Pizza11", "Ottimo pasto11!", ComboList))
|
||||
ItemList.Add(New DataGridItem(12, "Pizza12", "Ottimo pasto12!", ComboList))
|
||||
ItemList.Add(New DataGridItem(13, "Pizza13", "Ottimo pasto13!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(14, "Pizza14", "Ottimo pasto14!", ComboList))
|
||||
ItemList.Add(New DataGridItem(15, "Pizza15", "Ottimo pasto15!", ComboList, 1, "Pasta"))
|
||||
ItemList.Add(New DataGridItem(16, "Pizza16", "Ottimo pasto16!", ComboList))
|
||||
ItemList.Add(New DataGridItem(17, "Pizza17", "Ottimo pasto17!", ComboList))
|
||||
ItemList.Add(New DataGridItem(18, "Pizza18", "Ottimo pasto18!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(19, "Pizza19", "Ottimo pasto19!", ComboList))
|
||||
ItemList.Add(New DataGridItem(20, "Pizza20", "Ottimo pasto20!", ComboList, 1, "Pasta"))
|
||||
End Sub
|
||||
|
||||
Friend Sub OnClosed()
|
||||
If m_ColumnList.Count > 0 Then
|
||||
EgwDataGrid.WriteColumnLayout(JsonPath, New Dictionary(Of String, ObservableCollection(Of ColumnLayout)) From {{"TestGrid", m_ColumnList}})
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class DataGridItem
|
||||
Inherits VMBase
|
||||
|
||||
Private m_nId As Integer
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nGroup As Integer
|
||||
Public ReadOnly Property nGroup As Integer
|
||||
Get
|
||||
Return m_nGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sName As String
|
||||
Public Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sDescription As String
|
||||
Public Property sDescription As String
|
||||
Get
|
||||
Return m_sDescription
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDescription = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ComboList As List(Of String)
|
||||
Public Property ComboList As List(Of String)
|
||||
Get
|
||||
Return m_ComboList
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
m_ComboList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sSelCombo As String
|
||||
Public Property sSelCombo As String
|
||||
Get
|
||||
Return m_sSelCombo
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSelCombo = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, sName As String, sDescription As String, Optional ComboList As List(Of String) = Nothing, Optional nGroup As Integer = 0, Optional sSelCombo As String = "")
|
||||
m_nId = nId
|
||||
m_nGroup = nGroup
|
||||
m_sName = sName
|
||||
m_sDescription = sDescription
|
||||
m_ComboList = ComboList
|
||||
m_sSelCombo = sSelCombo
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
<UserControl x:Class="EgwRightFrozenDataGridPageV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:EgwWPFBaseLib.DemoApplication"
|
||||
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
|
||||
<Grid>
|
||||
<EgwWPFBaseLib:EgwRightFrozenDataGrid ItemsSource="{Binding ItemList_View}"
|
||||
ColumnLayouts="{Binding ColumnList}"
|
||||
RightFrozenColumnCount="2"
|
||||
RowDetailsVisibilityMode="VisibleWhenSelected">
|
||||
<EgwWPFBaseLib:EgwRightFrozenDataGrid.RowDetailsTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="Lime">
|
||||
<TextBlock Text="{Binding sDescription}"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</EgwWPFBaseLib:EgwRightFrozenDataGrid.RowDetailsTemplate>
|
||||
<EgwWPFBaseLib:EgwRightFrozenDataGrid.MainGroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True" Style="{StaticResource MainExpander}">
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal" Height="25">
|
||||
<TextBlock Text="{Binding Name}" FontWeight="Bold"/>
|
||||
<TextBlock Text=" (" />
|
||||
<TextBlock Text="{Binding ItemCount}" />
|
||||
<TextBlock Text=" elementi)" />
|
||||
<TextBlock Text="Gruppo nn" Margin="0,0,5,0" FontSize="14"/>
|
||||
<!--<Button ToolTip="Tooltip test"
|
||||
Height="20" Width="20" Margin="5,0,0,0"
|
||||
Command="{Binding DataContext.Test_Command, RelativeSource={RelativeSource AncestorType={x:Type local:BindableFrozenDataGrid}}}">
|
||||
</Button>-->
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<Expander.Content>
|
||||
<ItemsPresenter/>
|
||||
</Expander.Content>
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</EgwWPFBaseLib:EgwRightFrozenDataGrid.MainGroupStyle>
|
||||
<EgwWPFBaseLib:EgwRightFrozenDataGrid.FrozenGroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander Margin="-1,0,0,0" Style="{StaticResource FrozenExpander}">
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal" Height="25">
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<Expander.Content>
|
||||
<ItemsPresenter/>
|
||||
</Expander.Content>
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</EgwWPFBaseLib:EgwRightFrozenDataGrid.FrozenGroupStyle>
|
||||
<EgwWPFBaseLib:EgwRightFrozenDataGrid.Columns>
|
||||
<EgwWPFBaseLib:EgwDataGridTextColumn Key="colId"
|
||||
Header="Pizza"
|
||||
Binding="{Binding nId}">
|
||||
<!--<EgwWPFBaseLib:EgwDataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="PDN"/>
|
||||
</DataTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTextColumn.HeaderTemplate>-->
|
||||
<!--<local:EgwDataGridTextColumn.HeaderStyle>
|
||||
<Style TargetType="{x:Type DataGridColumnHeader}">
|
||||
<Setter Property="Background" Value="green" />
|
||||
<Setter Property="Foreground" Value="purple" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="FontSize" Value="15" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="Padding" Value="0,2,0,2" />
|
||||
</Style>
|
||||
</local:EgwDataGridTextColumn.HeaderStyle>-->
|
||||
</EgwWPFBaseLib:EgwDataGridTextColumn>
|
||||
<EgwWPFBaseLib:EgwDataGridComboBoxColumn Key="colComboBox"
|
||||
Header="ComboBox"
|
||||
ItemsSource="{Binding ComboList}"
|
||||
SelectedItemBinding="{Binding sSelCombo, UpdateSourceTrigger=PropertyChanged}">
|
||||
</EgwWPFBaseLib:EgwDataGridComboBoxColumn>
|
||||
<EgwWPFBaseLib:EgwDataGridTemplateColumn Key="colComboBox2"
|
||||
Header="ComboBox">
|
||||
<EgwWPFBaseLib:EgwDataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ComboList[0]}"/>
|
||||
</DataTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTemplateColumn.CellTemplate>
|
||||
<EgwWPFBaseLib:EgwDataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding ComboList}"
|
||||
SelectedIndex="0"/>
|
||||
</DataTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTemplateColumn.CellEditingTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTemplateColumn>
|
||||
|
||||
<EgwWPFBaseLib:EgwDataGridTemplateColumn Key="colName"
|
||||
Header="Name">
|
||||
<EgwWPFBaseLib:EgwDataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Border Background="Green"/>
|
||||
<!--<Button Content="{Binding sName}"/>-->
|
||||
</DataTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTemplateColumn.CellTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTemplateColumn>
|
||||
<EgwWPFBaseLib:EgwDataGridTextColumn Key="colDescription"
|
||||
Header="Description"
|
||||
Binding="{Binding sDescription}"/>
|
||||
<EgwWPFBaseLib:EgwDataGridTextColumn Key="colName2"
|
||||
Header="Name2"
|
||||
Binding="{Binding sName}"/>
|
||||
<EgwWPFBaseLib:EgwDataGridTextColumn Key="colDescription2"
|
||||
Header="Description2"
|
||||
Binding="{Binding sDescription}"/>
|
||||
<EgwWPFBaseLib:EgwDataGridTextColumn Key="colName3"
|
||||
Header="Name3"
|
||||
Binding="{Binding sName}"/>
|
||||
<!--<EgwWPFBaseLib:EgwDataGridTextColumn Key="colDescription3"
|
||||
Header="Description3"
|
||||
Binding="{Binding sDescription}"/>-->
|
||||
<EgwWPFBaseLib:EgwDataGridTemplateColumn Key="colDescription3"
|
||||
Header="Description3">
|
||||
<EgwWPFBaseLib:EgwDataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Content="{Binding sDescription}"/>
|
||||
</DataTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTemplateColumn.CellTemplate>
|
||||
</EgwWPFBaseLib:EgwDataGridTemplateColumn>
|
||||
</EgwWPFBaseLib:EgwRightFrozenDataGrid.Columns>
|
||||
</EgwWPFBaseLib:EgwRightFrozenDataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
Public Class EgwRightFrozenDataGridPageV
|
||||
|
||||
End Class
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Class EgwRightFrozenDataGridPageVM
|
||||
Inherits VMBase
|
||||
|
||||
Private JsonPath As String = "c:/Temp/DatagridJson.json"
|
||||
|
||||
Private m_ItemList_View As CollectionView = Nothing
|
||||
Public ReadOnly Property ItemList_View As CollectionView
|
||||
Get
|
||||
Return m_ItemList_View
|
||||
End Get
|
||||
End Property
|
||||
Private m_ItemList As New ObservableCollection(Of DataGridItem)
|
||||
Public ReadOnly Property ItemList As ObservableCollection(Of DataGridItem)
|
||||
Get
|
||||
Return m_ItemList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ColumnList As New ObservableCollection(Of ColumnLayout)
|
||||
Public Property ColumnList As ObservableCollection(Of ColumnLayout)
|
||||
Get
|
||||
Return m_ColumnList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of ColumnLayout))
|
||||
m_ColumnList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in Map
|
||||
Map.SetRefEgwRightFrozenDataGridPageVM(Me)
|
||||
If Not EgwDataGrid.ReadColumnLayout(JsonPath, "SecondTestGrid", m_ColumnList) Then
|
||||
m_ColumnList = New ObservableCollection(Of ColumnLayout)()
|
||||
End If
|
||||
m_ItemList_View = CollectionViewSource.GetDefaultView(m_ItemList)
|
||||
m_ItemList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(DataGridItem.nGroup)))
|
||||
Dim ComboList As New List(Of String)({"Pasta", "Past2", "Pasta3", "Past4"})
|
||||
ItemList.Add(New DataGridItem(1, "Pizza1", "Ottimo pasto1!", ComboList))
|
||||
ItemList.Add(New DataGridItem(2, "Pizza2", "Ottimo pasto2!", ComboList))
|
||||
ItemList.Add(New DataGridItem(3, "Pizza3", "Ottimo pasto3!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(4, "Pizza4", "Ottimo pasto4!", ComboList))
|
||||
ItemList.Add(New DataGridItem(5, "Pizza5", "Ottimo pasto5!", ComboList, 1, "Pasta"))
|
||||
ItemList.Add(New DataGridItem(6, "Pizza6", "Ottimo pasto6!", ComboList))
|
||||
ItemList.Add(New DataGridItem(7, "Pizza7", "Ottimo pasto7!", ComboList))
|
||||
ItemList.Add(New DataGridItem(8, "Pizza8", "Ottimo pasto8!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(9, "Pizza9", "Ottimo pasto9!", ComboList))
|
||||
ItemList.Add(New DataGridItem(10, "Pizza10", "Ottimo pasto10!", ComboList, 1, "Pasta"))
|
||||
ItemList.Add(New DataGridItem(11, "Pizza11", "Ottimo pasto11!", ComboList))
|
||||
ItemList.Add(New DataGridItem(12, "Pizza12", "Ottimo pasto12!", ComboList))
|
||||
ItemList.Add(New DataGridItem(13, "Pizza13", "Ottimo pasto13!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(14, "Pizza14", "Ottimo pasto14!", ComboList))
|
||||
ItemList.Add(New DataGridItem(15, "Pizza15", "Ottimo pasto15!", ComboList, 1, "Pasta"))
|
||||
ItemList.Add(New DataGridItem(16, "Pizza16", "Ottimo pasto16!", ComboList))
|
||||
ItemList.Add(New DataGridItem(17, "Pizza17", "Ottimo pasto17!", ComboList))
|
||||
ItemList.Add(New DataGridItem(18, "Pizza18", "Ottimo pasto18!", ComboList, 1, "Pasta3"))
|
||||
ItemList.Add(New DataGridItem(19, "Pizza19", "Ottimo pasto19!", ComboList))
|
||||
ItemList.Add(New DataGridItem(20, "Pizza20", "Ottimo pasto20!", ComboList, 1, "Pasta"))
|
||||
End Sub
|
||||
|
||||
Friend Sub OnClosed()
|
||||
If m_ColumnList.Count > 0 Then
|
||||
EgwDataGrid.WriteColumnLayout(JsonPath, New Dictionary(Of String, ObservableCollection(Of ColumnLayout)) From {{"SecondTestGrid", m_ColumnList}})
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,160 @@
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{63F2E396-D1F7-44D9-9FE5-C9D19DC3ACD0}</ProjectGuid>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>EgwWPFBaseLib.DemoApplication</RootNamespace>
|
||||
<AssemblyName>EgwWPFBaseLib.DemoApplication</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<MyType>Custom</MyType>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>true</IncrementalBuild>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>EgwWPFBaseLib.DemoApplication.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>false</IncrementalBuild>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>EgwWPFBaseLib.DemoApplication.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgwWPFBaseLib">
|
||||
<HintPath>..\EgwWPFBaseLib\bin\Debug\EgwWPFBaseLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="Application.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="EgwRightFrozenDataGridPage\EgwRightFrozenDataGridPageV.xaml.vb">
|
||||
<DependentUpon>EgwRightFrozenDataGridPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EgwRightFrozenDataGridPage\EgwRightFrozenDataGridPageVM.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Page Include="EgwRightFrozenDataGridPage\EgwRightFrozenDataGridPageV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="EgwDataGridPage\EgwDataGridPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow\MainWindowV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="Application.xaml.vb">
|
||||
<DependentUpon>Application.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EgwDataGridPage\EgwDataGridPageV.xaml.vb">
|
||||
<DependentUpon>EgwDataGridPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EgwDataGridPage\EgwDataGridPageVM.vb" />
|
||||
<Compile Include="MainWindow\MainWindowV.xaml.vb">
|
||||
<DependentUpon>MainWindowV.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Utility\Dictionary.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows" />
|
||||
<Import Include="System.Windows.Controls" />
|
||||
<Import Include="System.Windows.Data" />
|
||||
<Import Include="System.Windows.Documents" />
|
||||
<Import Include="System.Windows.Input" />
|
||||
<Import Include="System.Windows.Shapes" />
|
||||
<Import Include="System.Windows.Media" />
|
||||
<Import Include="System.Windows.Media.Imaging" />
|
||||
<Import Include="System.Windows.Navigation" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow\MainWindowVM.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="My Project\MyExtensions\MyWpfExtension.vb">
|
||||
<VBMyExtensionTemplateID>Microsoft.VisualBasic.WPF.MyExtension</VBMyExtensionTemplateID>
|
||||
<VBMyExtensionTemplateVersion>1.0.0.0</VBMyExtensionTemplateVersion>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<Window x:Class="MainWindowV"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:EgwWPFBaseLib.DemoApplication"
|
||||
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="850" Width="500">
|
||||
<TabControl>
|
||||
<TabItem Header="EgwDataGrid">
|
||||
<local:EgwDataGridPageV DataContext="{StaticResource EgwDataGridPageVM}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="EgwRightFrozenDataGrid">
|
||||
<local:EgwRightFrozenDataGridPageV DataContext="{StaticResource EgwRightFrozenDataGridPageVM}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Window>
|
||||
@@ -0,0 +1,21 @@
|
||||
Class MainWindowV
|
||||
|
||||
Private m_MainWindowVM As MainWindowVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
m_MainWindowVM = New MainWindowVM
|
||||
' Funzione che interpreta l'xaml
|
||||
InitializeComponent()
|
||||
Me.DataContext = m_MainWindowVM
|
||||
AddHandler Me.Closing, AddressOf Me_Closing
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Private Sub Me_Closing()
|
||||
m_MainWindowVM.OnClosed()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,17 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Class MainWindowVM
|
||||
Inherits VMBase
|
||||
|
||||
Sub New()
|
||||
' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM
|
||||
Map.BeginInit(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub OnClosed()
|
||||
Map.refEgwDataGridPageVM.OnClosed()
|
||||
Map.refEgwRightFrozenDataGridPageVM.OnClosed()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,56 @@
|
||||
Imports System
|
||||
Imports System.Globalization
|
||||
Imports System.Reflection
|
||||
Imports System.Resources
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Windows
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("EgwWPFBaseLib.DemoApplication")>
|
||||
<Assembly: AssemblyDescription("EgwWPFBaseLib DemoApplication")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgwWPFBaseLib.DemoApplication")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2026 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
'In order to begin building localizable applications, set
|
||||
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
|
||||
'inside a <PropertyGroup>. For example, if you are using US english
|
||||
'in your source files, set the <UICulture> to "en-US". Then uncomment the
|
||||
'NeutralResourceLanguage attribute below. Update the "en-US" in the line
|
||||
'below to match the UICulture setting in the project file.
|
||||
|
||||
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
|
||||
|
||||
|
||||
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
|
||||
'1st parameter: where theme specific resource dictionaries are located
|
||||
'(used if a resource is not found in the page,
|
||||
' or application resource dictionaries)
|
||||
|
||||
'2nd parameter: where the generic resource dictionary is located
|
||||
'(used if a resource is not found in the page,
|
||||
'app, and any theme specific resource dictionaries)
|
||||
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
|
||||
|
||||
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("91aeb6ce-c61f-4691-98f0-86e0823ddc94")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.3.5")>
|
||||
<Assembly: AssemblyFileVersion("3.1.3.5")>
|
||||
@@ -0,0 +1,121 @@
|
||||
#If _MyType <> "Empty" Then
|
||||
|
||||
Namespace My
|
||||
''' <summary>
|
||||
''' Module used to define the properties that are available in the My Namespace for WPF
|
||||
''' </summary>
|
||||
''' <remarks></remarks>
|
||||
<Global.Microsoft.VisualBasic.HideModuleName()> _
|
||||
Module MyWpfExtension
|
||||
Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
|
||||
Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
|
||||
Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
|
||||
Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
|
||||
''' <summary>
|
||||
''' Returns the application object for the running application
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Application() As Application
|
||||
Get
|
||||
Return CType(Global.System.Windows.Application.Current, Application)
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Returns information about the host computer.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
|
||||
Get
|
||||
Return s_Computer.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Returns information for the current user. If you wish to run the application with the current
|
||||
''' Windows user credentials, call My.User.InitializeWithWindowsUser().
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
|
||||
Get
|
||||
Return s_User.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
''' <summary>
|
||||
''' Returns the application log. The listeners can be configured by the application's configuration file.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
|
||||
Get
|
||||
Return s_Log.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Returns the collection of Windows defined in the project.
|
||||
''' </summary>
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
Friend ReadOnly Property Windows() As MyWindows
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Get
|
||||
Return s_Windows.GetInstance()
|
||||
End Get
|
||||
End Property
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
<Global.Microsoft.VisualBasic.MyGroupCollection("System.Windows.Window", "Create__Instance__", "Dispose__Instance__", "My.MyWpfExtenstionModule.Windows")> _
|
||||
Friend NotInheritable Class MyWindows
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
|
||||
If Instance Is Nothing Then
|
||||
If s_WindowBeingCreated IsNot Nothing Then
|
||||
If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
|
||||
Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
|
||||
End If
|
||||
Else
|
||||
s_WindowBeingCreated = New Global.System.Collections.Hashtable()
|
||||
End If
|
||||
s_WindowBeingCreated.Add(GetType(T), Nothing)
|
||||
Return New T()
|
||||
s_WindowBeingCreated.Remove(GetType(T))
|
||||
Else
|
||||
Return Instance
|
||||
End If
|
||||
End Function
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
|
||||
instance = Nothing
|
||||
End Sub
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Public Sub New()
|
||||
MyBase.New()
|
||||
End Sub
|
||||
<Global.System.ThreadStatic()> Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function Equals(ByVal o As Object) As Boolean
|
||||
Return MyBase.Equals(o)
|
||||
End Function
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function GetHashCode() As Integer
|
||||
Return MyBase.GetHashCode
|
||||
End Function
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Friend Overloads Function [GetType]() As Global.System.Type
|
||||
Return GetType(MyWindows)
|
||||
End Function
|
||||
<Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never)> Public Overrides Function ToString() As String
|
||||
Return MyBase.ToString
|
||||
End Function
|
||||
End Class
|
||||
End Module
|
||||
End Namespace
|
||||
Partial Class Application
|
||||
Inherits Global.System.Windows.Application
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
|
||||
<Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")> _
|
||||
Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
|
||||
<Global.System.Diagnostics.DebuggerHidden()> _
|
||||
Get
|
||||
Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
#End If
|
||||
@@ -0,0 +1,62 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:$clrversion$
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("$safeprojectname$.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.EgwWPFBaseLib.DemoApplication.My.MySettings
|
||||
Get
|
||||
Return Global.EgwWPFBaseLib.DemoApplication.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,212 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgwWPFBaseLib.DemoApplication">
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
-->
|
||||
<local:EgwDataGridPageVM x:Key="EgwDataGridPageVM"/>
|
||||
<local:EgwRightFrozenDataGridPageVM x:Key="EgwRightFrozenDataGridPageVM"/>
|
||||
|
||||
|
||||
<!--#region EgwRightFrozenDataGridPageV -->
|
||||
|
||||
<!--#region Expander -->
|
||||
|
||||
<SolidColorBrush x:Key="Expander.Static.Circle.Stroke" Color="#FF333333"/>
|
||||
<SolidColorBrush x:Key="Expander.Static.Circle.Fill" Color="#FFFFFFFF"/>
|
||||
<SolidColorBrush x:Key="Expander.Static.Arrow.Stroke" Color="#FF333333"/>
|
||||
<SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF5593FF"/>
|
||||
<SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="#FFF3F9FF"/>
|
||||
<SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#FF000000"/>
|
||||
<SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF3C77DD"/>
|
||||
<SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="#FFD9ECFF"/>
|
||||
<SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF000000"/>
|
||||
<SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="#FFBCBCBC"/>
|
||||
<SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="#FFE6E6E6"/>
|
||||
<SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#FF707070"/>
|
||||
<Style x:Key="ExpanderHeaderFocusVisual">
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border>
|
||||
<Rectangle Margin="0" StrokeDashArray="1 2" Stroke="Black" SnapsToDevicePixels="true" StrokeThickness="1"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="FrozenExpanderHeader" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border Padding="{TemplateBinding Padding}">
|
||||
<Grid Background="Transparent" SnapsToDevicePixels="False">
|
||||
<ContentPresenter HorizontalAlignment="Left" Margin="0,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Border Padding="{TemplateBinding Padding}">
|
||||
<Grid Background="Transparent" SnapsToDevicePixels="False">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="19"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/>
|
||||
<Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/>
|
||||
<ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="true">
|
||||
<Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/>
|
||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/>
|
||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/>
|
||||
<Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
|
||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/>
|
||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/>
|
||||
<Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/>
|
||||
<Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="FrozenExpander" TargetType="{x:Type Expander}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Expander}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="3"
|
||||
SnapsToDevicePixels="true">
|
||||
<DockPanel>
|
||||
<ToggleButton x:Name="HeaderSite"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
|
||||
DockPanel.Dock="Top"
|
||||
FontStretch="{TemplateBinding FontStretch}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}"
|
||||
FontStyle="{TemplateBinding FontStyle}"
|
||||
FontFamily="{TemplateBinding FontFamily}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
|
||||
Margin="1"
|
||||
MinWidth="0"
|
||||
MinHeight="0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Style="{StaticResource FrozenExpanderHeader}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsExpanded" Value="true">
|
||||
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ExpandDirection" Value="Right">
|
||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
|
||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
|
||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ExpandDirection" Value="Up">
|
||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
|
||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
|
||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ExpandDirection" Value="Left">
|
||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
|
||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
|
||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MainExpander" TargetType="{x:Type Expander}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Expander}">
|
||||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" SnapsToDevicePixels="true">
|
||||
<DockPanel>
|
||||
<ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" DockPanel.Dock="Top" FontStretch="{TemplateBinding FontStretch}" Foreground="{TemplateBinding Foreground}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" FontSize="{TemplateBinding FontSize}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource ExpanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
<ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsExpanded" Value="true">
|
||||
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ExpandDirection" Value="Right">
|
||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
|
||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
|
||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ExpandDirection" Value="Up">
|
||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
|
||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
|
||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ExpandDirection" Value="Left">
|
||||
<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
|
||||
<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
|
||||
<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--#endregion Expander-->
|
||||
|
||||
<!--#endregion EgwRightFrozenDataGridPageV-->
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,55 @@
|
||||
Module Map
|
||||
|
||||
Private m_refMainWindowVM As MainWindowVM
|
||||
Private m_refEgwDataGridPageVM As EgwDataGridPageVM
|
||||
Private m_refEgwRightFrozenDataGridPageVM As EgwRightFrozenDataGridPageVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||
Get
|
||||
Return m_refMainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refEgwDataGridPageVM As EgwDataGridPageVM
|
||||
Get
|
||||
Return m_refEgwDataGridPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refEgwRightFrozenDataGridPageVM As EgwRightFrozenDataGridPageVM
|
||||
Get
|
||||
Return m_refEgwRightFrozenDataGridPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
#Region "Set"
|
||||
|
||||
Friend Function SetRefEgwDataGridPageVM(EgwDataGridPageVM As EgwDataGridPageVM) As Boolean
|
||||
m_refEgwDataGridPageVM = EgwDataGridPageVM
|
||||
Return Not IsNothing(m_refEgwDataGridPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefEgwRightFrozenDataGridPageVM(EgwRightFrozenDataGridPageVM As EgwRightFrozenDataGridPageVM) As Boolean
|
||||
m_refEgwRightFrozenDataGridPageVM = EgwRightFrozenDataGridPageVM
|
||||
Return Not IsNothing(m_refEgwRightFrozenDataGridPageVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
#Region "Init"
|
||||
|
||||
Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
|
||||
m_refMainWindowVM = MainWindowVM
|
||||
Return Not IsNothing(m_refMainWindowVM)
|
||||
End Function
|
||||
Friend Function EndInit() As Boolean
|
||||
Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refEgwDataGridPageVM) AndAlso Not IsNothing(m_refEgwRightFrozenDataGridPageVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Init
|
||||
|
||||
End Module
|
||||
+10
-1
@@ -1,10 +1,12 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.12.35728.132 d17.12
|
||||
VisualStudioVersion = 17.12.35728.132
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EgwWPFBaseLib", "EgwWPFBaseLib\EgwWPFBaseLib.vbproj", "{A80C1830-5DB1-419E-AD0C-BA91BE5BF5A9}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EgwWPFBaseLib.DemoApplication", "EgwWPFBaseLib.DemoApplication\EgwWPFBaseLib.DemoApplication.vbproj", "{63F2E396-D1F7-44D9-9FE5-C9D19DC3ACD0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,8 +17,15 @@ Global
|
||||
{A80C1830-5DB1-419E-AD0C-BA91BE5BF5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A80C1830-5DB1-419E-AD0C-BA91BE5BF5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A80C1830-5DB1-419E-AD0C-BA91BE5BF5A9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{63F2E396-D1F7-44D9-9FE5-C9D19DC3ACD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{63F2E396-D1F7-44D9-9FE5-C9D19DC3ACD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{63F2E396-D1F7-44D9-9FE5-C9D19DC3ACD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{63F2E396-D1F7-44D9-9FE5-C9D19DC3ACD0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0AE6D4DC-EBB7-44A2-94FF-8966F86F852F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Controls.Primitives
|
||||
Imports System.Windows.Threading
|
||||
@@ -77,7 +78,7 @@ Public Class EgwDataGrid
|
||||
For nToBeRemovedIndex = ToBeRemoved.Count - 1 To 0 Step -1
|
||||
layouts.Remove(ToBeRemoved(nToBeRemovedIndex))
|
||||
Next
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Shared Sub OnTableLockedChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs)
|
||||
@@ -130,6 +131,8 @@ Public Class EgwDataGrid
|
||||
|
||||
Private _headersCaptured As Boolean = False
|
||||
|
||||
Private _initialSortingApplied As Boolean = False
|
||||
|
||||
Sub New()
|
||||
Me.AutoGenerateColumns = False
|
||||
AddHandler Me.Loaded, AddressOf OnDataGridLoaded
|
||||
@@ -139,6 +142,13 @@ Public Class EgwDataGrid
|
||||
|
||||
Private Sub OnDataGridLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
|
||||
TryHookPresenter()
|
||||
' aggiorno sorting all'avvio
|
||||
If _initialSortingApplied Then Exit Sub
|
||||
_initialSortingApplied = True
|
||||
' Applica sorting dopo che il DataGrid ha completato il layout
|
||||
Dispatcher.BeginInvoke(Sub()
|
||||
ApplyInitialSorting()
|
||||
End Sub, DispatcherPriority.Render)
|
||||
End Sub
|
||||
|
||||
Private Sub OnGridSizeChanged(sender As Object, e As SizeChangedEventArgs)
|
||||
@@ -187,7 +197,6 @@ Public Class EgwDataGrid
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
' li crea correttamente ma solo fino alla prima colonna nascosta
|
||||
@@ -286,11 +295,25 @@ Public Class EgwDataGrid
|
||||
End If
|
||||
End Sub
|
||||
AddHandler Me.Sorting, Sub(s, args)
|
||||
Dim l = Nothing
|
||||
If _columnToLayout.TryGetValue(args.Column, l) Then l.SortDirection = args.Column.SortDirection
|
||||
End Sub
|
||||
Dispatcher.BeginInvoke(New Action(Sub()
|
||||
' Per ogni colonna del DataGrid
|
||||
For Each col In Me.Columns
|
||||
|
||||
Dim sortLayout As ColumnLayout = Nothing
|
||||
|
||||
' Se esiste un ColumnLayout associato
|
||||
If _columnToLayout.TryGetValue(col, sortLayout) Then
|
||||
' Copia la SortDirection reale della colonna
|
||||
sortLayout.SortDirection = col.SortDirection
|
||||
End If
|
||||
|
||||
Next
|
||||
End Sub), System.Windows.Threading.DispatcherPriority.Background)
|
||||
End Sub
|
||||
UpdateDisplayIndexes()
|
||||
' Funzione che aggancia il listener alla SortDirection della colonna per aggiornare il valore quando cambiato manualmente in BindableFrozenDataGrid
|
||||
Dim dpd = DependencyPropertyDescriptor.FromProperty(DataGridColumn.SortDirectionProperty, GetType(DataGridColumn))
|
||||
dpd.AddValueChanged(column, AddressOf OnColumnSortDirectionChanged)
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
@@ -298,6 +321,39 @@ Public Class EgwDataGrid
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub OnColumnSortDirectionChanged(sender As Object, e As EventArgs)
|
||||
Dim view = CollectionViewSource.GetDefaultView(Me.ItemsSource)
|
||||
|
||||
Dim col = TryCast(sender, DataGridColumn)
|
||||
If col Is Nothing Then Return
|
||||
|
||||
If _columnToLayout.ContainsKey(col) Then
|
||||
Dim layout = _columnToLayout(col)
|
||||
layout.SortDirection = col.SortDirection
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ApplyInitialSorting()
|
||||
Dim view = CollectionViewSource.GetDefaultView(Me.ItemsSource)
|
||||
If view Is Nothing Then Exit Sub
|
||||
|
||||
' Cerca tutte le colonne con SortDirection nel ColumnLayout
|
||||
For Each kvp In _columnToLayout
|
||||
Dim col = kvp.Key
|
||||
Dim layout = kvp.Value
|
||||
|
||||
If layout.SortDirection IsNot Nothing AndAlso
|
||||
Not String.IsNullOrEmpty(col.SortMemberPath) Then
|
||||
|
||||
view.SortDescriptions.Add(
|
||||
New SortDescription(col.SortMemberPath, layout.SortDirection)
|
||||
)
|
||||
End If
|
||||
Next
|
||||
|
||||
view.Refresh()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerateHeaderEvents(column As DataGridColumn, layout As ColumnLayout)
|
||||
Dispatcher.BeginInvoke(New Action(Sub()
|
||||
Dim header = FindHeaderForColumn(column)
|
||||
@@ -433,11 +489,16 @@ Public Class EgwDataGrid
|
||||
|
||||
Dim ViewportWidth = 0
|
||||
Dim sv = FindVisualChild(Of ScrollViewer)(Me)
|
||||
If Not IsNothing(sv) Then
|
||||
ViewportWidth = sv.ViewportWidth - 6
|
||||
If availableWidth > sv.ViewportWidth Then
|
||||
Debug.WriteLine(String.Format("available={0}, total={1}, delta={2}, viewport={3}", {availableWidth, totalWidth, delta, ViewportWidth}))
|
||||
Return
|
||||
If Not IsNothing(sv) AndAlso Not Double.IsInfinity(sv.ViewportWidth) Then
|
||||
ViewportWidth = sv.ViewportWidth
|
||||
If availableWidth > ViewportWidth Then
|
||||
If totalWidth < ViewportWidth Then
|
||||
' correzione per restringimento colonna con doppio click su lato header
|
||||
delta = ViewportWidth - totalWidth
|
||||
Else
|
||||
Debug.WriteLine(String.Format("available={0}, total={1}, delta={2}, viewport={3}", {availableWidth, totalWidth, delta, ViewportWidth}))
|
||||
Return
|
||||
End If
|
||||
Else
|
||||
Debug.WriteLine(String.Format("available={0}, total={1}, delta={2}", {availableWidth, totalWidth, delta}))
|
||||
End If
|
||||
@@ -717,11 +778,14 @@ Public Class EgwDataGrid
|
||||
End Function
|
||||
|
||||
Private Sub UpdateDisplayIndexes()
|
||||
Dim nSkippedColumn As Integer = 0
|
||||
For i As Integer = 0 To ColumnLayouts.Count - 1
|
||||
Dim layout = ColumnLayouts(i)
|
||||
Dim column = _columnToLayout.FirstOrDefault(Function(p) p.Value Is layout).Key
|
||||
If column IsNot Nothing Then
|
||||
column.DisplayIndex = i
|
||||
If Not IsNothing(column) Then
|
||||
column.DisplayIndex = i - nSkippedColumn
|
||||
Else
|
||||
nSkippedColumn += 1
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
Public Interface iEgwRightFrozenColumn
|
||||
Property Key As String
|
||||
End Interface
|
||||
|
||||
Public Class EgwDataGridTextColumn
|
||||
Inherits DataGridTextColumn
|
||||
Implements iEgwRightFrozenColumn
|
||||
|
||||
Public Property Key As String Implements iEgwRightFrozenColumn.Key
|
||||
|
||||
Sub New()
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class EgwDataGridComboBoxColumn
|
||||
Inherits DataGridComboBoxColumn
|
||||
Implements iEgwRightFrozenColumn
|
||||
|
||||
Public Property Key As String Implements iEgwRightFrozenColumn.Key
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgwDataGridCheckBoxColumn
|
||||
Inherits DataGridCheckBoxColumn
|
||||
Implements iEgwRightFrozenColumn
|
||||
|
||||
Public Property Key As String Implements iEgwRightFrozenColumn.Key
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgwDataGridTemplateColumn
|
||||
Inherits DataGridTemplateColumn
|
||||
Implements iEgwRightFrozenColumn
|
||||
|
||||
Public Property Key As String Implements iEgwRightFrozenColumn.Key
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,162 @@
|
||||
<UserControl x:Class="EgwRightFrozenDataGrid"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Name="root"
|
||||
xmlns:local="clr-namespace:EgwWPFBaseLib">
|
||||
|
||||
<UserControl.Resources>
|
||||
|
||||
<!--<Style x:Key="DefaultRowStyle" TargetType="{x:Type DataGridRow}">
|
||||
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}"/>
|
||||
<Setter Property="ValidationErrorTemplate">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<TextBlock Foreground="Red" Margin="2,0,0,0" Text="!" VerticalAlignment="Center"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type DataGridRow}">
|
||||
<Border x:Name="DGR_Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
|
||||
<SelectiveScrollingGrid>
|
||||
<SelectiveScrollingGrid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</SelectiveScrollingGrid.ColumnDefinitions>
|
||||
<SelectiveScrollingGrid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</SelectiveScrollingGrid.RowDefinitions>
|
||||
<DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
<DataGridDetailsPresenter Grid.Column="1" Grid.Row="1" SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Visibility="{TemplateBinding DetailsVisibility}"/>
|
||||
<DataGridRowHeader Grid.RowSpan="2" SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</SelectiveScrollingGrid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsNewItem" Value="True">
|
||||
<Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>-->
|
||||
|
||||
<Style x:Key="FrozenBaseCellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="DataGridCell">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--Livello 1: la cella originale-->
|
||||
<Border x:Name="CellBorder"
|
||||
Grid.Column="1"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
|
||||
<!--Livello 2: bordo sinistro nero SOLO se prima colonna-->
|
||||
<Border x:Name="LeftBorder"
|
||||
BorderBrush="Black"
|
||||
BorderThickness="0,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<!--Prima colonna del frozen-->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},
|
||||
Path=Column.DisplayIndex}"
|
||||
Value="0">
|
||||
<Setter TargetName="LeftBorder"
|
||||
Property="BorderThickness"
|
||||
Value="1,0,0,0"/>
|
||||
</DataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DefaultCellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
|
||||
<Style.Triggers>
|
||||
|
||||
<!--Selezionata + controllo CON focus-->
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}"
|
||||
Value="True"/>
|
||||
<Condition Binding="{Binding HasAnyFocus,
|
||||
RelativeSource={RelativeSource AncestorType=local:EgwRightFrozenDataGrid}}"
|
||||
Value="True"/>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
||||
</MultiDataTrigger>
|
||||
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static DataGrid.FocusBorderBrushKey}}"/>
|
||||
</Trigger>
|
||||
<!--Selezionata + controllo SENZA focus-->
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}"
|
||||
Value="True"/>
|
||||
<Condition Binding="{Binding HasAnyFocus,
|
||||
RelativeSource={RelativeSource AncestorType=local:EgwRightFrozenDataGrid}}"
|
||||
Value="False"/>
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
|
||||
</MultiDataTrigger>
|
||||
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border x:Name="RootGrid"
|
||||
BorderBrush="{Binding BorderBrush, ElementName=root}"
|
||||
BorderThickness="{Binding BorderThickness, ElementName=root}"
|
||||
Background="{Binding Background,
|
||||
ElementName=root,
|
||||
TargetNullValue={x:Static SystemColors.ControlBrush}}">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- MAIN GRID -->
|
||||
<local:EgwDataGrid x:Name="PART_MainGrid"
|
||||
ColumnLayouts="{Binding MainColumnLayouts, ElementName=root}"
|
||||
BorderThickness="0"
|
||||
Margin="0,0,-2,0"
|
||||
VerticalScrollBarVisibility="Hidden"
|
||||
SelectionUnit="FullRow">
|
||||
</local:EgwDataGrid>
|
||||
|
||||
<!-- FROZEN GRID -->
|
||||
<local:EgwDataGrid x:Name="PART_FrozenGrid"
|
||||
Grid.Column="1"
|
||||
ColumnLayouts="{Binding FrozenColumnLayouts, ElementName=root}"
|
||||
HeadersVisibility="Column"
|
||||
BorderThickness="0"
|
||||
Margin="0"
|
||||
SelectionUnit="FullRow">
|
||||
</local:EgwDataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,6 +61,10 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="EgwRightFrozenDataGrid\EgwRightFrozenDataGrid.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Themes\Generic.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -89,6 +93,10 @@
|
||||
<Compile Include="EgtWindow\EgtWindow.vb" />
|
||||
<Compile Include="EgwDataGrid\ColumnLayout.vb" />
|
||||
<Compile Include="EgwDataGrid\EgwDataGrid.vb" />
|
||||
<Compile Include="EgwRightFrozenDataGrid\EgwRightFrozenColumn.vb" />
|
||||
<Compile Include="EgwRightFrozenDataGrid\EgwRightFrozenDataGrid.xaml.vb">
|
||||
<DependentUpon>EgwRightFrozenDataGrid.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -52,5 +52,5 @@ Imports System.Windows
|
||||
' Revision
|
||||
'
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.2.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.2.1")>
|
||||
<Assembly: AssemblyVersion("3.1.3.6")>
|
||||
<Assembly: AssemblyFileVersion("3.1.3.6")>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgwWPFBaseLib">
|
||||
@@ -53,18 +53,5 @@
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:EgwDataGrid}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:EgwDataGrid}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user