Giter Site home page Giter Site logo

jurabek / freshessentials Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xam-consulting/freshessentials

0.0 2.0 0.0 208 KB

FreshEssentials for Xamarin.Forms has ONLY the most common extensions you need for Xamarin.Forms

License: Apache License 2.0

C# 84.29% PowerShell 11.27% Shell 4.45%

freshessentials's Introduction

FreshEssentials for Xamarin.Forms has ONLY the most common elements you need for Xamarin.Forms. It's contains the elements you need in almost every project and nothing more, things like BindablePicker, SegementedButtons, InverseBooleanConverter, TappedGestureAttached, ListViewItemTappedAttached and not much more. It's the lightweight essentials.

Configuration

iOS

To init Fresh Essentials on iOS, add the following line to your AppDelegate.cs:

new FreshEssentials.iOS.AdvancedFrameRendereriOS();

Controls

BindablePicker

BindablePicker inherits from Xamarin.Forms.Picker, you can binding data to ItemSource as Items, and also can set which property you want to display via DisplayProperty.

If you want to use it in XAML, you need to include the namespace first

xmlns:fe="clr-namespace:FreshEssentials;assembly=FreshEssentials"

Then

<fe:BindablePicker ItemsSource="{Binding MyCars}" SelectedItem="{Binding SelectedCar}" DisplayProperty="MakeAndModel" Title="Select..." />

AdvancedFrame (flexible rounded corners)

AdvancedFrame inherits from Frame, you can set corner type via Corners(There are only four type, left, right, all, none), you can also set CornerRadius and InnerBackground color

<fe:AdvancedFrame Corners="left" CornerRadius="10" InnerBackground="Blue" OutlineColor="Red" >
	<Label Text="Corners is left, CornerRadius is 10, InnerBackground is Blue" TextColor="White"/>
</fe:AdvancedFrame>

SegmentedButtonGroup

SegmentedButtonGroup is like iOS Segmented Controls, you can binding SelectedIndex for it

<fe:SegmentedButtonGroup OnColor="Blue" OffColor="White" SelectedIndex="{Binding SelectIndex, Mode=TwoWay}">
	<fe:SegmentedButtonGroup.LabelStyle>
		<Style TargetType="Label">
		    <Setter Property="FontSize" Value="12" />
			<Setter Property="FontAttributes" Value="Bold" />
		</Style>
	</fe:SegmentedButtonGroup.LabelStyle>
	<fe:SegmentedButtonGroup.SegmentedButtons>
		<fe:SegmentedButton Title="Button 1"/>
		<fe:SegmentedButton Title="Button 2"/>
		<fe:SegmentedButton Title="Button 3"/>
	</fe:SegmentedButtonGroup.SegmentedButtons>
</fe:SegmentedButtonGroup>
This is the component, works on iOS, Android and UWP soon.

Converters

InverseBooleanConverter

Used for binding inversed bool value

<ContentPage.Resources>
	<ResourceDictionary>
		 <fe:InverseBooleanConverter x:Key="InverseConverter" />
	</ResourceDictionary>
</ContentPage.Resources>

<Button Text="Click Me" IsVisible="{Binding ShowButton, Converter={StaticResource InverseConverter}}" />

Attached Properties

ListViewItemTappedAttached

Used for binding item tapped command to a ListView

<ListView ItemsSource="{Binding MyCars}" fe:ListViewItemTappedAttached.Command="{Binding ItemTapCommand}">

TappedGestureAttached

Used for binding a tapped command to any VisualElement.

<Image Source="xamconsulting.png" fe:TappedGestureAttached.Command="{Binding ImageTappedCommnad}" />

freshessentials's People

Contributors

jessejiang0214 avatar rid00z avatar lloydkevin avatar ysfred4 avatar civbaron avatar foxanna avatar danibo86 avatar leo-mck avatar

Watchers

James Cloos avatar Jurabek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.