void EventAgregatorCopy_Click(object sender, System.Windows.RoutedEventArgs e) { TheEventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>(); // get a reference to the event from // the event aggregator CompositePresentationEvent <MyCopyData> myCopyEvent = TheEventAggregator.GetEvent <MyCopyDataAddedEvent>(); // get the data text from TheTextToCopyTextBox TextBox control MyCopyData copyData = new MyCopyData { CopyString = Parametro1.Text }; //publish data via event aggregator myCopyEvent.Publish(copyData); }
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, ref MyCopyData lParam);
// es obligatorio que sea publico! public void OnCopyDataReceived(MyCopyData copyData) { this.recepcion.Text = copyData.CopyString; }