-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from AathifMahir/vNext
vNext of MauiIcons
- Loading branch information
Showing
33 changed files
with
614 additions
and
112 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
x:Class="MauiIcons.Sample.BindingPage" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:local="clr-namespace:MauiIcons.Sample" | ||
xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons" | ||
x:Name="thisRoot" | ||
Title="BindingPage" | ||
x:DataType="local:BindingPage"> | ||
<ScrollView> | ||
<VerticalStackLayout | ||
Padding="30,0" | ||
Spacing="25" | ||
VerticalOptions="Center"> | ||
|
||
<HorizontalStackLayout HorizontalOptions="Center" Spacing="20"> | ||
|
||
<Label Text="{mi:Fluent BindingContext={x:Reference thisRoot}, Icon={Binding MyIcon}, IconColor={Binding MyColor}}" /> | ||
<Image> | ||
<Image.Source> | ||
<FontImageSource Glyph="{mi:Fluent BindingContext={x:Reference thisRoot}, Icon={Binding MyIcon}, IconColor={Binding MyColor}}" /> | ||
</Image.Source> | ||
</Image> | ||
|
||
<Image Source="{mi:Fluent BindingContext={x:Reference thisRoot}, Icon={Binding MyIcon}, IconColor={Binding MyColor}}" /> | ||
|
||
<ImageButton Source="{mi:Fluent BindingContext={x:Reference thisRoot}, Icon={Binding MyIcon}, IconColor={Binding MyColor}}" /> | ||
|
||
<mi:MauiIcon Icon="{mi:Fluent}" /> | ||
</HorizontalStackLayout> | ||
|
||
<Button Clicked="Button_Clicked" Text="Change Icon and Color" /> | ||
|
||
</VerticalStackLayout> | ||
</ScrollView> | ||
</ContentPage> |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using MauiIcons.Fluent; | ||
|
||
namespace MauiIcons.Sample; | ||
|
||
public partial class BindingPage : ContentPage | ||
{ | ||
public BindingPage() | ||
{ | ||
InitializeComponent(); | ||
BindingContext = this; | ||
} | ||
|
||
private Color _color = Colors.Red; | ||
public Color MyColor | ||
{ | ||
get => _color; | ||
set | ||
{ | ||
if (value != _color) | ||
{ | ||
_color = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
private FluentIcons _icon = FluentIcons.Accessibility16; | ||
|
||
public FluentIcons MyIcon | ||
{ | ||
get => _icon; | ||
set | ||
{ | ||
if (value != _icon) | ||
{ | ||
_icon = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
private void Button_Clicked(object sender, EventArgs e) | ||
{ | ||
MyColor = MyColor == Colors.Red ? Colors.Green : Colors.Red; | ||
MyIcon = MyIcon == FluentIcons.Accessibility16 ? FluentIcons.AddCircle24 : FluentIcons.Accessibility16; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Globalization; | ||
|
||
namespace MauiIcons.Core.Converters; | ||
internal sealed class DefaultColorConverter : IValueConverter | ||
{ | ||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) => | ||
value switch | ||
{ | ||
null when parameter is Color color => color, | ||
Color colorValue => colorValue, | ||
_ => null | ||
}; | ||
|
||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
Oops, something went wrong.