private void EnsureDataTransferManager() { if (this.dtmHelper == null) { IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; this.dtmHelper = new DataTransferManagerHelper(windowHandle); this.dtmHelper.DataTransferManager.DataRequested += this.OnDataRequested; } }
private void Form1_Shown(object sender, EventArgs e) { dtmHelper = new DataTransferManagerHelper(this.Handle); dtmHelper.DataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested); }