Skip to content

Commit 8e35dc4

Browse files
committed
Update sample page to use the new API
1 parent c5e1a0d commit 8e35dc4

File tree

4 files changed

+263
-51
lines changed

4 files changed

+263
-51
lines changed

samples/ControlCatalog/MainView.xaml

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
<TabItem Header="CalendarDatePicker">
7070
<pages:CalendarDatePickerPage />
7171
</TabItem>
72+
<TabItem Header="Dialogs">
73+
<pages:DialogsPage />
74+
</TabItem>
7275
<TabItem Header="Drag+Drop">
7376
<pages:DragAndDropPage />
7477
</TabItem>

samples/ControlCatalog/MainView.xaml.cs

-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ public MainView()
2424
{
2525
IList tabItems = ((IList)sideBar.Items);
2626
tabItems.Add(new TabItem()
27-
{
28-
Header = "Dialogs",
29-
Content = new DialogsPage()
30-
});
31-
tabItems.Add(new TabItem()
3227
{
3328
Header = "Screens",
3429
Content = new ScreenPage()
+52-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,57 @@
1-
<UserControl xmlns="https://github.com/avaloniaui"
2-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
x:Class="ControlCatalog.Pages.DialogsPage">
4-
<StackPanel Orientation="Vertical" Spacing="4" Margin="4">
5-
<CheckBox Name="UseFilters">Use filters</CheckBox>
6-
<Button Name="OpenFile">_Open File</Button>
7-
<Button Name="OpenMultipleFiles">Open _Multiple File</Button>
8-
<Button Name="SaveFile">_Save File</Button>
9-
<Button Name="SelectFolder">Select Fo_lder</Button>
10-
<Button Name="OpenBoth">Select _Both</Button>
1+
<UserControl x:Class="ControlCatalog.Pages.DialogsPage"
2+
xmlns="https://github.com/avaloniaui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
4+
<StackPanel Margin="4"
5+
Orientation="Vertical"
6+
Spacing="4">
117

12-
<TextBlock x:Name="PickerLastResultsVisible"
13-
Classes="h2"
14-
IsVisible="False"
15-
Text="Last picker results:" />
16-
<ItemsPresenter x:Name="PickerLastResults" />
8+
<TextBlock Text="Windows:" />
179

18-
<TextBlock Margin="0, 8, 0, 0"
19-
Classes="h1"
20-
Text="Window dialogs" />
21-
<Button Name="DecoratedWindow">Decorated _window</Button>
22-
<Button Name="DecoratedWindowDialog">Decorated w_indow (dialog)</Button>
23-
<Button Name="Dialog" ToolTip.Tip="Shows a dialog">_Dialog</Button>
24-
<Button Name="DialogNoTaskbar">Dialog (_No taskbar icon)</Button>
25-
<Button Name="OwnedWindow">Own_ed window</Button>
26-
<Button Name="OwnedWindowNoTaskbar">Owned window (No tas_kbar icon)</Button>
10+
<Expander Header="Window dialogs">
11+
<StackPanel Spacing="4">
12+
<Button Name="DecoratedWindow">Decorated _window</Button>
13+
<Button Name="DecoratedWindowDialog">Decorated w_indow (dialog)</Button>
14+
<Button Name="Dialog" ToolTip.Tip="Shows a dialog">_Dialog</Button>
15+
<Button Name="DialogNoTaskbar">Dialog (_No taskbar icon)</Button>
16+
<Button Name="OwnedWindow">Own_ed window</Button>
17+
<Button Name="OwnedWindowNoTaskbar">Owned window (No tas_kbar icon)</Button>
18+
</StackPanel>
19+
</Expander>
20+
21+
<TextBlock Margin="0,20,0,0" Text="Pickers:" />
22+
23+
<CheckBox Name="UseFilters">Use filters</CheckBox>
24+
<CheckBox Name="ForceManaged">Force managed dialog</CheckBox>
25+
<Expander Header="FilePicker API">
26+
<StackPanel Spacing="4">
27+
<Button Name="OpenFolderPicker">Select Fo_lder</Button>
28+
<Button Name="OpenFilePicker">_Open File</Button>
29+
<Button Name="OpenMultipleFilesPicker">Open _Multiple File</Button>
30+
<Button Name="SaveFilePicker">_Save File</Button>
31+
<Button Name="OpenFileFromBookmark">Open File Bookmark</Button>
32+
<Button Name="OpenFolderFromBookmark">Open Folder Bookmark</Button>
33+
</StackPanel>
34+
</Expander>
35+
<Expander Header="Legacy OpenFileDialog">
36+
<StackPanel Spacing="4">
37+
<Button Name="OpenFile">_Open File</Button>
38+
<Button Name="OpenMultipleFiles">Open _Multiple File</Button>
39+
<Button Name="SaveFile">_Save File</Button>
40+
<Button Name="SelectFolder">Select Fo_lder</Button>
41+
<Button Name="OpenBoth">Select _Both</Button>
42+
</StackPanel>
43+
</Expander>
44+
45+
<TextBlock x:Name="PickerLastResultsVisible"
46+
Classes="h2"
47+
IsVisible="False"
48+
Text="Last picker results:" />
49+
<ItemsPresenter x:Name="PickerLastResults" />
50+
51+
<TextBox Name="BookmarkContainer" Watermark="Bookmark" />
52+
<TextBox Name="OpenedFileContent"
53+
MaxLines="10"
54+
Watermark="Picked file content" />
2755

2856
</StackPanel>
2957
</UserControl>

0 commit comments

Comments
 (0)