rm ~/.steam/bin32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6
rm ~/.steam/bin32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1
rm ~/.steam/bin32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1
rm ~/.steam/bin32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6
rm ~/.steam/bin32/steam-runtime/i386/usr/lib/i386-linux-gnu/libxcb.so.1
<Ellipse Width="50" Height="50" Fill="#fff">
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)" To="Yellow" Duration="0:0:3" RepeatBehavior="Forever" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
<Ellipse Width="50" Height="50" Fill="White">
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded">
<BeginStoryboard>
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)" RepeatBehavior="Forever" FillBehavior="Stop">
<DiscreteColorKeyFrame Value="Red" KeyTime="0:0:3"/>
<DiscreteColorKeyFrame Value="White" KeyTime="0:0:3.1"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if ((bool)value)
{
return parameter != null ? Visibility.Collapsed : Visibility.Hidden;
}
return Visibility.Visible;
}
#region Свойства
public ObservableCollection<MyClass> Collection { get; set; } = new ObservableCollection<MyClass>
{
new MyClass { Name = "Иванов Иван" },
new MyClass { Name = "Петров Пётр" },
new MyClass { Name = "Сидоров Сидор" },
};
public MyClass SelectedCollection { get; set; };
#endregion
#region Команды
private ActionCommand _myCommand;
public ActionCommand MyCommand => _myCommand ?? (_myCommand = new ActionCommand(MyMethod));
private DelegateCommand<MyClass> _myDelegateCommand;
public DelegateCommand<MyClass> MyDelegateCommand => _myDelegateCommand ?? (_myDelegateCommand = new DelegateCommand<MyClass>(MyMethod2, item => item != null);
private void MyMethod()
{
// обработка команды
}
private void MyMethod2(MyClass item)
{
// обработка команды
}
#endregion
<ListBox ItemsSource="{Binding Collection}" SelectedItem="{Binding SelectedItem}"/>
<Button Command="{Binding MyCommand}" Content="Команда 1"/>
<Button Command="{Binding MyDelegateCommand}" CommandParameter="{Binding SelectedItem}" Content="Команда 2"/>
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
<ListBox ItemsSource="{Binding Collection}" SelectedItem="{Binding SelectedItemc}" DisplayMemberPath="Name">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding MyDelegateCommand}" CommandParameter="{Binding SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
public class DelegateCommand<T> : ICommand
{
#region Private fields
private readonly Action<T> _execute;
private readonly Func<T, bool> _canExecute;
#endregion
#region Constructors
public DelegateCommand(Action<T> execute, Func<T, bool> canExecute = null)
{
_execute = execute;
_canExecute = canExecute;
}
#endregion
#region DelegateCommand
public void Execute(T parameter)
{
var handler = _execute;
if (handler != null)
{
handler(parameter);
}
}
public bool CanExecute(T parameter)
{
var handler = _canExecute;
return handler == null || handler(parameter);
}
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
#endregion
#region ICommand
void ICommand.Execute(object parameter)
{
Execute((T)parameter);
}
bool ICommand.CanExecute(object parameter)
{
return CanExecute((T)parameter);
}
#endregion
}
public class DelegateCommand : DelegateCommand<object>
{
public DelegateCommand(Action<object> execute, Func<object, bool> canExecute = null)
: base(execute, canExecute)
{
}
}
public class ActionCommand : DelegateCommand<object>, ICommand
{
#region Private fields
private readonly Action _action;
private readonly Func<bool> _canExecute;
#endregion
#region Constructors
public ActionCommand(Action action, Func<bool> canExecute = null)
: base(null, null)
{
_action = action;
_canExecute = canExecute;
}
#endregion
#region ActionCommand
public void Execute()
{
var handler = _action;
if (handler != null)
{
handler();
}
}
public bool CanExecute()
{
var handler = _canExecute;
return handler == null || handler();
}
#endregion
#region ICommand
void ICommand.Execute(object parameter)
{
Execute();
}
bool ICommand.CanExecute(object parameter)
{
return CanExecute();
}
#endregion
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static async Task MethodDelayAsync()
{
Console.WriteLine("1. MethodDelayAsync: before await thread id: {0}", Thread.CurrentThread.ManagedThreadId);
await Task.Delay(1000);
Console.WriteLine("2. MethodDelayAsync: after await thread id: {0}", Thread.CurrentThread.ManagedThreadId);
}
static async Task MethodTaskRunAsync()
{
Console.WriteLine("1. MethodTaskRunAsync: before await thread id: {0}", Thread.CurrentThread.ManagedThreadId);
await Task.Run(() =>
{
Console.WriteLine("Asynchronous operation in MethodTaskRunAsync in thread id: {0}",
Thread.CurrentThread.ManagedThreadId);
});
Console.WriteLine("2. MethodTaskRunAsync: after await thread id: {0}", Thread.CurrentThread.ManagedThreadId);
}
static void Main(string[] args)
{
Console.WriteLine("Start Main in thread id: {0}", Thread.CurrentThread.ManagedThreadId);
//MethodDelayAsync();
MethodTaskRunAsync();
Console.WriteLine("End Main in thread id: {0}", Thread.CurrentThread.ManagedThreadId);
Console.Read();
}
}
}