From bd55c0248a0425db4520b1f24da0f0d4380f47a3 Mon Sep 17 00:00:00 2001 From: Cameron MacFarland Date: Mon, 27 Oct 2014 10:56:21 +0800 Subject: [PATCH] Msg selection in flow diagram. #365 --- .../MessageFlow/MessageFlowView.xaml.cs | 11 ++++------- .../MessageFlow/MessageFlowViewModel.cs | 12 +++++------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/ServiceInsight.Desktop/MessageFlow/MessageFlowView.xaml.cs b/src/ServiceInsight.Desktop/MessageFlow/MessageFlowView.xaml.cs index eefbb175..a18d1238 100644 --- a/src/ServiceInsight.Desktop/MessageFlow/MessageFlowView.xaml.cs +++ b/src/ServiceInsight.Desktop/MessageFlow/MessageFlowView.xaml.cs @@ -47,11 +47,8 @@ public void UpdateConnections() void MessageRectangle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { - if (e.ClickCount == 2) - { - var node = ((System.Windows.FrameworkElement)sender).DataContext as MessageNode; - ShowMessage(sender, new SearchMessageEventArgs(node)); - } + var node = ((System.Windows.FrameworkElement)sender).DataContext as MessageNode; + ShowMessage(sender, new SearchMessageEventArgs(node)); } void Root_KeyUp(object sender, KeyEventArgs e) @@ -66,7 +63,7 @@ void Root_KeyUp(object sender, KeyEventArgs e) { Surface.Zoom -= 0.1; } - else if (e.Key == Key.D0 || e.Key == Key.NumPad0) + else if (e.Key == Key.D0 || e.Key == Key.NumPad0) { Surface.Zoom = 1; } @@ -77,4 +74,4 @@ void Root_KeyUp(object sender, KeyEventArgs e) } } } -} +} \ No newline at end of file diff --git a/src/ServiceInsight.Desktop/MessageFlow/MessageFlowViewModel.cs b/src/ServiceInsight.Desktop/MessageFlow/MessageFlowViewModel.cs index 4c62f6e6..4aa8ff59 100644 --- a/src/ServiceInsight.Desktop/MessageFlow/MessageFlowViewModel.cs +++ b/src/ServiceInsight.Desktop/MessageFlow/MessageFlowViewModel.cs @@ -91,7 +91,11 @@ protected override void OnViewAttached(object view, object context) void OnShowMessage(object sender, SearchMessageEventArgs e) { - SearchByMessageId(e.MessageNode.Message); + var message = e.MessageNode.Message; + + searchBar.Search(performSearch: false, searchQuery: message.MessageId); + eventAggregator.Publish(new RequestSelectingEndpoint(message.ReceivingEndpoint)); + eventAggregator.Publish(new SelectedMessageChanged(message)); } protected override void OnActivate() @@ -134,12 +138,6 @@ public void ToggleEndpointData() public ICommand SearchByMessageIDCommand { get; private set; } public ICommand RetryMessageCommand { get; private set; } - void SearchByMessageId(StoredMessage message, bool performSearch = false) - { - searchBar.Search(performSearch: performSearch, searchQuery: message.MessageId); - eventAggregator.Publish(new RequestSelectingEndpoint(message.ReceivingEndpoint)); - } - public void Handle(SelectedMessageChanged @event) { if (loadingConversation) return;