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

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

@ -8,6 +8,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
@ -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
public ICommand ShowTreeMap {get;private set;} public ICommand ShowTreeMap {get;private set;}
bool CanActivateTreemap() bool CanActivateTreemap()
{ {
return metricsIsActive; return metricsIsActive;

Loading…
Cancel
Save