-
since last uno update the following code new ToggleSwitch()
.Assign(c => c.Toggled += (s, e) => { ... }) causes a Warning CSM0004 Use .Name(out var name) instead of .Assign(out var name) Unfortunately public static T Assign<T>(this T input, Action<T> assignmentCallback) where T : DependencyObject so I cannot write code like this any longer: new ToggleSwitch()
.Name(c => c.Toggled += (s, e) => { ... }) Is it intended behavior? |
Beta Was this translation helpful? Give feedback.
Answered by
dansiegel
May 6, 2024
Replies: 1 comment 2 replies
-
@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.TextDecorations(Windows.UI.Text.TextDecorations.Underline);
};
textBlock.LostFocus += delegate
{
textBlock.TextDecorations(Windows.UI.Text.TextDecorations.None);
};
})
.Text("Hello Uno Platform!") We will add this to the backlog to take care of soon |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
kucint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kucint currently the API only let's you do the following where you provide a value for the out variable.
That said I do see the value of simplifying this so that you can do something like: