Skip to content

Commit 4083ad4

Browse files
committed
Classic UI: reorganize options layout, fix banner wrapping, add split resolve button
- Separate Input/Output options into labeled columns with collapsed advanced sections for less-used settings - Move binary paths + DLL recurse into "Advanced input options" - Move output checkboxes into "Advanced output options" - Move detection banners to root grid row for proper text wrapping - Replace two resolve buttons with split button (persisted selection) - Fix BaseAddressPage/SymbolConfigPage banner text wrapping - Adjust section widths (55/45 outer, 60/40 inner) and header font size - Fix InputText_RaisesPropertyChanged test for multi-notification setter
1 parent 1c00129 commit 4083ad4

8 files changed

Lines changed: 205 additions & 120 deletions

File tree

Modern/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
<setting name="UseWizardMode" serializeAs="String">
3737
<value>True</value>
3838
</setting>
39+
<setting name="LastResolveMode" serializeAs="String">
40+
<value>resolve</value>
41+
</setting>
3942
</Microsoft.SqlServer.Utils.Misc.SQLCallStackResolver.Modern.Properties.Settings>
4043
</userSettings>
4144
</configuration>

Modern/Pages/BaseAddressPage.xaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
Text="Provide Module Base Addresses"/>
1414

1515
<Border Grid.Row="1" Background="{DynamicResource WarningBackgroundBrush}" BorderBrush="{DynamicResource WarningBorderBrush}" BorderThickness="1" CornerRadius="4" Padding="10" Margin="0,0,0,8">
16-
<StackPanel Orientation="Horizontal">
17-
<TextBlock Text="&#xE7BA;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="0,0,8,0" Foreground="{DynamicResource WarningForegroundBrush}"/>
18-
<TextBlock Foreground="{DynamicResource WarningForegroundBrush}" TextWrapping="Wrap" VerticalAlignment="Center"
16+
<Grid>
17+
<Grid.ColumnDefinitions>
18+
<ColumnDefinition Width="Auto"/>
19+
<ColumnDefinition Width="*"/>
20+
</Grid.ColumnDefinitions>
21+
<TextBlock Grid.Column="0" Text="&#xE7BA;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="0,0,8,0" Foreground="{DynamicResource WarningForegroundBrush}"/>
22+
<TextBlock Grid.Column="1" Foreground="{DynamicResource WarningForegroundBrush}" TextWrapping="Wrap" VerticalAlignment="Center"
1923
Text="Your input appears to contain only virtual addresses. Module base address information is required to resolve these. Paste the output of the query shown below, or load from a file."/>
20-
</StackPanel>
24+
</Grid>
2125
</Border>
2226

2327
<DockPanel Grid.Row="2">

Modern/Pages/SymbolConfigPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<TextBlock Text="Detected SQL Server " FontWeight="SemiBold" FontSize="13"/>
4444
<TextBlock Text="{Binding DetectedBuildVersion}" FontWeight="SemiBold" FontSize="13"/>
4545
</StackPanel>
46-
<TextBlock Text="{Binding DetectedBuildDetails}" FontSize="12" Foreground="Gray" TextTrimming="CharacterEllipsis"/>
46+
<TextBlock Text="{Binding DetectedBuildDetails}" FontSize="12" Foreground="Gray" TextWrapping="Wrap"/>
4747
</StackPanel>
4848
<Button Grid.Column="2" Padding="12,6" Click="DownloadDetectedBuild_Click"
4949
Style="{DynamicResource AccentButtonStyle}">
@@ -72,7 +72,7 @@
7272
Foreground="{DynamicResource SystemControlForegroundAccentBrush}"/>
7373
<StackPanel Grid.Column="1" VerticalAlignment="Center">
7474
<TextBlock Text="XML frames with PDB info detected" FontWeight="SemiBold" FontSize="13"/>
75-
<TextBlock FontSize="12" Foreground="Gray" TextTrimming="CharacterEllipsis">
75+
<TextBlock FontSize="12" Foreground="Gray" TextWrapping="Wrap">
7676
<Run Text="Modules:"/>
7777
<Run Text="{Binding DetectedPdbModules, Mode=OneWay}"/>
7878
</TextBlock>

Modern/Properties/Settings.Designer.cs

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modern/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
<Setting Name="PinPdbPaths" Type="System.Boolean" Scope="User">
2121
<Value Profile="(Default)">False</Value>
2222
</Setting>
23+
<Setting Name="LastResolveMode" Type="System.String" Scope="User">
24+
<Value Profile="(Default)">resolve</Value>
25+
</Setting>
2326
</Settings>
2427
</SettingsFile>

Modern/Views/ClassicView.xaml

Lines changed: 133 additions & 111 deletions
Large diffs are not rendered by default.

Modern/Views/ClassicView.xaml.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Microsoft.SqlServer.Utils.Misc.SQLCallStackResolver.Modern {
44
public partial class ClassicView : UserControl {
55
private ResolverViewModel ViewModel => DataContext as ResolverViewModel;
6+
private string _lastResolveMode = Properties.Settings.Default.LastResolveMode ?? "resolve";
67

78
public ClassicView() {
89
InitializeComponent();
@@ -27,6 +28,13 @@ public ClassicView() {
2728
e.Handled = true;
2829
}
2930
};
31+
// Restore the split button face from the persisted setting
32+
Loaded += (s, e) => {
33+
if (_lastResolveMode == "paste") {
34+
resolveMainIcon.Text = "\uE77F";
35+
resolveMainText.Text = "Paste clipboard & resolve";
36+
}
37+
};
3038
}
3139

3240
private void Find_Executed(object sender, ExecutedRoutedEventArgs e) => findBar.Open();
@@ -117,5 +125,42 @@ private async void CallStackInput_Drop(object sender, DragEventArgs e) {
117125
}
118126
}
119127
}
128+
129+
private void ExecuteResolveAction(string mode) {
130+
if (mode == "paste") {
131+
ViewModel.PasteFromClipboardCommand.Execute(null);
132+
} else {
133+
ViewModel.ResolveCommand.Execute(null);
134+
}
135+
}
136+
137+
private void UpdateResolveButton(string mode) {
138+
_lastResolveMode = mode;
139+
Properties.Settings.Default.LastResolveMode = mode;
140+
Properties.Settings.Default.Save();
141+
if (mode == "paste") {
142+
resolveMainIcon.Text = "\uE77F";
143+
resolveMainText.Text = "Paste clipboard & resolve";
144+
} else {
145+
resolveMainIcon.Text = "\uE768";
146+
resolveMainText.Text = "Resolve Callstacks!";
147+
}
148+
}
149+
150+
private void ResolveMain_Click(object sender, RoutedEventArgs e) => ExecuteResolveAction(_lastResolveMode);
151+
152+
private void ResolveDropdown_Click(object sender, RoutedEventArgs e) {
153+
if (sender is Button btn) {
154+
btn.ContextMenu.PlacementTarget = btn;
155+
btn.ContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
156+
btn.ContextMenu.IsOpen = true;
157+
}
158+
}
159+
160+
private void ResolveMenuItem_Click(object sender, RoutedEventArgs e) {
161+
if (sender is MenuItem item && item.Tag is string mode) {
162+
UpdateResolveButton(mode);
163+
}
164+
}
120165
}
121166
}

ModernTests/ViewModelTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ public void CurrentStep_RaisesExpectedPropertyChangedEvents() {
121121
[TestMethod][TestCategory("ModernUI")]
122122
public void InputText_RaisesPropertyChanged() {
123123
var vm = new ResolverViewModel();
124-
string changedProp = null;
125-
vm.PropertyChanged += (s, e) => changedProp = e.PropertyName;
124+
var changed = new List<string>();
125+
vm.PropertyChanged += (s, e) => changed.Add(e.PropertyName);
126126
vm.InputText = "test callstack";
127-
Assert.AreEqual(nameof(vm.InputText), changedProp);
127+
Assert.IsTrue(changed.Contains(nameof(vm.InputText)));
128128
}
129129

130130
[TestMethod][TestCategory("ModernUI")]

0 commit comments

Comments
 (0)