Skip to content

[C# Markup]: Name() does not support Action<T> as argument as Assign() did #2272

Closed Answered by dansiegel
kucint asked this question in Q&A
Discussion options

You must be logged in to vote

@kucint currently the API only let's you do the following where you provide a value for the out variable.

new TextBlock()
    .Name(out var textBlock, tb =>
    {
        tb.GotFocus += delegate
        {
            tb.TextDecorations(Windows.UI.Text.TextDecorations.Underline);
        };
        tb.LostFocus += delegate
        {
            tb.TextDecorations(Windows.UI.Text.TextDecorations.None);
        };
    })
    .Text("Hello Uno Platform!")

That said I do see the value of simplifying this so that you can do something like:

new TextBlock()
    // Sets the name to `textBlock`
    .Name(textBlock =>
    {
        textBlock.GotFocus += delegate
        {
            textBlock.TextDe…

Replies: 1 comment 2 replies

Comment options

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

@dansiegel
Comment options

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