Skip to content

Commit 714aa46

Browse files
update examples
1 parent df167f8 commit 714aa46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+711
-664
lines changed

CS/CollectionViewExample/App.xaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
33
xmlns:windows="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls"
4+
xmlns:dx="clr-namespace:DevExpress.Maui.Core;assembly=DevExpress.Maui.Core"
45
xmlns:local="clr-namespace:CollectionViewExample"
56
x:Class="CollectionViewExample.App"
67
windows:Application.ImageDirectory="Assets">
8+
<Application.Resources>
9+
<Style TargetType="Shell" ApplyToDerivedTypes="True">
10+
<Setter Property="Shell.BackgroundColor" Value="{dx:ThemeColor Surface}" />
11+
<Setter Property="Shell.ForegroundColor" Value="{dx:ThemeColor OnSurfaceVariant}" />
12+
<Setter Property="Shell.TitleColor" Value="{dx:ThemeColor OnSurface}" />
13+
<Setter Property="Shell.NavBarHasShadow" Value="False" />
14+
<Setter Property="Shell.TabBarBackgroundColor" Value="{dx:ThemeColor SurfaceContainer}" />
15+
<Setter Property="Shell.TabBarForegroundColor" Value="{dx:ThemeColor Primary}" />
16+
<Setter Property="Shell.TabBarTitleColor" Value="{dx:ThemeColor Primary}" />
17+
<Setter Property="Shell.TabBarUnselectedColor" Value="{dx:ThemeColor OnSurfaceVariant}" />
18+
</Style>
19+
</Application.Resources>
720
</Application>

CS/CollectionViewExample/CollectionViewExample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737
<RuntimeIdentifier Condition="$(TargetFramework.Contains('-ios'))">iossimulator-x64</RuntimeIdentifier>
3838
<UseInterpreter Condition="$(TargetFramework.Contains('-android'))">False</UseInterpreter>
3939
</PropertyGroup>
40-
</Project>
40+
</Project>

CS/CollectionViewExample/MainPage.xaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
33
xmlns:dxcv="clr-namespace:DevExpress.Maui.CollectionView;assembly=DevExpress.Maui.CollectionView"
4+
xmlns:dx="clr-namespace:DevExpress.Maui.Core;assembly=DevExpress.Maui.Core"
45
xmlns:local="clr-namespace:CollectionViewExample"
56
x:Class="CollectionViewExample.MainPage"
67
BackgroundColor="{DynamicResource PageBackgroundColor}">
@@ -17,12 +18,12 @@
1718
<ColumnDefinition Width="*"/>
1819
</Grid.ColumnDefinitions>
1920
<Grid Margin="0" Padding="0" ColumnSpacing="0" RowSpacing="0">
20-
<Image Source="{Binding Photo}" VerticalOptions="Center"
21+
<dx:DXImage Source="{Binding Photo}" VerticalOptions="Center"
2122
HorizontalOptions="Center" WidthRequest="48" HeightRequest="48">
22-
<Image.Clip>
23+
<dx:DXImage.Clip>
2324
<EllipseGeometry RadiusX="24" RadiusY="24" Center="24, 24" />
24-
</Image.Clip>
25-
</Image>
25+
</dx:DXImage.Clip>
26+
</dx:DXImage>
2627
<Ellipse Margin="0"
2728
Fill="Transparent"
2829
Stroke="LightGray"
@@ -33,15 +34,15 @@
3334
HorizontalOptions="Center">
3435
</Ellipse>
3536
</Grid>
36-
<StackLayout Grid.Column="1"
37-
Padding="18,1,18,7"
38-
Orientation="Vertical">
37+
<dx:DXStackLayout Grid.Column="1"
38+
Padding="18,1,18,7"
39+
Orientation="Vertical">
3940
<Label Text="{Binding Name}"
4041
Margin="0,2"
41-
TextColor="#55575c"/>
42+
TextColor="{dx:ThemeColor OnSurface}"/>
4243
<Label Text="{Binding Phone}"
43-
TextColor="#959aa0"/>
44-
</StackLayout>
44+
TextColor="{dx:ThemeColor OnSurfaceVariant}"/>
45+
</dx:DXStackLayout>
4546
</Grid>
4647
</DataTemplate>
4748
</dxcv:DXCollectionView.ItemTemplate>

CS/CollectionViewExample/MauiProgram.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
using Microsoft.Maui.Hosting;
44
using DevExpress.Maui;
55
using DevExpress.Maui.CollectionView;
6+
using DevExpress.Maui.Core;
67

78
namespace CollectionViewExample {
89
public static class MauiProgram {
910
public static MauiApp CreateMauiApp() {
11+
ThemeManager.UseAndroidSystemColor = false;
12+
ThemeManager.Theme = new Theme(ThemeSeedColor.Purple);
1013
var builder = MauiApp.CreateBuilder();
1114
builder
1215
.UseMauiApp<App>()

CS/CollectionViewExample/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This example shows how to add a [DXCollectionView](https://docs.devexpress.com/M
1212
## Documentation
1313

1414
- [DXCollectionView](https://docs.devexpress.com/MAUI/DevExpress.Maui.CollectionView.DXCollectionView)
15-
- [Filter, Sort, and Group Data in Collection View for .NET MAUI](https://docs.devexpress.com/MAUI/404126/collection-view/filter-sort-and-group-data?v=22.2)
15+
- [Filter, Sort, and Group Data in Collection View for .NET MAUI](https://docs.devexpress.com/MAUI/404126/collection-view/filter-sort-and-group-data)
1616

1717
## More Examples
1818

CS/CollectionViewFilteringUI/CollectionViewFilteringUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@
8181
<Generator>MSBuild:Compile</Generator>
8282
</MauiXaml>
8383
</ItemGroup>
84-
</Project>
84+
</Project>

CS/CollectionViewFilteringUI/MainPage.xaml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
33
xmlns:dxco="clr-namespace:DevExpress.Maui.Controls;assembly=DevExpress.Maui.Controls"
44
xmlns:dxcv="clr-namespace:DevExpress.Maui.CollectionView;assembly=DevExpress.Maui.CollectionView"
5+
xmlns:dx="clr-namespace:DevExpress.Maui.Core;assembly=DevExpress.Maui.Core"
56
xmlns:dxe="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors"
67
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
78
xmlns:local="clr-namespace:CollectionViewFilteringUI"
@@ -13,15 +14,16 @@
1314
Background="{StaticResource ThemeBackgroundBrush}"
1415
x:Class= "CollectionViewFilteringUI.MainPage">
1516
<ContentPage.Behaviors>
16-
<toolkit:StatusBarBehavior StatusBarColor="{AppThemeBinding Light={StaticResource BackgroundThemeColor}, Dark={StaticResource BackgroundThemeColorDark}}" StatusBarStyle="{AppThemeBinding Light=DarkContent, Dark=LightContent}" />
17+
<dx:SystemBarBehavior AndroidStatusBarBackground="{AppThemeBinding Light={StaticResource BackgroundThemeColor}, Dark={StaticResource BackgroundThemeColorDark}}" AndroidNavigationBarBackground="{AppThemeBinding Light={StaticResource BackgroundThemeColor}, Dark={StaticResource BackgroundThemeColorDark}}"/>
1718
</ContentPage.Behaviors>
1819
<ContentPage.Resources>
1920
<utils:EnumToDescriptionConverter x:Key="enumToDesriptionConverter"/>
2021
<DataTemplate x:Key="houseCardTemplate">
21-
<Border Margin="{OnIdiom Phone='18,9,18,9', Tablet='40,20,40,20'}"
22-
StrokeShape="RoundRectangle 10,10,10,10"
23-
BackgroundColor="{AppThemeBinding Light={StaticResource HouseCardBackgroundColor}, Dark={StaticResource HouseCardBackgroundColorDark}}">
24-
<Border.Shadow>
22+
<dx:DXBorder Margin="{OnIdiom Phone='18,9,18,9', Tablet='40,20,40,20'}"
23+
CornerRadius="10"
24+
BorderThickness="1"
25+
BackgroundColor="{AppThemeBinding Light={StaticResource HouseCardBackgroundColor}, Dark={StaticResource HouseCardBackgroundColorDark}}">
26+
<dx:DXBorder.Shadow>
2527
<OnPlatform x:TypeArguments="Shadow">
2628
<On Platform="iOS">
2729
<On.Value>
@@ -40,9 +42,9 @@
4042
</On.Value>
4143
</On>
4244
</OnPlatform>
43-
</Border.Shadow>
44-
<utils:DockLayout RowSpacing="0">
45-
<Grid utils:DockLayout.Dock="Top"
45+
</dx:DXBorder.Shadow>
46+
<dx:DXDockLayout VerticalSpacing="0">
47+
<Grid dx:DXDockLayout.Dock="Top"
4648
RowSpacing="0"
4749
ColumnSpacing="0"
4850
Padding="0">
@@ -62,16 +64,16 @@
6264
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource ToogleFavoriteIconBackgroundColor}, Dark={StaticResource ToogleFavoriteIconBackgroundColorDark}}"/>
6365
</DataTrigger>
6466
</Border.Triggers>
65-
<dxco:DXImage
67+
<dx:DXImage
6668
Margin="12"
6769
Source="filteringui_like"
6870
TintColor="{AppThemeBinding Light={StaticResource FavoriteIconStrokeColor}, Dark={StaticResource FavoriteIconStrokeColorDark}}">
69-
<dxco:DXImage.Triggers>
70-
<DataTrigger Binding="{Binding IsFavorite}" Value="True" TargetType="dxco:DXImage">
71+
<dx:DXImage.Triggers>
72+
<DataTrigger Binding="{Binding IsFavorite}" Value="True" TargetType="dx:DXImage">
7173
<Setter Property="TintColor" Value="{AppThemeBinding Light={StaticResource ToogleFavoriteIconStrokeColor}, Dark={StaticResource ToogleFavoriteIconStrokeColorDark}}"/>
7274
</DataTrigger>
73-
</dxco:DXImage.Triggers>
74-
</dxco:DXImage>
75+
</dx:DXImage.Triggers>
76+
</dx:DXImage>
7577
<Border.GestureRecognizers>
7678
<TapGestureRecognizer
7779
NumberOfTapsRequired="1"
@@ -80,18 +82,18 @@
8082
</Border.GestureRecognizers>
8183
</Border>
8284
</Grid>
83-
<utils:DockLayout Padding="14,0,14,14" RowSpacing="8" ColumnSpacing="8">
84-
<Label utils:DockLayout.Dock="Top"
85+
<dx:DXDockLayout Padding="14,0,14,14" VerticalSpacing="8" HorizontalSpacing="8">
86+
<Label dx:DXDockLayout.Dock="Top"
8587
Text="{Binding Type, Converter={StaticResource enumToDesriptionConverter}}"
8688
TextColor="{AppThemeBinding Light={StaticResource HouseTypeTextColor}, Dark={StaticResource HouseTypeTextColorDark}}"
8789
FontAttributes="Bold"
8890
FontSize="{OnIdiom Phone=16, Tablet=18}"/>
89-
<dxco:DXImage utils:DockLayout.Dock="Left"
91+
<dx:DXImage dx:DXDockLayout.Dock="Left"
9092
Margin="0,0,0,2"
9193
VerticalOptions="Start"
9294
Source="filteringui_location_small"
9395
TintColor="{AppThemeBinding Light={StaticResource AccentColor}, Dark={StaticResource AccentColorDark}}"/>
94-
<Grid utils:DockLayout.Dock="Left"
96+
<Grid dx:DXDockLayout.Dock="Left"
9597
Padding="0"
9698
Margin="0"
9799
ColumnDefinitions="*,Auto">
@@ -112,13 +114,13 @@
112114
HorizontalTextAlignment="End"
113115
FontSize="{OnIdiom Phone=16, Tablet=18}"/>
114116
</Grid>
115-
</utils:DockLayout>
116-
</utils:DockLayout>
117-
</Border>
117+
</dx:DXDockLayout>
118+
</dx:DXDockLayout>
119+
</dx:DXBorder>
118120
</DataTemplate>
119121
<DataTemplate x:Key="filteringUIFormTemplate">
120122
<utils:ScrollViewFix Background="{StaticResource ThemeBackgroundBrush}">
121-
<VerticalStackLayout>
123+
<dx:DXStackLayout Orientation="Vertical">
122124
<dxe:FilterRadioListPickerItem
123125
FieldName="City"
124126
ShowValuesOutOfFilter="true"
@@ -147,7 +149,7 @@
147149
<dxe:FilterCheckedChipGroupItem Text="Bedrooms" ShowValuesOutOfFilter="true" FieldName="Beds"/>
148150
<dxe:FilterNumericRangeItem Text="Year Built" FieldName="YearBuilt"/>
149151
<dxe:FilterCheckItem Text="Must have garage" FieldName="IsGarageExist"/>
150-
</VerticalStackLayout>
152+
</dx:DXStackLayout>
151153
</utils:ScrollViewFix>
152154
</DataTemplate>
153155
</ContentPage.Resources>
@@ -156,10 +158,10 @@
156158
</ContentPage.ToolbarItems>
157159
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource BackgroundThemeColor}, Dark={StaticResource BackgroundThemeColorDark}}">
158160
<dxco:TabView HeaderPanelPosition="Bottom" ItemHeaderPadding="0"
159-
ItemHeaderWidth="*" HeaderPanelBackgroundColor="Transparent"
160-
HeaderPanelPadding="0"
161-
IsSelectedItemIndicatorVisible="False"
162-
SelectedItemIndex="{Binding SelectedTabIndex}">
161+
ItemHeaderWidth="*" HeaderPanelBackgroundColor="Transparent"
162+
HeaderPanelPadding="0"
163+
IsSelectedItemIndicatorVisible="False"
164+
SelectedItemIndex="{Binding SelectedTabIndex}">
163165
<dxco:TabViewItem>
164166
<dxco:TabViewItem.HeaderContent>
165167
<local:TabHeaderControl Caption="Home" IconPath="filteringui_home" IsSelected="{Binding IsHomeTabSelected}"/>

CS/CollectionViewFilteringUI/Readme.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
<!-- default badges list -->
2-
<!-- default badges end -->
3-
41
# DevExpress CollectionView for .NET MAUI - Create a Filter UI Form
52

63
This example illustrates how you can create a filtering form. Once implemented, users can specify filter rules applied to multiple data source fields within the form.
@@ -13,7 +10,7 @@ This example illustrates how you can create a filtering form. Once implemented,
1310

1411
- Initialize the [DXCollectionView.FilteringUITemplate](https://docs.devexpress.com/MAUI/DevExpress.Maui.CollectionView.DXCollectionView.FilteringUITemplate) property with a DataTemplate (must include filter items). Filter items are separate controls within your application. These filter items automatically retrieve available values, format settings, and other information from the bound control (CollectionView). Once you specify `FilteringUITemplate`, filter items are automatically bound to the CollectionView.
1512

16-
- Bind the [ToolbarItem.Command](https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.controls.menuitem.command?view=net-maui-7.0#microsoft-maui-controls-menuitem-command) property to the [DXCollectionViewCommands.ShowFilteringUIForm](https://docs.devexpress.com/MAUI/DevExpress.Maui.CollectionView.DXCollectionViewCommands.ShowFilteringUIForm) property. The `ShowFilteringUIForm` returns a command that invokes the filter form defined by `FilteringUITemplate`.
13+
- Bind the [ToolbarItem.Command](https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.controls.menuitem.command#microsoft-maui-controls-menuitem-command) property to the [DXCollectionViewCommands.ShowFilteringUIForm](https://docs.devexpress.com/MAUI/DevExpress.Maui.CollectionView.DXCollectionViewCommands.ShowFilteringUIForm) property. The `ShowFilteringUIForm` returns a command that invokes the filter form defined by `FilteringUITemplate`.
1714

1815
## Files to Review
1916

@@ -22,6 +19,7 @@ This example illustrates how you can create a filtering form. Once implemented,
2219
## Documentation
2320

2421
- [CollectionView - Create Filtering UI](https://docs.devexpress.com/MAUI/404126/collection-view/filter-sort-and-group-data#create-filtering-ui)
22+
- [Layouts](https://docs.devexpress.com/MAUI/404602/layouts/layouts)
2523

2624
## More Examples
2725

0 commit comments

Comments
 (0)