Browse Source

WaitCursor in CodeQuality/Src/MainWindow.xaml

pull/787/head
PeterForstmeier 14 years ago
parent
commit
f52969bef6
  1. 9
      src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml
  2. 23
      src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml.cs
  3. 1
      src/AddIns/Analysis/CodeQuality/Src/MainWindowModel.cs

9
src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml

@ -140,11 +140,13 @@ @@ -140,11 +140,13 @@
Background="LightBlue" />
</Grid>
</TabItem>
<TabItem
Header="{Binding TabDependencyMatrix}">
<Graph:TreeMatrixControl
x:Name="matrixControl"></Graph:TreeMatrixControl>
</TabItem>
<TabItem
Header="{Binding TabMetrics}"
IsEnabled="{Binding MetrixTabEnable}">
@ -274,6 +276,7 @@ @@ -274,6 +276,7 @@
<ColumnDefinition
Width="*" />
</Grid.ColumnDefinitions>
<ToolBarTray
Background="White"
Grid.Row="0"
@ -291,6 +294,8 @@ @@ -291,6 +294,8 @@
<util:ComboBoxWithCommand Width="200" Margin="4,0,0,0"
ItemsSource="{Binding Source={StaticResource Metrics}}"
Command="{Binding ShowTreeMap}">
<util:ComboBoxWithCommand.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Path=.,Mode=OneWay,
@ -311,6 +316,7 @@ @@ -311,6 +316,7 @@
<t:TreeMaps
Grid.Row="1"
Grid.Column="0"
Loaded="TreeMaps_Loaded"
ItemsSource="{Binding Nodes}"
Background="LightGray"
ItemTemplate="{StaticResource TreeMapDataTemplate}"
@ -318,8 +324,8 @@ @@ -318,8 +324,8 @@
</t:TreeMaps>
</Grid>
</TabItem>
</TabControl>
<StatusBar
Grid.Row="2">
<StatusBarItem
@ -393,5 +399,6 @@ @@ -393,5 +399,6 @@
</StackPanel>
</StatusBarItem>
</StatusBar>
</Grid>
</Window>

23
src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml.cs

@ -8,6 +8,7 @@ using System.IO; @@ -8,6 +8,7 @@ using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
@ -283,5 +284,27 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -283,5 +284,27 @@ namespace ICSharpCode.CodeQualityAnalysis
}
}
//http://social.msdn.microsoft.com/Forums/en-MY/wpf/thread/798e100e-249d-413f-a501-50d1db680b94
void TreeMaps_Loaded(object sender, RoutedEventArgs e)
{
ItemsControl itemsControl = sender as ItemsControl;
if (itemsControl!=null)
{
itemsControl.ItemContainerGenerator.StatusChanged += new EventHandler(ItemContainerGenerator_StatusChanged);
}
}
void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
{
ItemContainerGenerator icg = sender as ItemContainerGenerator;
if (icg!=null&&icg.Status==GeneratorStatus.ContainersGenerated)
{
//Do what you want
Mouse.OverrideCursor = Cursors.Wait;
icg.StatusChanged -= ItemContainerGenerator_StatusChanged;
}
}
}
}

1
src/AddIns/Analysis/CodeQuality/Src/MainWindowModel.cs

@ -199,6 +199,7 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -199,6 +199,7 @@ namespace ICSharpCode.CodeQualityAnalysis
public ICommand ShowTreeMap {get;private set;}
bool CanActivateTreemap()
{
return metricsIsActive;

Loading…
Cancel
Save