These are chat archives for AvaloniaUI/Avalonia

Nov 2018
Nikita Tsukanov
Nov 12 2018 09:55
I'm considering to create a custom task-like that only succeed if properly awaited
Our clipboard and dialogs are always returning completed tasks on some platforms
So people might be tempted to use .Result or .GetAwaiter().Result
Jeremy Koritzinsky
Nov 12 2018 16:06
Nikita Tsukanov
Nov 12 2018 16:11
ValueTask has different semantics, I think
Single-use only
Benedikt Schroeder
Nov 12 2018 16:32
@kekekeks Can't we track the last activated window and use that as the parent for a modal window (ShowDialog)? That would eliminate the need to track it myself at every place I want to show a dialog.
Nov 12 2018 17:36
How come the buttons in this template are always enabled?
<ItemsControl Items="{Binding Moves}" Width="512" Height="128" IsVisible="{Binding MovesVisible}">
          <StackPanel Orientation="Horizontal" Spacing="20" Margin="20"/>
          <Button Width="103" Height="30" IsEnabled="false"
                  Content="{Binding Move}" Command="{Binding SelectMoveCommand}"
                  Background="{Binding Brush}" BorderBrush="{Binding BorderBrush}" BorderThickness="4" Foreground="White"
                  FontSize="16" FontFamily="resm:Kermalis.PokemonBattleEngineClient.Assets.Fonts?assembly=PokemonBattleEngineClient#Pokémon B/W"/>
Even if I bind them to a bool which is false, they remain enabled
I have other buttons which aren't in a template which respond correctly to the "IsEnabled" binding
Nov 12 2018 17:45
Maybe because of the command binding?
When setting the command the IsEnabled property is set inside the button to command.CanExecute
Nov 12 2018 17:54
Can I change it somehow?
Nov 12 2018 18:03
nevermind, I'll figure it out