These are chat archives for AvaloniaUI/Avalonia

12th
Nov 2018
Nikita Tsukanov
@kekekeks
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
@jkoritzinsky
Nov 12 2018 16:06
ValueTask?
Nikita Tsukanov
@kekekeks
Nov 12 2018 16:11
ValueTask has different semantics, I think
Single-use only
Benedikt Schroeder
@Gillibald
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.
Kermalis
@Kermalis
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}">
      <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
          <StackPanel Orientation="Horizontal" Spacing="20" Margin="20"/>
        </ItemsPanelTemplate>
      </ItemsControl.ItemsPanel>
      <ItemsControl.ItemTemplate>
        <DataTemplate>
          <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"/>
        </DataTemplate>
      </ItemsControl.ItemTemplate>
    </ItemsControl>
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
soerendd
@soerendd
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
Kermalis
@Kermalis
Nov 12 2018 17:54
Can I change it somehow?
Kermalis
@Kermalis
Nov 12 2018 18:03
nevermind, I'll figure it out