From 03e25982fc7363a8e668c06a671bb6d4bf492b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20G=C3=B6n=C3=BClta=C5=9F?= Date: Sat, 27 Jul 2024 14:23:35 +0300 Subject: [PATCH] 8.6.1 version published. --- .../Extensions/BindableLayoutExtensions.cs | 7 +++ .../Extensions/EditorExtension.cs | 51 +++++++++++++++++- .../Extensions/EntryCellExtension.cs | 52 +++++++++++++++++- .../Extensions/EntryExtension.cs | 53 +++++++++++++++++-- .../Extensions/PickerExtension.cs | 53 +++++++++++++++++-- .../Extensions/SearchBarExtension.cs | 53 +++++++++++++++++-- .../FmgLib.MauiMarkup.csproj | 2 +- 7 files changed, 257 insertions(+), 14 deletions(-) diff --git a/libs/FmgLib.MauiMarkup/Extensions/BindableLayoutExtensions.cs b/libs/FmgLib.MauiMarkup/Extensions/BindableLayoutExtensions.cs index 14bf63a..4f40017 100644 --- a/libs/FmgLib.MauiMarkup/Extensions/BindableLayoutExtensions.cs +++ b/libs/FmgLib.MauiMarkup/Extensions/BindableLayoutExtensions.cs @@ -47,6 +47,13 @@ public static T ItemsSources(this T layout, IEnumerable source) where T : Bin return layout; } + public static T ItemsSources(this T layout, Func, IPropertyBuilder> configure) where T : BindableObject, Microsoft.Maui.ILayout + { + var context = new PropertyContext(layout, BindableLayout.ItemsSourceProperty); + configure(context).Build(); + return layout; + } + public static T ItemTemplates(this T layout, DataTemplate template) where T : BindableObject, Microsoft.Maui.ILayout { BindableLayout.SetItemTemplate(layout, template); diff --git a/libs/FmgLib.MauiMarkup/Extensions/EditorExtension.cs b/libs/FmgLib.MauiMarkup/Extensions/EditorExtension.cs index 188adda..6bd8df9 100644 --- a/libs/FmgLib.MauiMarkup/Extensions/EditorExtension.cs +++ b/libs/FmgLib.MauiMarkup/Extensions/EditorExtension.cs @@ -344,7 +344,7 @@ public static T OnCompleted(this T self, Action action) self.Completed += (o, arg) => action(self); return self; } - + public static T TextCenterHorizontal(this T self) where T : Editor @@ -398,6 +398,54 @@ public static T TextBottomStart(this T self) return self; } + public static T TextTopCenterH(this T self) + where T : Editor + { + self.SetValue(Editor.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(Editor.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextBottomCenterH(this T self) + where T : Editor + { + self.SetValue(Editor.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(Editor.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextCenterVEnd(this T self) + where T : Editor + { + self.SetValue(Editor.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(Editor.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T TextCenterVStart(this T self) + where T : Editor + { + self.SetValue(Editor.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(Editor.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T AlignText(this T self, TextAlignment vertical, TextAlignment horizontal) + where T : Editor + { + self.SetValue(Editor.VerticalTextAlignmentProperty, vertical); + self.SetValue(Editor.HorizontalTextAlignmentProperty, horizontal); + return self; + } + + public static SettersContext AlignText(this SettersContext self, TextAlignment vertical, TextAlignment horizontal) + where T : Editor + { + self.XamlSetters.Add(new Setter { Property = Editor.VerticalTextAlignmentProperty, Value = vertical }); + self.XamlSetters.Add(new Setter { Property = Editor.HorizontalTextAlignmentProperty, Value = horizontal }); + return self; + } + public static T TextTopEnd(this T self) where T : Editor { @@ -428,5 +476,4 @@ public static T TextEnd(this T self) return self; } - } \ No newline at end of file diff --git a/libs/FmgLib.MauiMarkup/Extensions/EntryCellExtension.cs b/libs/FmgLib.MauiMarkup/Extensions/EntryCellExtension.cs index 9c7b0f4..ee659bb 100644 --- a/libs/FmgLib.MauiMarkup/Extensions/EntryCellExtension.cs +++ b/libs/FmgLib.MauiMarkup/Extensions/EntryCellExtension.cs @@ -248,10 +248,10 @@ public static T OnCompleted(this T self, Action action) self.Completed += (o, arg) => action(self); return self; } - + public static T TextCenterHorizontal(this T self) - where T : EntryCell + where T : EntryCell { self.SetValue(EntryCell.HorizontalTextAlignmentProperty, TextAlignment.Center); return self; @@ -302,6 +302,54 @@ public static T TextBottomStart(this T self) return self; } + public static T TextTopCenterH(this T self) + where T : EntryCell + { + self.SetValue(EntryCell.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(EntryCell.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextBottomCenterH(this T self) + where T : EntryCell + { + self.SetValue(EntryCell.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(EntryCell.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextCenterVEnd(this T self) + where T : EntryCell + { + self.SetValue(EntryCell.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(EntryCell.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T TextCenterVStart(this T self) + where T : EntryCell + { + self.SetValue(EntryCell.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(EntryCell.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T AlignText(this T self, TextAlignment vertical, TextAlignment horizontal) + where T : EntryCell + { + self.SetValue(EntryCell.VerticalTextAlignmentProperty, vertical); + self.SetValue(EntryCell.HorizontalTextAlignmentProperty, horizontal); + return self; + } + + public static SettersContext AlignText(this SettersContext self, TextAlignment vertical, TextAlignment horizontal) + where T : EntryCell + { + self.XamlSetters.Add(new Setter { Property = EntryCell.VerticalTextAlignmentProperty, Value = vertical }); + self.XamlSetters.Add(new Setter { Property = EntryCell.HorizontalTextAlignmentProperty, Value = horizontal }); + return self; + } + public static T TextTopEnd(this T self) where T : EntryCell { diff --git a/libs/FmgLib.MauiMarkup/Extensions/EntryExtension.cs b/libs/FmgLib.MauiMarkup/Extensions/EntryExtension.cs index 0f5105d..049f73a 100644 --- a/libs/FmgLib.MauiMarkup/Extensions/EntryExtension.cs +++ b/libs/FmgLib.MauiMarkup/Extensions/EntryExtension.cs @@ -472,10 +472,10 @@ public static T OnCompleted(this T self, Action action) self.Completed += (o, arg) => action(self); return self; } - + public static T TextCenterHorizontal(this T self) - where T : Entry + where T : Entry { self.SetValue(Entry.HorizontalTextAlignmentProperty, TextAlignment.Center); return self; @@ -526,6 +526,54 @@ public static T TextBottomStart(this T self) return self; } + public static T TextTopCenterH(this T self) + where T : Entry + { + self.SetValue(Entry.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(Entry.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextBottomCenterH(this T self) + where T : Entry + { + self.SetValue(Entry.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(Entry.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextCenterVEnd(this T self) + where T : Entry + { + self.SetValue(Entry.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(Entry.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T TextCenterVStart(this T self) + where T : Entry + { + self.SetValue(Entry.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(Entry.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T AlignText(this T self, TextAlignment vertical, TextAlignment horizontal) + where T : Entry + { + self.SetValue(Entry.VerticalTextAlignmentProperty, vertical); + self.SetValue(Entry.HorizontalTextAlignmentProperty, horizontal); + return self; + } + + public static SettersContext AlignText(this SettersContext self, TextAlignment vertical, TextAlignment horizontal) + where T : Entry + { + self.XamlSetters.Add(new Setter { Property = Entry.VerticalTextAlignmentProperty, Value = vertical }); + self.XamlSetters.Add(new Setter { Property = Entry.HorizontalTextAlignmentProperty, Value = horizontal }); + return self; + } + public static T TextTopEnd(this T self) where T : Entry { @@ -556,5 +604,4 @@ public static T TextEnd(this T self) return self; } - } \ No newline at end of file diff --git a/libs/FmgLib.MauiMarkup/Extensions/PickerExtension.cs b/libs/FmgLib.MauiMarkup/Extensions/PickerExtension.cs index 79723e6..4c3e600 100644 --- a/libs/FmgLib.MauiMarkup/Extensions/PickerExtension.cs +++ b/libs/FmgLib.MauiMarkup/Extensions/PickerExtension.cs @@ -495,10 +495,10 @@ public static T OnSelectedIndexChanged(this T self, Action action) self.SelectedIndexChanged += (o, arg) => action(self); return self; } - + public static T TextCenterHorizontal(this T self) - where T : Picker + where T : Picker { self.SetValue(Picker.HorizontalTextAlignmentProperty, TextAlignment.Center); return self; @@ -549,6 +549,54 @@ public static T TextBottomStart(this T self) return self; } + public static T TextTopCenterH(this T self) + where T : Picker + { + self.SetValue(Picker.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(Picker.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextBottomCenterH(this T self) + where T : Picker + { + self.SetValue(Picker.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(Picker.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextCenterVEnd(this T self) + where T : Picker + { + self.SetValue(Picker.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(Picker.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T TextCenterVStart(this T self) + where T : Picker + { + self.SetValue(Picker.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(Picker.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T AlignText(this T self, TextAlignment vertical, TextAlignment horizontal) + where T : Picker + { + self.SetValue(Picker.VerticalTextAlignmentProperty, vertical); + self.SetValue(Picker.HorizontalTextAlignmentProperty, horizontal); + return self; + } + + public static SettersContext AlignText(this SettersContext self, TextAlignment vertical, TextAlignment horizontal) + where T : Picker + { + self.XamlSetters.Add(new Setter { Property = Picker.VerticalTextAlignmentProperty, Value = vertical }); + self.XamlSetters.Add(new Setter { Property = Picker.HorizontalTextAlignmentProperty, Value = horizontal }); + return self; + } + public static T TextTopEnd(this T self) where T : Picker { @@ -579,5 +627,4 @@ public static T TextEnd(this T self) return self; } - } diff --git a/libs/FmgLib.MauiMarkup/Extensions/SearchBarExtension.cs b/libs/FmgLib.MauiMarkup/Extensions/SearchBarExtension.cs index 4ba3762..e856e7d 100644 --- a/libs/FmgLib.MauiMarkup/Extensions/SearchBarExtension.cs +++ b/libs/FmgLib.MauiMarkup/Extensions/SearchBarExtension.cs @@ -419,10 +419,10 @@ public static T OnSearchButtonPressed(this T self, Action action) self.SearchButtonPressed += (o, arg) => action(self); return self; } - + public static T TextCenterHorizontal(this T self) - where T : SearchBar + where T : SearchBar { self.SetValue(SearchBar.HorizontalTextAlignmentProperty, TextAlignment.Center); return self; @@ -473,6 +473,54 @@ public static T TextBottomStart(this T self) return self; } + public static T TextTopCenterH(this T self) + where T : SearchBar + { + self.SetValue(SearchBar.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(SearchBar.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextBottomCenterH(this T self) + where T : SearchBar + { + self.SetValue(SearchBar.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(SearchBar.HorizontalTextAlignmentProperty, TextAlignment.Center); + return self; + } + + public static T TextCenterVEnd(this T self) + where T : SearchBar + { + self.SetValue(SearchBar.VerticalTextAlignmentProperty, TextAlignment.Start); + self.SetValue(SearchBar.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T TextCenterVStart(this T self) + where T : SearchBar + { + self.SetValue(SearchBar.VerticalTextAlignmentProperty, TextAlignment.End); + self.SetValue(SearchBar.HorizontalTextAlignmentProperty, TextAlignment.End); + return self; + } + + public static T AlignText(this T self, TextAlignment vertical, TextAlignment horizontal) + where T : SearchBar + { + self.SetValue(SearchBar.VerticalTextAlignmentProperty, vertical); + self.SetValue(SearchBar.HorizontalTextAlignmentProperty, horizontal); + return self; + } + + public static SettersContext AlignText(this SettersContext self, TextAlignment vertical, TextAlignment horizontal) + where T : SearchBar + { + self.XamlSetters.Add(new Setter { Property = SearchBar.VerticalTextAlignmentProperty, Value = vertical }); + self.XamlSetters.Add(new Setter { Property = SearchBar.HorizontalTextAlignmentProperty, Value = horizontal }); + return self; + } + public static T TextTopEnd(this T self) where T : SearchBar { @@ -503,5 +551,4 @@ public static T TextEnd(this T self) return self; } - } diff --git a/libs/FmgLib.MauiMarkup/FmgLib.MauiMarkup.csproj b/libs/FmgLib.MauiMarkup/FmgLib.MauiMarkup.csproj index 98f42ff..58ecaf1 100644 --- a/libs/FmgLib.MauiMarkup/FmgLib.MauiMarkup.csproj +++ b/libs/FmgLib.MauiMarkup/FmgLib.MauiMarkup.csproj @@ -11,7 +11,7 @@ FmgLib.MauiMarkup FmgLib.MauiMarkup with C# Markup classes and fluent helper methods FmgLib.MauiMarkup - 8.6.0 + 8.6.1 FmgYazılım Fmg Yazılım ©2024