@@ -16,7 +16,6 @@ tags: [ "NET", "codefrydev", "C sharp", "CFD","maui" , "layout","Carousal"]
1616keywords : [ "NET", "codefrydev", "C sharp", "CFD","maui" , "Carousal"]
1717---
1818
19-
2019### \#\# 1. Create the Reusable Component Files 🧱
2120
2221First, add a new item to your project. Choose the ** .NET MAUI ContentView (XAML)** template. Name it something descriptive, like ` FeaturedCarouselView.xaml ` .
@@ -31,7 +30,33 @@ First, add a new item to your project. Choose the **.NET MAUI ContentView (XAML)
3130 xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
3231 xmlns : local =" clr-namespace:YourMauiProjectName"
3332 x : Class =" YourMauiProjectName.FeaturedCarouselView" >
34-
33+ <ContentView .Resources>
34+ <ResourceDictionary >
35+ <Color x : Key =" CardBackgroundColor" >#F9FAFB</Color >
36+ <Color x : Key =" ForegroundColor" >#111827</Color >
37+ <Color x : Key =" MutedForegroundColor" >#6B7280</Color >
38+ <Color x : Key =" BorderColor" >#E5E7EB</Color >
39+ <Color x : Key =" PrimaryColor" >#4A90E2</Color >
40+ <Style x : Key =" CardBorderStyle" TargetType =" Border" >
41+ <Setter Property =" Stroke" Value =" {StaticResource BorderColor}" />
42+ <Setter Property =" StrokeThickness" Value =" 1" />
43+ <Setter Property =" BackgroundColor" Value =" {StaticResource PageBackgroundColor}" />
44+ <Setter Property =" StrokeShape" Value =" RoundRectangle 8" />
45+ <Setter Property =" Padding" Value =" 0" />
46+ <Setter Property =" Shadow" >
47+ <Shadow Brush =" Black" Offset =" 2,2" Radius =" 5" Opacity =" 0.1" />
48+ </Setter >
49+ </Style >
50+ <Style x : Key =" PrimaryButtonStyle" TargetType =" Button" >
51+ <Setter Property =" BackgroundColor" Value =" {StaticResource PrimaryColor}" />
52+ <Setter Property =" TextColor" Value =" {StaticResource PrimaryTextColor}" />
53+ <Setter Property =" FontAttributes" Value =" Bold" />
54+ <Setter Property =" HeightRequest" Value =" 48" />
55+ <Setter Property =" CornerRadius" Value =" 8" />
56+ <Setter Property =" Padding" Value =" 24,0" />
57+ </Style >
58+ </ResourceDictionary >
59+ </ContentView .Resources>
3560 <VerticalStackLayout Spacing =" 16" BackgroundColor =" {StaticResource CardBackgroundColor}" >
3661 <CarouselView x : Name =" FeaturedCarousel"
3762 IndicatorView =" FeaturedIndicator"
0 commit comments