Skip to content

Commit 0b109c1

Browse files
committed
controlcatalog can do dialog within dialog.
1 parent 4e9ed7f commit 0b109c1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

samples/ControlCatalog/Pages/DialogsPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Text="Window dialogs" />
2121
<Button Name="DecoratedWindow">Decorated _window</Button>
2222
<Button Name="DecoratedWindowDialog">Decorated w_indow (dialog)</Button>
23-
<Button Name="Dialog">_Dialog</Button>
23+
<Button Name="Dialog" ToolTip.Tip="Shows a dialog">_Dialog</Button>
2424
<Button Name="DialogNoTaskbar">Dialog (_No taskbar icon)</Button>
2525
<Button Name="OwnedWindow">Own_ed window</Button>
2626
<Button Name="OwnedWindowNoTaskbar">Owned window (No tas_kbar icon)</Button>

samples/ControlCatalog/Pages/DialogsPage.xaml.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public DialogsPage()
142142
private Window CreateSampleWindow()
143143
{
144144
Button button;
145+
Button dialogButton;
145146

146147
var window = new Window
147148
{
@@ -158,13 +159,25 @@ private Window CreateSampleWindow()
158159
HorizontalAlignment = HorizontalAlignment.Center,
159160
Content = "Click to close",
160161
IsDefault = true
162+
}),
163+
(dialogButton = new Button
164+
{
165+
HorizontalAlignment = HorizontalAlignment.Center,
166+
Content = "Dialog",
167+
IsDefault = false
161168
})
162169
}
163170
},
164171
WindowStartupLocation = WindowStartupLocation.CenterOwner
165172
};
166173

167174
button.Click += (_, __) => window.Close();
175+
dialogButton.Click += (_, __) =>
176+
{
177+
var dialog = CreateSampleWindow();
178+
dialog.Height = 200;
179+
dialog.ShowDialog(window);
180+
};
168181

169182
return window;
170183
}

0 commit comments

Comments
 (0)