XAML Components for a better UI It provides:
DataGridListView
: Simple ListView with a GridView Layout with binding support for ItemSource List; it supports binding on ListView ItemSourceProperty and also main UserControlTextBoxPro
: Simple User Control which incapsulate a TextBox Control with a shadind non-editable text when is empty; it supports common features of TextBox
Just a quick reference guide:
- Just Download the repo and include the project into your solution
- Use Components in your XAML code
Don't forget to populate Columns Collection attribute with GridViewColumn
control
Just include it in your UserControl component
<UserControl x:Class="CustomNamespace.CustomControlClass"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="clr-namespace:UI.Components;assembly=UI.Components">
<UserControl.Resources>
<my:CustomClassViewModel x:Key="model"/>
</UserControl.Resources>
<StackPanel>
<Label Content="There is someting in the stackpanel, I Suppose"/>
<ui:TextBoxPro x:Name="GridSearchTextNotBinded" Text="Hello There"/>
<ui:TextBoxPro Text={Binding} ItalicText="Type your data here"
TextChanged="OnTextChanged" />
<ui:TextBoxPro Text={Binding} ItalicText="This text won't be modified"
TextChanged="OnTextChanged" />
</StackPanel>
</UserControl>
Replace CustomNamespace.CustomControlClass
with the Control Class name you are going to implement.
Replace CustomNamespace.CustomModelnamespace
with the ViewModel Namespace you are working in.
<my:CustomClassViewModel x:Key="model"/>
is the static context reference we're pointing to
CustomItemsSource
is the custom property (of type ICollectionView) referenced in your ViewModel Class.
ToDo
, Field1
, Field2
, Field3
, Field4
are the custom property of the item in CustomItemsSource collection.
<UserControl x:Class="CustomNamespace.CustomControlClass"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:comp="clr-namespace:UI.Components;assembly=UI.Components"
xmlns:my="clr-namespace:CustomNamespace.CustomModelnamespace">
<UserControl.Resources>
<my:CustomClassViewModel x:Key="model"/>
</UserControl.Resources>
<StackPanel>
<Label Content="There is someting in the grid, I Suppose"/>
<comp:DataGridListView
ItemsSource="{Binding Source={StaticResource model}, Path=CustomItemsSource}">
<comp:DataGridListView.Columns>
<GridViewColumn Header="ToDo">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Margin="6" IsChecked="{Binding ToDo}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Field1 Header" DisplayMemberBinding="{Binding Field1}" />
<GridViewColumn Header="Field2 Header" DisplayMemberBinding="{Binding Field2}" />
<GridViewColumn Header="Field3 Header" DisplayMemberBinding="{Binding Field3}" />
</comp:DataGridListView.Columns>
</comp:DataGridListView>
</StackPanel>
</UserControl>
Don't need particular stuffs: collection data is already filtered by the component. If you are going to use a ICollectionView with a filter, the total and the partial count shown at the bottom of the grid don't thake care of the unfiltered data list.
- Binding support for ItemSource List
- Binding support for ListView Selected Item
- Custom TextBox Control
- Automatic sort feature
Few remarks for this work:
- Never tested on .Net Framework > 4 or .Net Core Framework
- Requires xaml features and .Net Framework >= 3.5