-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes of List view default background color on windows
- Loading branch information
1 parent
aba9775
commit 1b7285f
Showing
6 changed files
with
176 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
<maui:MauiWinUIApplication | ||
x:Class="DemoApp.WinUI.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:maui="using:Microsoft.Maui" | ||
xmlns:local="using:DemoApp.WinUI"> | ||
<maui:MauiWinUIApplication.Resources> | ||
<StaticResource x:Key="ListViewItemBackgroundSelectedPointerOver" ResourceKey="ListViewItemBackgroundColor" /> | ||
<StaticResource x:Key="ListViewItemBackgroundSelected" ResourceKey="ListViewItemBackgroundColor" /> | ||
<SolidColorBrush x:Key="ListViewItemBackgroundColor" Color="#DCEDF9" /> | ||
<Thickness x:Key="TextControlBorderThemeThickness">0</Thickness> | ||
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0</Thickness> | ||
</maui:MauiWinUIApplication.Resources> | ||
<maui:MauiWinUIApplication x:Class="DemoApp.WinUI.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:maui="using:Microsoft.Maui" | ||
xmlns:local="using:DemoApp.WinUI"> | ||
<maui:MauiWinUIApplication.Resources> | ||
<StaticResource x:Key="ListViewItemBackgroundSelectedPointerOver" | ||
ResourceKey="ListViewItemBackgroundColor" /> | ||
<StaticResource x:Key="ListViewItemBackgroundSelected" | ||
ResourceKey="ListViewItemBackgroundColor" /> | ||
<SolidColorBrush x:Key="ListViewItemBackgroundColor" | ||
Color="#DCEDF9" /> | ||
<Thickness x:Key="TextControlBorderThemeThickness">0</Thickness> | ||
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0</Thickness> | ||
</maui:MauiWinUIApplication.Resources> | ||
</maui:MauiWinUIApplication> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
Trimble.Modus.Components/Controls/ListView/TemplateCell.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ViewCell xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Name="CustomViewCell" | ||
xmlns:constant="clr-namespace:Trimble.Modus.Components.Constant" | ||
x:Class="Trimble.Modus.Components.TemplateCell"> | ||
<Grid x:Name="grid" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"> | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Name="CustomViewCell" | ||
xmlns:constant="clr-namespace:Trimble.Modus.Components.Constant" | ||
x:Class="Trimble.Modus.Components.TemplateCell"> | ||
<Grid x:Name="grid" | ||
VerticalOptions="FillAndExpand" | ||
HorizontalOptions="FillAndExpand"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
<ContentView | ||
Content="{Binding Source={x:Reference CustomViewCell}, Path=Content}"> | ||
<ContentView Content="{Binding Source={x:Reference CustomViewCell}, Path=Content}"> | ||
</ContentView> | ||
</Grid> | ||
</Grid> | ||
</ViewCell> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,57 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ViewCell xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:converters="clr-namespace:Trimble.Modus.Components.Converters" | ||
xmlns:constant="clr-namespace:Trimble.Modus.Components.Constant" | ||
xmlns:helpers="clr-namespace:Trimble.Modus.Components.Helpers" | ||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" | ||
x:Name="textCell" | ||
x:Class="Trimble.Modus.Components.TextCell"> | ||
|
||
<Grid x:Name="grid" > | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:converters="clr-namespace:Trimble.Modus.Components.Converters" | ||
xmlns:constant="clr-namespace:Trimble.Modus.Components.Constant" | ||
xmlns:helpers="clr-namespace:Trimble.Modus.Components.Helpers" | ||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" | ||
x:Name="textCell" | ||
x:Class="Trimble.Modus.Components.TextCell"> | ||
<Grid x:Name="grid" | ||
BindingContext="{Binding Source={x:Reference textCell}}" | ||
HeightRequest="{Binding Description, Converter={StaticResource DescriptionToRowHeightConverter}}" | ||
ColumnSpacing="12" | ||
ColumnDefinitions="auto,*,auto" | ||
Padding="12,6"> | ||
<Grid.Resources> | ||
<ResourceDictionary> | ||
<toolkit:IsNotNullConverter x:Key="ImageNullOrEmptyBoolConverter" /> | ||
<toolkit:IsStringNotNullOrEmptyConverter x:Key="IsStringNotNullOrEmptyConverter" /> | ||
<converters:DescriptionToRowHeightConverter x:Key="DescriptionToRowHeightConverter" /> | ||
</ResourceDictionary> | ||
</Grid.Resources> | ||
|
||
<Grid BindingContext="{Binding Source={x:Reference textCell}}" HeightRequest="{Binding Description, Converter={StaticResource DescriptionToRowHeightConverter}}" ColumnSpacing="12" Padding="12,6" > | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
</ResourceDictionary> | ||
</Grid.Resources> | ||
|
||
<Image Source="{Binding LeftIconSource}" IsVisible="{Binding LeftIconSource, Converter={StaticResource ImageNullOrEmptyBoolConverter}}" | ||
WidthRequest="24" HeightRequest="24" VerticalOptions="Center" HorizontalOptions="Start"/> | ||
<Image Source="{Binding LeftIconSource}" | ||
IsVisible="{Binding LeftIconSource, Converter={StaticResource ImageNullOrEmptyBoolConverter}}" | ||
WidthRequest="24" | ||
HeightRequest="24" | ||
VerticalOptions="Center" | ||
HorizontalOptions="Start" /> | ||
|
||
<StackLayout Grid.Column="1" Spacing="4" HorizontalOptions="Start" VerticalOptions="Center" Orientation="Vertical"> | ||
<Label Text="{Binding Title}" FontFamily="OpenSansRegular" IsVisible="{Binding Title, Converter={StaticResource IsStringNotNullOrEmptyConverter}}" | ||
FontSize="16" VerticalOptions="StartAndExpand" /> | ||
<Label Text="{Binding Description}" FontFamily="OpenSansRegular" IsVisible="{Binding Description, Converter={StaticResource IsStringNotNullOrEmptyConverter}}" | ||
FontSize="14" LineBreakMode="TailTruncation" MaxLines="1" /> | ||
</StackLayout> | ||
<StackLayout Grid.Column="1" | ||
Spacing="4" | ||
HorizontalOptions="Start" | ||
VerticalOptions="Center" | ||
Orientation="Vertical"> | ||
<Label Text="{Binding Title}" | ||
FontFamily="OpenSansRegular" | ||
IsVisible="{Binding Title, Converter={StaticResource IsStringNotNullOrEmptyConverter}}" | ||
FontSize="16" | ||
VerticalOptions="StartAndExpand" /> | ||
<Label Text="{Binding Description}" | ||
FontFamily="OpenSansRegular" | ||
IsVisible="{Binding Description, Converter={StaticResource IsStringNotNullOrEmptyConverter}}" | ||
FontSize="14" | ||
LineBreakMode="TailTruncation" | ||
MaxLines="1" /> | ||
</StackLayout> | ||
|
||
<Image Grid.Column="2" Source="{Binding RightIconSource}" HorizontalOptions="End" IsVisible="{Binding RightIconSource, Converter={StaticResource ImageNullOrEmptyBoolConverter}}" | ||
WidthRequest="24" HeightRequest="24" VerticalOptions="Center"/> | ||
</Grid> | ||
<Image Grid.Column="2" | ||
Source="{Binding RightIconSource}" | ||
HorizontalOptions="End" | ||
IsVisible="{Binding RightIconSource, Converter={StaticResource ImageNullOrEmptyBoolConverter}}" | ||
WidthRequest="24" | ||
HeightRequest="24" | ||
VerticalOptions="Center" /> | ||
</Grid> | ||
|
||
</ViewCell> |
Oops, something went wrong.