Skip to content

C# equivalent of XAML compiled binding #1447

Closed Answered by TheCodeTraveler
tranb3r asked this question in Q&A
Discussion options

You must be logged in to vote

For Compiled Bindings in C#, you need to install the CommunityToolkit.Maui.Markup NuGet Package.

Docs

https://learn.microsoft.com/dotnet/communitytoolkit/maui/markup/extensions/bindable-object-extensions#one-way-binding

Example

using static CommunityToolkit.Maui.Markup.GridRowsColumns;

class SampleContentPage : ContentPage
{
    public SampleContentPage()
    {
        Content = new Grid
        {
            RowDefinitions = Rows.Define(
                (Row.TextEntry, 36)),

            ColumnDefinitions = Columns.Define(
                (Column.Description, Star),
                (Column.Input, Stars(2))),

            Children =
            {
                new Label()

Replies: 6 comments 18 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by TheCodeTraveler
Comment options

You must be logged in to vote
2 replies
@TheCodeTraveler
Comment options

@tranb3r
Comment options

Comment options

You must be logged in to vote
9 replies
@pictos
Comment options

pictos Oct 9, 2023
Collaborator

@tranb3r
Comment options

@tranb3r
Comment options

@pictos
Comment options

pictos Nov 6, 2023
Collaborator

@tranb3r
Comment options

Comment options

You must be logged in to vote
2 replies
@tranb3r
Comment options

@CliffAgius
Comment options

Comment options

You must be logged in to vote
3 replies
@bijington
Comment options

@TheCodeTraveler
Comment options

@TheCodeTraveler
Comment options

Comment options

You must be logged in to vote
2 replies
@tranb3r
Comment options

@CliffAgius
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants