Код: Выделить всё
public Foo()
{
InitializeComponent();
this.WhenActivated(d =>
{
ViewModel ??= Locator.Current.GetService();
this.BindInteraction(ViewModel, vm => vm.SetClipboardTextInteration, SetClipboardSelectedTextInteraction)
.DisposeWith(d);
//подписка на нажатие + ctrl+c
var pointerPressedObservable = Observable.FromEventPattern(
h => this.PointerPressed += h,
h => this.PointerPressed -= h)
.Subscribe(h =>
{
if (h.Sender != this && h.Sender is Foo)
{
Console.WriteLine("a");
this._isSelected = false;
}
else
{
Console.WriteLine("a");
this._isSelected = true;
}
})
.DisposeWith(d);
var keyCtrlCPressObservable = Observable.FromEventPattern(
h => this.KeyDown += h,
h => this.KeyDown -= h)
.Subscribe(h =>
{
if(h.EventArgs.Key == Key.C && h.EventArgs.KeyModifiers == KeyModifiers.Control && this._isSelected)
{
Console.WriteLine("test");
}
})
.DisposeWith(d);
});
}
Думаю, надо их как-то связать, но не знаю как
Подробнее здесь: https://stackoverflow.com/questions/788 ... -something
Мобильная версия