From 04f9129788fe35148b95a25d82b80e6019f9e373 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Wed, 8 Apr 2026 08:11:01 +0000 Subject: [PATCH] Update ControlCatalog to use the Page system (#21044) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * replace hamburger view with drawer page. use ContentPage in control catalog * Added Icons * fix listbox and carousel page * make MainView drawer page * add PageNavigationHost to control catalog --------- Co-authored-by: Javier Suárez Ruiz --- samples/ControlCatalog/App.xaml | 3 +- samples/ControlCatalog/App.xaml.cs | 37 +- samples/ControlCatalog/Assets/Icon.png | Bin 0 -> 14349 bytes samples/ControlCatalog/ControlCatalog.csproj | 8 +- samples/ControlCatalog/Icons.cs | 194 ++++++++ samples/ControlCatalog/MainView.xaml | 467 ++++++------------ samples/ControlCatalog/MainView.xaml.cs | 97 +++- samples/ControlCatalog/NavHeaderItem.xaml | 101 ++++ .../ControlCatalog/Pages/AcceleratorPage.xaml | 185 +++---- .../Pages/AcceleratorPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/AcrylicPage.xaml | 246 ++++----- .../ControlCatalog/Pages/AcrylicPage.xaml.cs | 2 +- .../Pages/AdornerLayerPage.xaml | 113 +++-- .../Pages/AdornerLayerPage.xaml.cs | 2 +- .../Pages/AutoCompleteBoxPage.xaml | 140 +++--- .../Pages/AutoCompleteBoxPage.xaml.cs | 2 +- .../Pages/BitmapCachePage.axaml | 76 +-- .../Pages/BitmapCachePage.axaml.cs | 4 +- samples/ControlCatalog/Pages/BorderPage.xaml | 112 +++-- .../ControlCatalog/Pages/BorderPage.xaml.cs | 2 +- .../Pages/ButtonSpinnerPage.xaml | 5 +- .../Pages/ButtonSpinnerPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/ButtonsPage.xaml | 13 +- .../ControlCatalog/Pages/ButtonsPage.xaml.cs | 2 +- .../Pages/CalendarDatePickerPage.xaml | 5 +- .../Pages/CalendarDatePickerPage.xaml.cs | 2 +- .../ControlCatalog/Pages/CalendarPage.xaml | 5 +- .../ControlCatalog/Pages/CalendarPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/CanvasPage.xaml | 5 +- .../ControlCatalog/Pages/CanvasPage.xaml.cs | 2 +- .../Pages/CarouselDemoPage.xaml | 21 +- .../Pages/CarouselDemoPage.xaml.cs | 2 +- .../ControlCatalog/Pages/CarouselPage.xaml | 5 +- .../ControlCatalog/Pages/CarouselPage.xaml.cs | 2 +- .../ControlCatalog/Pages/CheckBoxPage.xaml | 5 +- .../ControlCatalog/Pages/CheckBoxPage.xaml.cs | 2 +- .../ControlCatalog/Pages/ClipboardPage.xaml | 5 +- .../Pages/ClipboardPage.xaml.cs | 2 +- .../ControlCatalog/Pages/ColorPickerPage.xaml | 9 +- .../Pages/ColorPickerPage.xaml.cs | 2 +- .../ControlCatalog/Pages/ComboBoxPage.xaml | 4 +- .../ControlCatalog/Pages/ComboBoxPage.xaml.cs | 2 +- .../ControlCatalog/Pages/CommandBarPage.xaml | 13 +- .../Pages/CommandBarPage.xaml.cs | 2 +- .../Pages/CompositionPage.axaml | 121 +++-- .../Pages/CompositionPage.axaml.cs | 2 +- .../Pages/ConnectedAnimationDemoPage.xaml | 7 +- .../Pages/ConnectedAnimationDemoPage.xaml.cs | 2 +- .../Pages/ContainerQueryPage.xaml | 5 +- .../Pages/ContainerQueryPage.xaml.cs | 2 +- .../ControlCatalog/Pages/ContentDemoPage.xaml | 21 +- .../Pages/ContentDemoPage.xaml.cs | 2 +- .../Pages/ContextFlyoutPage.xaml | 9 +- .../Pages/ContextFlyoutPage.xaml.cs | 2 +- .../ControlCatalog/Pages/ContextMenuPage.xaml | 5 +- .../Pages/ContextMenuPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/CursorPage.xaml | 5 +- .../ControlCatalog/Pages/CursorPage.xaml.cs | 2 +- .../ControlCatalog/Pages/CustomDrawing.xaml | 9 +- .../Pages/CustomDrawing.xaml.cs | 2 +- .../ControlCatalog/Pages/DataGridPage.xaml | 5 +- .../ControlCatalog/Pages/DataGridPage.xaml.cs | 2 +- .../Pages/DataValidationPage.axaml | 9 +- .../Pages/DataValidationPage.axaml.cs | 2 +- .../Pages/DateTimePickerPage.xaml | 5 +- .../Pages/DateTimePickerPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/DialogsPage.xaml | 5 +- .../ControlCatalog/Pages/DialogsPage.xaml.cs | 2 +- .../ControlCatalog/Pages/DragAndDropPage.xaml | 9 +- .../Pages/DragAndDropPage.xaml.cs | 2 +- .../ControlCatalog/Pages/DrawerDemoPage.xaml | 21 +- .../Pages/DrawerDemoPage.xaml.cs | 2 +- .../ControlCatalog/Pages/ExpanderPage.xaml | 5 +- .../ControlCatalog/Pages/ExpanderPage.xaml.cs | 2 +- .../ControlCatalog/Pages/FlyoutsPage.axaml | 9 +- .../ControlCatalog/Pages/FlyoutsPage.axaml.cs | 2 +- samples/ControlCatalog/Pages/FocusPage.xaml | 5 +- .../ControlCatalog/Pages/FocusPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/GesturePage.xaml | 21 +- .../{GesturePage.cs => GesturePage.xaml.cs} | 2 +- .../Pages/HeaderedContentPage.axaml | 5 +- .../Pages/HeaderedContentPage.axaml.cs | 2 +- samples/ControlCatalog/Pages/ImagePage.xaml | 5 +- .../ControlCatalog/Pages/ImagePage.xaml.cs | 2 +- samples/ControlCatalog/Pages/LabelsPage.axaml | 9 +- .../ControlCatalog/Pages/LabelsPage.axaml.cs | 2 +- .../Pages/LayoutTransformControlPage.xaml | 5 +- .../Pages/LayoutTransformControlPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/ListBoxPage.xaml | 5 +- .../ControlCatalog/Pages/ListBoxPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/MenuPage.xaml | 5 +- samples/ControlCatalog/Pages/MenuPage.xaml.cs | 2 +- .../ControlCatalog/Pages/NativeEmbedPage.xaml | 5 +- .../Pages/NativeEmbedPage.xaml.cs | 2 +- .../Pages/NavigationDemoPage.xaml | 21 +- .../Pages/NavigationDemoPage.xaml.cs | 2 +- .../Pages/NotificationsPage.xaml | 5 +- .../Pages/NotificationsPage.xaml.cs | 2 +- .../Pages/NumericUpDownPage.xaml | 5 +- .../Pages/NumericUpDownPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/OpenGlPage.xaml | 5 +- .../ControlCatalog/Pages/OpenGlPage.xaml.cs | 2 +- .../ControlCatalog/Pages/PipsPagerPage.xaml | 21 +- .../Pages/PipsPagerPage.xaml.cs | 2 +- .../Pages/PlatformInfoPage.xaml | 5 +- .../Pages/PlatformInfoPage.xaml.cs | 2 +- .../ControlCatalog/Pages/PointersPage.xaml | 23 +- .../ControlCatalog/Pages/PointersPage.xaml.cs | 2 +- .../ControlCatalog/Pages/ProgressBarPage.xaml | 12 +- .../Pages/ProgressBarPage.xaml.cs | 2 +- .../ControlCatalog/Pages/RadioButtonPage.xaml | 5 +- .../Pages/RadioButtonPage.xaml.cs | 2 +- .../Pages/RefreshContainerPage.axaml | 5 +- .../Pages/RefreshContainerPage.axaml.cs | 2 +- .../Pages/RelativePanelPage.axaml | 5 +- .../Pages/RelativePanelPage.axaml.cs | 2 +- samples/ControlCatalog/Pages/ScreenPage.cs | 2 +- .../Pages/ScrollViewerPage.xaml | 15 +- .../Pages/ScrollViewerPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/SliderPage.xaml | 5 +- .../ControlCatalog/Pages/SliderPage.xaml.cs | 2 +- .../ControlCatalog/Pages/SplitViewPage.xaml | 5 +- .../Pages/SplitViewPage.xaml.cs | 2 +- .../ControlCatalog/Pages/TabControlPage.xaml | 5 +- .../Pages/TabControlPage.xaml.cs | 2 +- .../ControlCatalog/Pages/TabStripPage.xaml | 5 +- .../ControlCatalog/Pages/TabStripPage.xaml.cs | 2 +- .../ControlCatalog/Pages/TabbedDemoPage.xaml | 21 +- .../Pages/TabbedDemoPage.xaml.cs | 2 +- .../ControlCatalog/Pages/TextBlockPage.xaml | 5 +- .../Pages/TextBlockPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/TextBoxPage.xaml | 5 +- .../ControlCatalog/Pages/TextBoxPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/ThemePage.axaml | 9 +- .../ControlCatalog/Pages/ThemePage.axaml.cs | 2 +- .../Pages/ToggleSwitchPage.xaml | 25 +- .../Pages/ToggleSwitchPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/ToolTipPage.xaml | 7 +- .../ControlCatalog/Pages/ToolTipPage.xaml.cs | 2 +- .../TransitioningContentControlPage.axaml | 17 +- .../TransitioningContentControlPage.axaml.cs | 2 +- .../ControlCatalog/Pages/TreeViewPage.xaml | 5 +- .../ControlCatalog/Pages/TreeViewPage.xaml.cs | 2 +- samples/ControlCatalog/Pages/ViewboxPage.xaml | 5 +- .../ControlCatalog/Pages/ViewboxPage.xaml.cs | 2 +- .../Pages/WindowCustomizationsPage.xaml | 5 +- .../Pages/WindowCustomizationsPage.xaml.cs | 2 +- samples/ControlCatalog/ScrollPage.xaml | 34 ++ .../ViewModels/MainWindowViewModel.cs | 11 +- .../MainWindowViewModel_PageList.cs | 196 ++++++++ .../HamburgerMenu/HamburgerMenu.xaml | 8 +- 151 files changed, 1703 insertions(+), 1128 deletions(-) create mode 100644 samples/ControlCatalog/Assets/Icon.png create mode 100644 samples/ControlCatalog/Icons.cs create mode 100644 samples/ControlCatalog/NavHeaderItem.xaml rename samples/ControlCatalog/Pages/{GesturePage.cs => GesturePage.xaml.cs} (96%) create mode 100644 samples/ControlCatalog/ScrollPage.xaml create mode 100644 samples/ControlCatalog/ViewModels/MainWindowViewModel_PageList.cs diff --git a/samples/ControlCatalog/App.xaml b/samples/ControlCatalog/App.xaml index 179f64233e..6ab30cc180 100644 --- a/samples/ControlCatalog/App.xaml +++ b/samples/ControlCatalog/App.xaml @@ -8,7 +8,8 @@ - + + diff --git a/samples/ControlCatalog/App.xaml.cs b/samples/ControlCatalog/App.xaml.cs index f14fbb1fa3..71e4113a3a 100644 --- a/samples/ControlCatalog/App.xaml.cs +++ b/samples/ControlCatalog/App.xaml.cs @@ -18,7 +18,7 @@ namespace ControlCatalog private FluentTheme? _fluentTheme; private SimpleTheme? _simpleTheme; private IStyle? _colorPickerFluent, _colorPickerSimple; - + public App() { DataContext = new ApplicationViewModel(); @@ -34,7 +34,7 @@ namespace ControlCatalog _simpleTheme = (SimpleTheme)Resources["SimpleTheme"]!; _colorPickerFluent = (IStyle)Resources["ColorPickerFluent"]!; _colorPickerSimple = (IStyle)Resources["ColorPickerSimple"]!; - + SetCatalogThemes(CatalogTheme.Fluent); } @@ -44,16 +44,22 @@ namespace ControlCatalog { desktopLifetime.MainWindow = new MainWindow { DataContext = new MainWindowViewModel() }; } - else if(ApplicationLifetime is IActivityApplicationLifetime singleViewFactoryApplicationLifetime) + else if (ApplicationLifetime is IActivityApplicationLifetime singleViewFactoryApplicationLifetime) { - singleViewFactoryApplicationLifetime.MainViewFactory = () => new MainView { DataContext = new MainWindowViewModel() }; + singleViewFactoryApplicationLifetime.MainViewFactory = () => new PageNavigationHost() + { + Page = new MainView { DataContext = new MainWindowViewModel() } + }; } else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime) { - singleViewLifetime.MainView = new MainView { DataContext = new MainWindowViewModel() }; + singleViewLifetime.MainView = new PageNavigationHost() + { + Page = new MainView { DataContext = new MainWindowViewModel() } + }; } - if (this.TryGetFeature() is {} activatableApplicationLifetime) + if (this.TryGetFeature() is { } activatableApplicationLifetime) { activatableApplicationLifetime.Activated += (sender, args) => Console.WriteLine($"App activated: {args.Kind}"); @@ -99,14 +105,14 @@ namespace ControlCatalog } private CatalogTheme _prevTheme; - public static CatalogTheme CurrentTheme => ((App)Current!)._prevTheme; + public static CatalogTheme CurrentTheme => ((App)Current!)._prevTheme; public static void SetCatalogThemes(CatalogTheme theme) { var app = (App)Current!; var prevTheme = app._prevTheme; app._prevTheme = theme; var shouldReopenWindow = prevTheme != theme; - + if (app._themeStylesContainer.Count == 0) { app._themeStylesContainer.Add(new Style()); @@ -130,18 +136,27 @@ namespace ControlCatalog if (app.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) { var oldWindow = desktopLifetime.MainWindow; - var newWindow = new MainWindow(); + var newWindow = new MainWindow() + { + DataContext = new MainWindowViewModel() + }; desktopLifetime.MainWindow = newWindow; newWindow.Show(); oldWindow?.Close(); } else if (app.ApplicationLifetime is IActivityApplicationLifetime singleViewFactoryApplicationLifetime) { - singleViewFactoryApplicationLifetime.MainViewFactory = () => new MainView { DataContext = new MainWindowViewModel() }; + singleViewFactoryApplicationLifetime.MainViewFactory = () => new PageNavigationHost() + { + Page = new MainView { DataContext = new MainWindowViewModel() } + }; } else if (app.ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime) { - singleViewLifetime.MainView = new MainView(); + singleViewLifetime.MainView = new PageNavigationHost() + { + Page = new MainView { DataContext = new MainWindowViewModel() } + }; } } } diff --git a/samples/ControlCatalog/Assets/Icon.png b/samples/ControlCatalog/Assets/Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..41a2a618fb02e4cb7f6a15caf572b693bfe1ebb1 GIT binary patch literal 14349 zcmdtJ^EU0vMF0h26NSCC5pomCGr^Esh3km|#NF&{iw9?Wnjl|N@ z`CNWJ_xJlef5G#^&FjT4v*$W9bLKr~&Ybg}2rW%D5<&(-5C}x_NFAXA0)gZH{o~^T zErD&~zd#^~-;WTAdY)f*(0E^|PA(JdJoCHg9rW(}-q6s{ z#*KHDghqFB4W6%q0k{gg|^3gd>rC)VTQMFLhj#M%Yxxfs$Hp@c8So3dxQzuFO6D`+4HKNdX3 zU$5ATBk*Iq3h=^S&l?Fl7GP}W<6 z!%2fSTZ=YX;Xa}7q3U>`3qD>$uw??ic;UcQ;9H#~hXP-|5dmoD!@!eAn4`WPE8Fhp zy2m^eUcq1`spUO?vi%Bn9Z$EuO(AZVukaXyO(D>WJHqBYfuJ(b8>&849Qm+KnMB)` z7Tegq#og}ib#n=|-&DBx7egWP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wyF5yO>-ZLH7_B^knD!_lB@ zZ*kVrRi{Cy;wp6tBWzLmkQQ<+RB3pg{I5PgQO=3-0iJ8r;}qw;0UxOEEUv4(w^}$u zrI(kqW=oQ_AL`e=KxQ5i4xJzr!Uo0(9k$Y+w+5itNgh80o{nq>3Hv+@q@K8Y+uWGr zR~?dlN3`^W)4Qn8oEQ~C{X#btr)WY6m1CycdkbOV3N-6`B=2~jq`4n6<%mJ$#H0_gIS%X}Q?yUOy z>zK$%jq{64(yU(D!KHc1Jz~Q8?6^JWbR0gI`~gf^)MU%_Gr6f`m$_Od#d&(iOC;B} zG&Q%Otz8H^MTSYUa@<4Iv}nI#Ppq995Q4D2uAz-?10juGKD5+-drp0>iJ + @@ -38,7 +39,12 @@ - + + + + + MSBuild:Compile + diff --git a/samples/ControlCatalog/Icons.cs b/samples/ControlCatalog/Icons.cs new file mode 100644 index 0000000000..58d0e0b7d4 --- /dev/null +++ b/samples/ControlCatalog/Icons.cs @@ -0,0 +1,194 @@ +namespace ControlCatalog +{ + internal static class Icons + { + // Layers/Composition + public const string Layers = "M12,16L19.36,10.27L21,9L12,2L3,9L4.63,10.27M12,18.54L4.62,12.81L3,14.07L12,21.07L21,14.07L19.37,12.8"; + + // Keyboard + public const string Keyboard = "M19,10H17V8H19M19,13H17V11H19M16,10H14V8H16M16,13H14V11H16M16,17H8V15H16M7,10H5V8H7M7,13H5V11H7M8,11H10V13H8M8,8H10V10H8M11,11H13V13H11M11,8H13V10H11M20,5H4C2.89,5 2,5.89 2,7V17A2,2 0 0,0 4,19H20A2,2 0 0,0 22,17V7C22,5.89 21.1,5 20,5Z"; + + // Blur/Acrylic + public const string Blur = "M14.5,10C16.43,10 18,8.43 18,6.5C18,4.57 16.43,3 14.5,3C12.57,3 11,4.57 11,6.5C11,8.43 12.57,10 14.5,10M14.5,4A2.5,2.5 0 0,1 17,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,4M8.5,14C10.43,14 12,12.43 12,10.5C12,8.57 10.43,7 8.5,7C6.57,7 5,8.57 5,10.5C5,12.43 6.57,14 8.5,14M8.5,8A2.5,2.5 0 0,1 11,10.5A2.5,2.5 0 0,1 8.5,13A2.5,2.5 0 0,1 6,10.5A2.5,2.5 0 0,1 8.5,8M14.5,16A4.5,4.5 0 0,0 10,20.5A4.5,4.5 0 0,0 14.5,25A4.5,4.5 0 0,0 19,20.5A4.5,4.5 0 0,0 14.5,16M14.5,24A3.5,3.5 0 0,1 11,20.5A3.5,3.5 0 0,1 14.5,17A3.5,3.5 0 0,1 18,20.5A3.5,3.5 0 0,1 14.5,24Z"; + + // Adorner/Sparkle + public const string Sparkle = "M12,1L9,9L1,12L9,15L12,23L15,15L23,12L15,9"; + + // Text/AutoComplete + public const string TextInput = "M20,21H4V3H20V21M6,9H14V7H6V9M6,13H18V11H6V13M6,17H14V15H6V17Z"; + + // Border/Square + public const string Border = "M4,4H20V20H4V4M6,8V6H8V8H6M6,12V10H8V12H6M6,16V14H8V16H6M6,20V18H8V20H6M10,20V18H12V20H10M14,20V18H16V20H14M18,20V18H20V20H18M18,16V14H20V16H18M18,12V10H20V12H18M18,8V6H20V8H18M14,8V6H16V8H14M10,8V6H12V8H10Z"; + + // Lightning/Cache + public const string Lightning = "M11,21H7L13,3H17L14,10H20L11,21Z"; + + // Cursor Click/Button + public const string CursorClick = "M10.76,8.69A0.76,0.76 0 0,0 10,9.45V20.9C10,21.32 10.34,21.66 10.76,21.66C10.95,21.66 11.11,21.6 11.24,21.5L13.15,19.95L14.81,23.57C14.94,23.84 15.21,24 15.5,24C15.62,24 15.74,23.97 15.85,23.92L17.28,23.26C17.69,23.07 17.86,22.59 17.66,22.17L16,18.54L18.44,18.19C18.87,18.13 19.1,17.73 18.91,17.37L12.1,8.89C11.95,8.76 11.79,8.69 10.76,8.69M15,10V8H20V10H15M13.83,4.76L16.66,1.93L18.07,3.34L15.24,6.17L13.83,4.76M10,0V5H8V0H10M3.93,14.66L6.76,11.83L8.17,13.24L5.34,16.07L3.93,14.66M3.93,3.34L5.34,1.93L8.17,4.76L6.76,6.17L3.93,3.34M7,10H2V8H7V10Z"; + + // Spinner/ButtonSpinner + public const string Spinner = "M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z"; + + // Calendar + public const string Calendar = "M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M9,15H7V13H9V15M13,15H11V13H13V15M17,15H15V13H17V15M9,11H7V9H9V11M13,11H11V9H13V11M17,11H15V9H17V11Z"; + + // Canvas/Artboard + public const string Canvas = "M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z"; + + // Command/Terminal + public const string Terminal = "M20,19V7H4V19H20M20,3A2,2 0 0,1 22,5V19A2,2 0 0,1 20,21H4A2,2 0 0,1 2,19V5C2,3.89 2.9,3 4,3H20M13,17V15H18V17H13M9.58,13L5.57,9H8.4L11.7,12.3C12.09,12.69 12.09,13.33 11.7,13.72L8.42,17H5.59L9.58,13Z"; + + // Slides/Carousel + public const string Slides = "M2,6H6V18H2V6M7,6H17V18H7V6M18,6H22V18H18V6Z"; + + // Checkbox + public const string Checkbox = "M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8"; + + // Clipboard + public const string Clipboard = "M19,3H14.82C14.4,1.84 13.3,1 12,1C10.7,1 9.6,1.84 9.18,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M12,3A1,1 0 0,1 13,4A1,1 0 0,1 12,5A1,1 0 0,1 11,4A1,1 0 0,1 12,3"; + + // Palette/Color + public const string Palette = "M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12Z"; + + // Dropdown/ComboBox + public const string Dropdown = "M7,10L12,15L17,10H7Z"; + + // Container/Box + public const string Container = "M2,2H8V4H16V2H22V8H20V16H22V22H16V20H8V22H2V16H4V8H2V2M16,8V6H8V8H6V16H8V18H16V16H18V8H16M4,4V6H6V4H4M18,4V6H20V4H18M4,18V20H6V18H4M18,18V20H20V18H18Z"; + + // Document/Page + public const string Document = "M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"; + + // Menu/Context + public const string Menu = "M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z"; + + // Cursor/Pointer + public const string Cursor = "M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.39,12.92 18.83,13.03L14.83,13.78L17,18.5C17.24,19 17,19.59 16.5,19.83L13.64,21.97Z"; + + // Brush/Drawing + public const string Brush = "M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z"; + + // Grid/Table + public const string Grid = "M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14Z"; + + // Shield/Validation + public const string Shield = "M10,17L6,13L7.41,11.59L10,14.17L16.59,7.58L18,9M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1Z"; + + // Clock + public const string Clock = "M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z"; + + // Dialog/Message + public const string Dialog = "M20,2H4A2,2 0 0,0 2,4V22L6,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2Z"; + + // DragDrop/Move + public const string DragDrop = "M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"; + + // Sidebar/Drawer + public const string Drawer = "M3,2H21A1,1 0 0,1 22,3V21A1,1 0 0,1 21,22H3A1,1 0 0,1 2,21V3A1,1 0 0,1 3,2M10,4V20H20V4H10M4,4V20H8V4H4Z"; + + // Expand + public const string Expand = "M10,21V19H6.41L10.91,14.5L9.5,13.09L5,17.59V14H3V21H10M14.5,10.91L19,6.41V10H21V3H14V5H17.59L13.09,9.5L14.5,10.91Z"; + + // Flyout/Popup + public const string Flyout = "M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M7,9H10V7H7V9M7,13H17V11H7V13M7,17H14V15H7V17Z"; + + // Target/Focus + public const string Target = "M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z"; + + // Gesture/Touch + public const string Gesture = "M5,15A2,2 0 0,0 3,17V19H7V17A2,2 0 0,0 5,15M5,11A6,6 0 0,0 -1,17H1A4,4 0 0,1 5,13V11M5,7C0.03,7 -4,11.03 -4,16V17H-2V16C-2,12.13 1.13,9 5,9V7M20.5,9.5L12,18L8.5,14.5L7.08,15.91L12,20.84L21.92,10.91L20.5,9.5Z"; + + // Image/Photo + public const string Image = "M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"; + + // Tag/Label + public const string Tag = "M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.45 21.77,11.95 21.41,11.58Z"; + + // Transform/Rotate + public const string Transform = "M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V5.07C7.06,5.56 4,8.92 4,12.95C4,17.18 7.32,20.56 11.46,20.93C11.64,20.95 11.82,20.97 12,20.97C12.18,20.97 12.36,20.95 12.54,20.93C12.69,20.92 12.83,20.89 13,20.87V18.9C12.82,18.92 12.65,18.95 12.47,18.95C12.32,18.96 12.16,18.97 12,18.97C8.42,18.97 5.53,16.12 5.53,12.58C5.53,9.36 7.88,6.67 11,6.15V10L15.55,5.55Z"; + + // List + public const string List = "M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"; + + // Bell/Notification + public const string Bell = "M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21"; + + // Number/Hash + public const string Number = "M5.41,21L6.12,17H2.12L2.47,15H6.47L7.53,9H3.53L3.88,7H7.88L8.59,3H10.59L9.88,7H15.88L16.59,3H18.59L17.88,7H21.88L21.53,9H17.53L16.47,15H20.47L20.12,17H16.12L15.41,21H13.41L14.12,17H8.12L7.41,21H5.41M9.47,9L8.41,15H14.41L15.47,9H9.47Z"; + + // Cube/3D + public const string Cube = "M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L5,8.09V15.91L12,19.85L19,15.91V8.09L12,4.15Z"; + + // Dots/Pagination + public const string Dots = "M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"; + + // Info/Information + public const string Info = "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"; + + // Progress/Loading + public const string Progress = "M13,2.03V2.05L13,4.05C17.39,4.59 20.5,8.58 19.96,12.97C19.5,16.61 16.64,19.5 13,19.93V21.93C18.5,21.38 22.5,16.5 21.95,11C21.5,6.25 17.73,2.5 13,2.03M11,2.06C9.05,2.25 7.19,3 5.67,4.26L7.1,5.74C8.22,4.84 9.57,4.26 11,4.06V2.06M4.26,5.67C3,7.19 2.25,9.04 2.05,11H4.05C4.24,9.58 4.8,8.23 5.69,7.1L4.26,5.67M2.06,13C2.26,14.96 3.03,16.81 4.27,18.33L5.69,16.9C4.81,15.77 4.24,14.42 4.06,13H2.06M7.1,18.37L5.67,19.74C7.18,21 9.04,21.79 11,22V20C9.58,19.82 8.23,19.25 7.1,18.37Z"; + + // Radio + public const string Radio = "M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z"; + + // Refresh + public const string Refresh = "M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"; + + // Layout/Grid + public const string Layout = "M19,11H13V5H19M19,19H13V13H19M11,11H5V5H11M11,19H5V13H11M3,3V21H21V3"; + + // Scroll + public const string Scroll = "M15,20H9V12H4.16L12,4.16L19.84,12H15V20Z"; + + // Slider/Tune + public const string Slider = "M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"; + + // Split/SplitView + public const string Split = "M18,4H6C4.89,4 4,4.89 4,6V18A2,2 0 0,0 6,20H18A2,2 0 0,0 20,18V6C20,4.89 19.1,4 18,4M18,6V18H13V6H18Z"; + + // Tab + public const string Tab = "M21,3H3C1.89,3 1,3.89 1,5V19A2,2 0 0,0 3,21H21C22.1,21 23,20.1 23,19V5C23,3.89 22.1,3 21,3M21,19H3V5H13V9H21V19Z"; + + // Theme/Palette + public const string Theme = "M12,18V6A6,6 0 0,1 18,12A6,6 0 0,1 12,18M20,15.31L23.31,12L20,8.69V4H15.31L12,0.69L8.69,4H4V8.69L0.69,12L4,15.31V20H8.69L12,23.31L15.31,20H20V15.31Z"; + + // Toggle/Switch + public const string Toggle = "M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z"; + + // Tooltip/Info bubble + public const string Tooltip = "M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M11,15H13V13H11V15M11,11H13V5H11V11Z"; + + // Animation/Transition + public const string Transition = "M2,5.27L3.28,4L20,20.72L18.73,22L12.73,16H7V19L3,15L7,11V14H9.73L5,9.27V14H3V5.27M21,9L17,5V8H14V10H17V13L21,9M17,17V14H15V17H17Z"; + + // Tree/Hierarchy + public const string Tree = "M15,20A1,1 0 0,0 16,19V4H8V19A1,1 0 0,0 9,20H2V22H22V20H15Z"; + + // Viewbox/Resize + public const string Viewbox = "M5,15H3V19A2,2 0 0,0 5,21H9V19H5M5,5H9V3H5A2,2 0 0,0 3,5V9H5M19,3H15V5H19V9H21V5A2,2 0 0,0 19,3M19,19H15V21H19A2,2 0 0,0 21,19V15H19"; + + // Puzzle/Embed + public const string Puzzle = "M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5.04,10.8 6.2,11.96 6.2,13.5C6.2,15.04 5.04,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,18.96 8.96,17.8 10.5,17.8C12.04,17.8 13.2,18.96 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z"; + + // Window/Application + public const string Window = "M4,4H20V20H4V4M6,8V18H18V8H6Z"; + + // Header/Title + public const string Header = "M3,4H5V10H9V4H11V18H9V12H5V18H3V4M13,8H15.31L15.63,5H17.63L17.31,8H19.31L19.63,5H21.63L21.31,8H23V10H21.1L20.9,12H23V14H20.69L20.37,17H18.37L18.69,14H16.69L16.37,17H14.37L14.69,14H13V12H14.9L15.1,10H13V8M17.1,10L16.9,12H18.9L19.1,10H17.1Z"; + + // Monitor/Screen + public const string Monitor = "M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2Z"; + + // Navigation/Compass + public const string Navigation = "M12,2L4.5,20.29L5.21,21L12,18L18.79,21L19.5,20.29L12,2Z"; + + // OpenGL/3D Box (same as Cube but outline variant) + public const string Cube3D = "M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L6.04,7.5L12,10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z"; + + // Horizontal dots/Pager + public const string HorizontalDots = "M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"; + + // Slider tune/adjust + public const string Tune = "M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z"; + } +} diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml index 3a6d57801a..ea71773d13 100644 --- a/samples/ControlCatalog/MainView.xaml +++ b/samples/ControlCatalog/MainView.xaml @@ -1,312 +1,157 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + 20 + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + BorderOnly + Full + + + + + Default + Light + Dark + + + + + Fluent + Simple + + + + + None + Transparent + Blur + AcrylicBlur + Mica + + + + + LeftToRight + RightToLeft + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - None - BorderOnly - Full - - - - - Default - Light - Dark - - - - - Fluent - Simple - - - - - None - Transparent - Blur - AcrylicBlur - Mica - - - - - LeftToRight - RightToLeft - - - - - - - - - + + diff --git a/samples/ControlCatalog/MainView.xaml.cs b/samples/ControlCatalog/MainView.xaml.cs index 82172a8ec4..5ad85da149 100644 --- a/samples/ControlCatalog/MainView.xaml.cs +++ b/samples/ControlCatalog/MainView.xaml.cs @@ -10,13 +10,80 @@ using ControlCatalog.ViewModels; namespace ControlCatalog { - public partial class MainView : UserControl + public partial class MainView : DrawerPage { private Action? _disposeTransparencySetters; public MainView() { InitializeComponent(); + + Loaded += MainView_Loaded; + Unloaded += MainView_Unloaded; + } + + private const double WideBreakpoint = 1008; + private const double NarrowBreakpoint = 640; + + private void MainView_Loaded(object? sender, Avalonia.Interactivity.RoutedEventArgs e) + { + if (DataContext == null) + return; + + SizeChanged += OnDrawerSizeChanged; + UpdateAdaptiveLayout(); + } + + private void MainView_Unloaded(object? sender, Avalonia.Interactivity.RoutedEventArgs e) + { + SizeChanged -= OnDrawerSizeChanged; + _lastAppliedMode = null; + } + + private SplitViewDisplayMode? _lastAppliedMode; + private bool _updatingLayout; + + private void OnDrawerSizeChanged(object? sender, SizeChangedEventArgs e) + { + if (e.WidthChanged) + UpdateAdaptiveLayout(); + } + + private void UpdateAdaptiveLayout() + { + if (_updatingLayout || DataContext == null) + return; + + var width = Bounds.Width; + if (width <= 0) + return; + + SplitViewDisplayMode targetMode; + if (width >= WideBreakpoint) + targetMode = SplitViewDisplayMode.Inline; + else if (width >= NarrowBreakpoint) + targetMode = SplitViewDisplayMode.CompactInline; + else + targetMode = SplitViewDisplayMode.Overlay; + + if (_lastAppliedMode == targetMode) + return; + + _updatingLayout = true; + try + { + _lastAppliedMode = targetMode; + ViewModel.DisplayMode = targetMode; + + if (targetMode == SplitViewDisplayMode.Inline) + ViewModel.IsDrawerOpened = true; + else if (targetMode == SplitViewDisplayMode.Overlay) + ViewModel.IsDrawerOpened = false; + } + finally + { + _updatingLayout = false; + } } private void Themes_SelectionChanged(object? sender, SelectionChangedEventArgs e) @@ -66,22 +133,38 @@ namespace ControlCatalog var semiTransparentBrush = new ImmutableSolidColorBrush(Colors.Gray, 0.2); _disposeTransparencySetters = (Action)topLevel.SetValue(BackgroundProperty, transparentBrush, Avalonia.Data.BindingPriority.Style)!.Dispose + - Sidebar.SetValue(BackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style)!.Dispose + - Sidebar.SetValue(SplitView.PaneBackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style)!.Dispose; + SetValue(BackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style)!.Dispose + + SetValue(DrawerPage.DrawerBackgroundProperty, semiTransparentBrush, Avalonia.Data.BindingPriority.Style)!.Dispose; } } } + protected override void OnDataContextChanged(EventArgs e) + { + base.OnDataContextChanged(e); + + if (ViewModel != null) + { + ViewModel.Navigator = NavPage; + } + } + internal MainWindowViewModel ViewModel => (MainWindowViewModel)DataContext!; protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) { base.OnAttachedToVisualTree(e); - if (TopLevel.GetTopLevel(this) is Window window) - Decorations.SelectedIndex = (int)window.WindowDecorations; + if (DataContext == null) + return; - var insets = TopLevel.GetTopLevel(this)!.InsetsManager; + UpdateAdaptiveLayout(); + + var topLevel = TopLevel.GetTopLevel(this)!; + if (topLevel is Window window) + ViewModel.SelectedDecorationIndex = (int)window.WindowDecorations; + + var insets = topLevel.InsetsManager; if (insets != null) { // In real life application these events should be unsubscribed to avoid memory leaks. @@ -111,6 +194,8 @@ namespace ControlCatalog ViewModel.IsSystemBarVisible = insets.IsSystemBarVisible ?? true; }; } + + ViewModel.SelectedPageIndex = 0; } } } diff --git a/samples/ControlCatalog/NavHeaderItem.xaml b/samples/ControlCatalog/NavHeaderItem.xaml new file mode 100644 index 0000000000..6867661ebb --- /dev/null +++ b/samples/ControlCatalog/NavHeaderItem.xaml @@ -0,0 +1,101 @@ + + + + + + #99FFFFFF + #FF1F1F1F + #FF000000 + #FF171717 + + + #99000000 + #FFE6E6E6 + #FFFFFFFF + #FFF2F2F2 + + + 36 + 1 1 1 1 #2000, 0 0 1 1 #2fff + + + + Disabled + + Test + + Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/ControlCatalog/Pages/AcceleratorPage.xaml b/samples/ControlCatalog/Pages/AcceleratorPage.xaml index 18072ef1c3..62fcf0d746 100644 --- a/samples/ControlCatalog/Pages/AcceleratorPage.xaml +++ b/samples/ControlCatalog/Pages/AcceleratorPage.xaml @@ -1,115 +1,116 @@ - - + - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - + + - + - - Accelerator Support + + Accelerator Support - - - - This is tab 1 content - - This is tab 1 content - - This is tab 1 content - + + + + This is tab 1 content + + This is tab 1 content + + This is tab 1 content + - - - This is tab 2 content - - + + + This is tab 2 content + + - - - This is tab 4 content - - - This is fab 5 content - - - + + + This is tab 4 content + + + This is fab 5 content + + + - - - + + + - - + + - - + + - - + + - - + + - - + + - + - - - - + + + + + - - + diff --git a/samples/ControlCatalog/Pages/AcceleratorPage.xaml.cs b/samples/ControlCatalog/Pages/AcceleratorPage.xaml.cs index e013d9aaac..40afacc053 100644 --- a/samples/ControlCatalog/Pages/AcceleratorPage.xaml.cs +++ b/samples/ControlCatalog/Pages/AcceleratorPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class AcceleratorPage : UserControl + public partial class AcceleratorPage : ContentPage { public AcceleratorPage() { diff --git a/samples/ControlCatalog/Pages/AcrylicPage.xaml b/samples/ControlCatalog/Pages/AcrylicPage.xaml index 4fd0933879..4a68fbfafd 100644 --- a/samples/ControlCatalog/Pages/AcrylicPage.xaml +++ b/samples/ControlCatalog/Pages/AcrylicPage.xaml @@ -1,12 +1,13 @@ - - + - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + diff --git a/samples/ControlCatalog/Pages/AcrylicPage.xaml.cs b/samples/ControlCatalog/Pages/AcrylicPage.xaml.cs index 9516655bb9..adb5b05706 100644 --- a/samples/ControlCatalog/Pages/AcrylicPage.xaml.cs +++ b/samples/ControlCatalog/Pages/AcrylicPage.xaml.cs @@ -2,7 +2,7 @@ namespace ControlCatalog.Pages { - public partial class AcrylicPage : UserControl + public partial class AcrylicPage : ContentPage { public AcrylicPage() { diff --git a/samples/ControlCatalog/Pages/AdornerLayerPage.xaml b/samples/ControlCatalog/Pages/AdornerLayerPage.xaml index e9a245a8e1..35907c7ef8 100644 --- a/samples/ControlCatalog/Pages/AdornerLayerPage.xaml +++ b/samples/ControlCatalog/Pages/AdornerLayerPage.xaml @@ -1,52 +1,52 @@ - + + + Rotation + + - - - Rotation - - + + - + + + + + + + + + + + + + + - - - - + + + + diff --git a/samples/ControlCatalog/Pages/AdornerLayerPage.xaml.cs b/samples/ControlCatalog/Pages/AdornerLayerPage.xaml.cs index 526b8a492b..5ee8d44479 100644 --- a/samples/ControlCatalog/Pages/AdornerLayerPage.xaml.cs +++ b/samples/ControlCatalog/Pages/AdornerLayerPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class AdornerLayerPage : UserControl + public partial class AdornerLayerPage : ContentPage { private Control? _adorner; diff --git a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml index 35e917f996..4edb00b7c3 100644 --- a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml +++ b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml @@ -1,79 +1,83 @@ - - - A control into which the user can input text + + + A control into which the user can input text - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs index 47b6eb7f4a..295aa9d139 100644 --- a/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs +++ b/samples/ControlCatalog/Pages/AutoCompleteBoxPage.xaml.cs @@ -11,7 +11,7 @@ using ControlCatalog.Models; namespace ControlCatalog.Pages { - public partial class AutoCompleteBoxPage : UserControl + public partial class AutoCompleteBoxPage : ContentPage { private static StateData[] BuildAllStates() { diff --git a/samples/ControlCatalog/Pages/BitmapCachePage.axaml b/samples/ControlCatalog/Pages/BitmapCachePage.axaml index 5902be8e51..4298f29e8f 100644 --- a/samples/ControlCatalog/Pages/BitmapCachePage.axaml +++ b/samples/ControlCatalog/Pages/BitmapCachePage.axaml @@ -1,45 +1,49 @@ - + - - - - - - - Render at scale - - Scale - - Enable clear type + + + + + + + Render at scale + + Scale + + Enable clear type - Snap to device pixels - Subpixel offset X - - - - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - - - + Snap to device pixels + Subpixel offset X + + + + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + - + + + - + + diff --git a/samples/ControlCatalog/Pages/BitmapCachePage.axaml.cs b/samples/ControlCatalog/Pages/BitmapCachePage.axaml.cs index 92b3cbec68..be7cf7a7ea 100644 --- a/samples/ControlCatalog/Pages/BitmapCachePage.axaml.cs +++ b/samples/ControlCatalog/Pages/BitmapCachePage.axaml.cs @@ -4,10 +4,10 @@ using Avalonia.Markup.Xaml; namespace ControlCatalog.Pages; -public partial class BitmapCachePage : UserControl +public partial class BitmapCachePage : ContentPage { public BitmapCachePage() { InitializeComponent(); } -} \ No newline at end of file +} diff --git a/samples/ControlCatalog/Pages/BorderPage.xaml b/samples/ControlCatalog/Pages/BorderPage.xaml index c811ddaa22..297e3fcfb8 100644 --- a/samples/ControlCatalog/Pages/BorderPage.xaml +++ b/samples/ControlCatalog/Pages/BorderPage.xaml @@ -1,61 +1,65 @@ - - - - - - A control which decorates a child with a border and background + + + + + + A control which decorates a child with a border and background - - - Border - - - Background And CenterBorder - - - Background And InnerBorderEdge - - - Background And OuterBorderEdge - - - Rounded Corners - - - Rounded Corners - - - - - + + + Border + + + Background And CenterBorder + + + Background And InnerBorderEdge + + + Background And OuterBorderEdge + + + Rounded Corners + + + Rounded Corners + + + + + + - - + + diff --git a/samples/ControlCatalog/Pages/BorderPage.xaml.cs b/samples/ControlCatalog/Pages/BorderPage.xaml.cs index 944df86f8c..71aebf24ff 100644 --- a/samples/ControlCatalog/Pages/BorderPage.xaml.cs +++ b/samples/ControlCatalog/Pages/BorderPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class BorderPage : UserControl + public partial class BorderPage : ContentPage { public BorderPage() { diff --git a/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml b/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml index 900e304559..c21a772c2a 100644 --- a/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml +++ b/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml @@ -1,6 +1,7 @@ - @@ -30,4 +31,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml.cs b/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml.cs index fad4b466fe..28f4b20084 100644 --- a/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ButtonSpinnerPage.xaml.cs @@ -3,7 +3,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class ButtonSpinnerPage : UserControl + public partial class ButtonSpinnerPage : ContentPage { public ButtonSpinnerPage() { diff --git a/samples/ControlCatalog/Pages/ButtonsPage.xaml b/samples/ControlCatalog/Pages/ButtonsPage.xaml index f13581aa18..695ae28515 100644 --- a/samples/ControlCatalog/Pages/ButtonsPage.xaml +++ b/samples/ControlCatalog/Pages/ButtonsPage.xaml @@ -1,8 +1,9 @@ - - + @@ -16,9 +17,9 @@ - + - + - + @@ -288,4 +289,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ButtonsPage.xaml.cs b/samples/ControlCatalog/Pages/ButtonsPage.xaml.cs index 6dcee1ab7d..611fc76241 100644 --- a/samples/ControlCatalog/Pages/ButtonsPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ButtonsPage.xaml.cs @@ -3,7 +3,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class ButtonsPage : UserControl + public partial class ButtonsPage : ContentPage { private int repeatButtonClickCount = 0; diff --git a/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml b/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml index 8734758d26..769dbc0dac 100644 --- a/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml +++ b/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml @@ -1,7 +1,8 @@ - A control for selecting dates with a calendar drop-down @@ -52,4 +53,4 @@ - + diff --git a/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml.cs b/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml.cs index 73e1fe4bba..0e4fcbd986 100644 --- a/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CalendarDatePickerPage.xaml.cs @@ -3,7 +3,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class CalendarDatePickerPage : UserControl + public partial class CalendarDatePickerPage : ContentPage { public CalendarDatePickerPage() { diff --git a/samples/ControlCatalog/Pages/CalendarPage.xaml b/samples/ControlCatalog/Pages/CalendarPage.xaml index e142c4da72..99727e9124 100644 --- a/samples/ControlCatalog/Pages/CalendarPage.xaml +++ b/samples/ControlCatalog/Pages/CalendarPage.xaml @@ -1,5 +1,6 @@ - A calendar control for selecting dates @@ -49,4 +50,4 @@ - + diff --git a/samples/ControlCatalog/Pages/CalendarPage.xaml.cs b/samples/ControlCatalog/Pages/CalendarPage.xaml.cs index 56f511be55..d9118326f9 100644 --- a/samples/ControlCatalog/Pages/CalendarPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CalendarPage.xaml.cs @@ -3,7 +3,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class CalendarPage : UserControl + public partial class CalendarPage : ContentPage { public CalendarPage() { diff --git a/samples/ControlCatalog/Pages/CanvasPage.xaml b/samples/ControlCatalog/Pages/CanvasPage.xaml index 416164f391..a9e342181d 100644 --- a/samples/ControlCatalog/Pages/CanvasPage.xaml +++ b/samples/ControlCatalog/Pages/CanvasPage.xaml @@ -1,5 +1,6 @@ - A panel which lays out its children by explicit coordinates @@ -34,4 +35,4 @@ - + diff --git a/samples/ControlCatalog/Pages/CanvasPage.xaml.cs b/samples/ControlCatalog/Pages/CanvasPage.xaml.cs index e52df597a9..b94aabca94 100644 --- a/samples/ControlCatalog/Pages/CanvasPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CanvasPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class CanvasPage : UserControl + public partial class CanvasPage : ContentPage { public CanvasPage() { diff --git a/samples/ControlCatalog/Pages/CarouselDemoPage.xaml b/samples/ControlCatalog/Pages/CarouselDemoPage.xaml index df4317fcad..792441ddb4 100644 --- a/samples/ControlCatalog/Pages/CarouselDemoPage.xaml +++ b/samples/ControlCatalog/Pages/CarouselDemoPage.xaml @@ -1,11 +1,14 @@ - - - - - - - + + + + + + + + diff --git a/samples/ControlCatalog/Pages/CarouselDemoPage.xaml.cs b/samples/ControlCatalog/Pages/CarouselDemoPage.xaml.cs index 36c9961658..0d59d296f6 100644 --- a/samples/ControlCatalog/Pages/CarouselDemoPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CarouselDemoPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class CarouselDemoPage : UserControl + public partial class CarouselDemoPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/CarouselPage.xaml b/samples/ControlCatalog/Pages/CarouselPage.xaml index c6e20fec5b..bdb40b9038 100644 --- a/samples/ControlCatalog/Pages/CarouselPage.xaml +++ b/samples/ControlCatalog/Pages/CarouselPage.xaml @@ -1,5 +1,6 @@ - A swipeable items control that can reveal adjacent pages with ViewportFraction. @@ -115,4 +116,4 @@ - + diff --git a/samples/ControlCatalog/Pages/CarouselPage.xaml.cs b/samples/ControlCatalog/Pages/CarouselPage.xaml.cs index 0a0c973b90..c4a6ffa12f 100644 --- a/samples/ControlCatalog/Pages/CarouselPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CarouselPage.xaml.cs @@ -7,7 +7,7 @@ using ControlCatalog.Pages.Transitions; namespace ControlCatalog.Pages { - public partial class CarouselPage : UserControl + public partial class CarouselPage : ContentPage { public CarouselPage() { diff --git a/samples/ControlCatalog/Pages/CheckBoxPage.xaml b/samples/ControlCatalog/Pages/CheckBoxPage.xaml index 2f60fc5dae..4f9c59448b 100644 --- a/samples/ControlCatalog/Pages/CheckBoxPage.xaml +++ b/samples/ControlCatalog/Pages/CheckBoxPage.xaml @@ -1,5 +1,6 @@ - A check box control @@ -25,4 +26,4 @@ - + diff --git a/samples/ControlCatalog/Pages/CheckBoxPage.xaml.cs b/samples/ControlCatalog/Pages/CheckBoxPage.xaml.cs index 95ff21ef6d..b63d7084d6 100644 --- a/samples/ControlCatalog/Pages/CheckBoxPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CheckBoxPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class CheckBoxPage : UserControl + public partial class CheckBoxPage : ContentPage { public CheckBoxPage() { diff --git a/samples/ControlCatalog/Pages/ClipboardPage.xaml b/samples/ControlCatalog/Pages/ClipboardPage.xaml index 864a520aca..86e99b9305 100644 --- a/samples/ControlCatalog/Pages/ClipboardPage.xaml +++ b/samples/ControlCatalog/Pages/ClipboardPage.xaml @@ -1,5 +1,6 @@ - Example of ClipboardPage capabilities @@ -27,4 +28,4 @@ /> - + diff --git a/samples/ControlCatalog/Pages/ClipboardPage.xaml.cs b/samples/ControlCatalog/Pages/ClipboardPage.xaml.cs index 65f58d0444..0bc5447313 100644 --- a/samples/ControlCatalog/Pages/ClipboardPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ClipboardPage.xaml.cs @@ -15,7 +15,7 @@ using Avalonia.Threading; namespace ControlCatalog.Pages { - public partial class ClipboardPage : UserControl + public partial class ClipboardPage : ContentPage { private readonly DataFormat _customBinaryDataFormat = DataFormat.CreateBytesApplicationFormat("controlcatalog-binary-data"); diff --git a/samples/ControlCatalog/Pages/ColorPickerPage.xaml b/samples/ControlCatalog/Pages/ColorPickerPage.xaml index fb397085e7..f0b303e0d4 100644 --- a/samples/ControlCatalog/Pages/ColorPickerPage.xaml +++ b/samples/ControlCatalog/Pages/ColorPickerPage.xaml @@ -1,4 +1,4 @@ - - + - + - + diff --git a/samples/ControlCatalog/Pages/ColorPickerPage.xaml.cs b/samples/ControlCatalog/Pages/ColorPickerPage.xaml.cs index 4d2d236ed3..cc225b576d 100644 --- a/samples/ControlCatalog/Pages/ColorPickerPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ColorPickerPage.xaml.cs @@ -5,7 +5,7 @@ using Avalonia.Media; namespace ControlCatalog.Pages { - public partial class ColorPickerPage : UserControl + public partial class ColorPickerPage : ContentPage { public ColorPickerPage() { diff --git a/samples/ControlCatalog/Pages/ComboBoxPage.xaml b/samples/ControlCatalog/Pages/ComboBoxPage.xaml index 449c10f000..149fd73d0a 100644 --- a/samples/ControlCatalog/Pages/ComboBoxPage.xaml +++ b/samples/ControlCatalog/Pages/ComboBoxPage.xaml @@ -1,4 +1,4 @@ - - + diff --git a/samples/ControlCatalog/Pages/ComboBoxPage.xaml.cs b/samples/ControlCatalog/Pages/ComboBoxPage.xaml.cs index 301b052cb8..720aae9ef5 100644 --- a/samples/ControlCatalog/Pages/ComboBoxPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ComboBoxPage.xaml.cs @@ -4,7 +4,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class ComboBoxPage : UserControl + public partial class ComboBoxPage : ContentPage { public ComboBoxPage() { diff --git a/samples/ControlCatalog/Pages/CommandBarPage.xaml b/samples/ControlCatalog/Pages/CommandBarPage.xaml index 6cf280ea95..3c648ea012 100644 --- a/samples/ControlCatalog/Pages/CommandBarPage.xaml +++ b/samples/ControlCatalog/Pages/CommandBarPage.xaml @@ -1,8 +1,11 @@ - - + - - - + + + + + diff --git a/samples/ControlCatalog/Pages/CommandBarPage.xaml.cs b/samples/ControlCatalog/Pages/CommandBarPage.xaml.cs index b759c7b605..0b81c698d2 100644 --- a/samples/ControlCatalog/Pages/CommandBarPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CommandBarPage.xaml.cs @@ -7,7 +7,7 @@ using Avalonia.Media; namespace ControlCatalog.Pages { - public partial class CommandBarPage : UserControl + public partial class CommandBarPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/CompositionPage.axaml b/samples/ControlCatalog/Pages/CompositionPage.axaml index 4d9bb41781..a3e9b047a8 100644 --- a/samples/ControlCatalog/Pages/CompositionPage.axaml +++ b/samples/ControlCatalog/Pages/CompositionPage.axaml @@ -1,62 +1,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - Resize me - - - + + + + + + + + + + + + + + + + + + + + + + + + + Resize me + + + + + + + + + + + + + + + + + + Precise dirty rects - - - - - - - - - - - - - - Precise dirty rects - - - - - - + + + + diff --git a/samples/ControlCatalog/Pages/CompositionPage.axaml.cs b/samples/ControlCatalog/Pages/CompositionPage.axaml.cs index 287bde0be8..8f5d75f4ce 100644 --- a/samples/ControlCatalog/Pages/CompositionPage.axaml.cs +++ b/samples/ControlCatalog/Pages/CompositionPage.axaml.cs @@ -15,7 +15,7 @@ using Math = System.Math; namespace ControlCatalog.Pages; -public partial class CompositionPage : UserControl +public partial class CompositionPage : TabbedPage { private ImplicitAnimationCollection? _implicitAnimations; private CompositionCustomVisual? _customVisual; diff --git a/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml b/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml index bf37b4cc4f..ca4a85af8d 100644 --- a/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml +++ b/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml @@ -1,6 +1,8 @@ - + - + + diff --git a/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml.cs b/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml.cs index 0c13bb360e..5d666730ae 100644 --- a/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ConnectedAnimationDemoPage.xaml.cs @@ -7,7 +7,7 @@ using Avalonia.Media; namespace ControlCatalog.Pages { - public partial class ConnectedAnimationDemoPage : UserControl + public partial class ConnectedAnimationDemoPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = []; diff --git a/samples/ControlCatalog/Pages/ContainerQueryPage.xaml b/samples/ControlCatalog/Pages/ContainerQueryPage.xaml index e6b0558a04..96f7a87586 100644 --- a/samples/ControlCatalog/Pages/ContainerQueryPage.xaml +++ b/samples/ControlCatalog/Pages/ContainerQueryPage.xaml @@ -1,9 +1,10 @@ - @@ -107,4 +108,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ContainerQueryPage.xaml.cs b/samples/ControlCatalog/Pages/ContainerQueryPage.xaml.cs index acd67c6629..b43723005e 100644 --- a/samples/ControlCatalog/Pages/ContainerQueryPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ContainerQueryPage.xaml.cs @@ -2,7 +2,7 @@ namespace ControlCatalog.Pages { - public partial class ContainerQueryPage : UserControl + public partial class ContainerQueryPage : ContentPage { public ContainerQueryPage() { diff --git a/samples/ControlCatalog/Pages/ContentDemoPage.xaml b/samples/ControlCatalog/Pages/ContentDemoPage.xaml index d8f2155a1b..bcf0ca67ef 100644 --- a/samples/ControlCatalog/Pages/ContentDemoPage.xaml +++ b/samples/ControlCatalog/Pages/ContentDemoPage.xaml @@ -1,11 +1,14 @@ - - - - - - - + + + + + + + + diff --git a/samples/ControlCatalog/Pages/ContentDemoPage.xaml.cs b/samples/ControlCatalog/Pages/ContentDemoPage.xaml.cs index e667cfc0ff..b47dde07c1 100644 --- a/samples/ControlCatalog/Pages/ContentDemoPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ContentDemoPage.xaml.cs @@ -7,7 +7,7 @@ using Avalonia.Media; namespace ControlCatalog.Pages { - public partial class ContentDemoPage : UserControl + public partial class ContentDemoPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml b/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml index c23393e63c..fa52c05bfa 100644 --- a/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml +++ b/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml @@ -1,18 +1,19 @@ - - + - + @@ -156,4 +157,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml.cs b/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml.cs index bef2c8212d..f25b9341c3 100644 --- a/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ContextFlyoutPage.xaml.cs @@ -7,7 +7,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class ContextFlyoutPage : UserControl + public partial class ContextFlyoutPage : ContentPage { public ContextFlyoutPage() { diff --git a/samples/ControlCatalog/Pages/ContextMenuPage.xaml b/samples/ControlCatalog/Pages/ContextMenuPage.xaml index 0e7c7b9451..4d1d02aed8 100644 --- a/samples/ControlCatalog/Pages/ContextMenuPage.xaml +++ b/samples/ControlCatalog/Pages/ContextMenuPage.xaml @@ -1,7 +1,8 @@ - A right click menu that can be applied to any control. @@ -86,4 +87,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ContextMenuPage.xaml.cs b/samples/ControlCatalog/Pages/ContextMenuPage.xaml.cs index a71398181c..86ce807127 100644 --- a/samples/ControlCatalog/Pages/ContextMenuPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ContextMenuPage.xaml.cs @@ -6,7 +6,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class ContextMenuPage : UserControl + public partial class ContextMenuPage : ContentPage { public ContextMenuPage() { diff --git a/samples/ControlCatalog/Pages/CursorPage.xaml b/samples/ControlCatalog/Pages/CursorPage.xaml index 66f2b8b2e3..ae20193c97 100644 --- a/samples/ControlCatalog/Pages/CursorPage.xaml +++ b/samples/ControlCatalog/Pages/CursorPage.xaml @@ -1,6 +1,7 @@ - @@ -27,4 +28,4 @@ - + diff --git a/samples/ControlCatalog/Pages/CursorPage.xaml.cs b/samples/ControlCatalog/Pages/CursorPage.xaml.cs index f9119175e2..88699ac6f2 100644 --- a/samples/ControlCatalog/Pages/CursorPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CursorPage.xaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class CursorPage : UserControl + public partial class CursorPage : ContentPage { public CursorPage() { diff --git a/samples/ControlCatalog/Pages/CustomDrawing.xaml b/samples/ControlCatalog/Pages/CustomDrawing.xaml index 04b7fcfea5..f1cb2dab14 100644 --- a/samples/ControlCatalog/Pages/CustomDrawing.xaml +++ b/samples/ControlCatalog/Pages/CustomDrawing.xaml @@ -1,15 +1,16 @@ - - + - + @@ -104,4 +105,4 @@ - + diff --git a/samples/ControlCatalog/Pages/CustomDrawing.xaml.cs b/samples/ControlCatalog/Pages/CustomDrawing.xaml.cs index d3fedb76be..0eae942075 100644 --- a/samples/ControlCatalog/Pages/CustomDrawing.xaml.cs +++ b/samples/ControlCatalog/Pages/CustomDrawing.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class CustomDrawing : UserControl + public partial class CustomDrawing : ContentPage { public CustomDrawing() { diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml b/samples/ControlCatalog/Pages/DataGridPage.xaml index 3187e13f9f..04adf56700 100644 --- a/samples/ControlCatalog/Pages/DataGridPage.xaml +++ b/samples/ControlCatalog/Pages/DataGridPage.xaml @@ -1,5 +1,6 @@ - @@ -8,4 +9,4 @@ Click="OnLinkClicked" /> - + diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml.cs b/samples/ControlCatalog/Pages/DataGridPage.xaml.cs index 5fa4ec8b0e..1154506e2e 100644 --- a/samples/ControlCatalog/Pages/DataGridPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DataGridPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages; -public partial class DataGridPage : UserControl +public partial class DataGridPage : ContentPage { public DataGridPage() { diff --git a/samples/ControlCatalog/Pages/DataValidationPage.axaml b/samples/ControlCatalog/Pages/DataValidationPage.axaml index d46562addd..de4e398725 100644 --- a/samples/ControlCatalog/Pages/DataValidationPage.axaml +++ b/samples/ControlCatalog/Pages/DataValidationPage.axaml @@ -1,14 +1,15 @@ - - + - + - + diff --git a/samples/ControlCatalog/Pages/DataValidationPage.axaml.cs b/samples/ControlCatalog/Pages/DataValidationPage.axaml.cs index e38f85fec4..26bb75ca79 100644 --- a/samples/ControlCatalog/Pages/DataValidationPage.axaml.cs +++ b/samples/ControlCatalog/Pages/DataValidationPage.axaml.cs @@ -4,7 +4,7 @@ using Avalonia.Markup.Xaml; namespace ControlCatalog.Pages; -public partial class DataValidationPage : UserControl +public partial class DataValidationPage : ContentPage { public DataValidationPage() { diff --git a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml index 7a1bfaa824..2183204c05 100644 --- a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml +++ b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml @@ -1,7 +1,8 @@ - @@ -207,4 +208,4 @@ - + diff --git a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs index b5968a6b2a..99250d5fb0 100644 --- a/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DateTimePickerPage.xaml.cs @@ -2,7 +2,7 @@ namespace ControlCatalog.Pages { - public partial class DateTimePickerPage : UserControl + public partial class DateTimePickerPage : ContentPage { public DateTimePickerPage() { diff --git a/samples/ControlCatalog/Pages/DialogsPage.xaml b/samples/ControlCatalog/Pages/DialogsPage.xaml index e6b3568909..296b632b91 100644 --- a/samples/ControlCatalog/Pages/DialogsPage.xaml +++ b/samples/ControlCatalog/Pages/DialogsPage.xaml @@ -1,6 +1,7 @@ - - + diff --git a/samples/ControlCatalog/Pages/DialogsPage.xaml.cs b/samples/ControlCatalog/Pages/DialogsPage.xaml.cs index adcf844552..616e3d4f62 100644 --- a/samples/ControlCatalog/Pages/DialogsPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DialogsPage.xaml.cs @@ -12,7 +12,7 @@ using Avalonia.Platform.Storage; namespace ControlCatalog.Pages { - public partial class DialogsPage : UserControl + public partial class DialogsPage : ContentPage { public DialogsPage() { diff --git a/samples/ControlCatalog/Pages/DragAndDropPage.xaml b/samples/ControlCatalog/Pages/DragAndDropPage.xaml index 7982ddc1d0..2ca9ed27a0 100644 --- a/samples/ControlCatalog/Pages/DragAndDropPage.xaml +++ b/samples/ControlCatalog/Pages/DragAndDropPage.xaml @@ -1,15 +1,16 @@ - - + - + Example of Drag+Drop capabilities @@ -57,4 +58,4 @@ - + diff --git a/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs b/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs index fe2b306477..b2a91da381 100644 --- a/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DragAndDropPage.xaml.cs @@ -13,7 +13,7 @@ using Avalonia.Platform.Storage; namespace ControlCatalog.Pages { - public partial class DragAndDropPage : UserControl + public partial class DragAndDropPage : ContentPage { private readonly DataFormat _customFormat = DataFormat.CreateStringApplicationFormat("xxx-avalonia-controlcatalog-custom"); diff --git a/samples/ControlCatalog/Pages/DrawerDemoPage.xaml b/samples/ControlCatalog/Pages/DrawerDemoPage.xaml index 671a9a8487..f1edd0bc63 100644 --- a/samples/ControlCatalog/Pages/DrawerDemoPage.xaml +++ b/samples/ControlCatalog/Pages/DrawerDemoPage.xaml @@ -1,11 +1,14 @@ - - - - - - - + + + + + + + + diff --git a/samples/ControlCatalog/Pages/DrawerDemoPage.xaml.cs b/samples/ControlCatalog/Pages/DrawerDemoPage.xaml.cs index cd8aa9cd5b..27eb93ff03 100644 --- a/samples/ControlCatalog/Pages/DrawerDemoPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DrawerDemoPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class DrawerDemoPage : UserControl + public partial class DrawerDemoPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/ExpanderPage.xaml b/samples/ControlCatalog/Pages/ExpanderPage.xaml index b5a2e6cdd0..322da30a61 100644 --- a/samples/ControlCatalog/Pages/ExpanderPage.xaml +++ b/samples/ControlCatalog/Pages/ExpanderPage.xaml @@ -1,7 +1,8 @@ - Expands to show nested content @@ -72,4 +73,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs b/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs index 05c5cbee53..65b7b7e30b 100644 --- a/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ExpanderPage.xaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class ExpanderPage : UserControl + public partial class ExpanderPage : ContentPage { public ExpanderPage() { diff --git a/samples/ControlCatalog/Pages/FlyoutsPage.axaml b/samples/ControlCatalog/Pages/FlyoutsPage.axaml index 64a005c987..840557bb9f 100644 --- a/samples/ControlCatalog/Pages/FlyoutsPage.axaml +++ b/samples/ControlCatalog/Pages/FlyoutsPage.axaml @@ -1,11 +1,12 @@ - - + @@ -25,7 +26,7 @@ - + @@ -282,4 +283,4 @@ - + diff --git a/samples/ControlCatalog/Pages/FlyoutsPage.axaml.cs b/samples/ControlCatalog/Pages/FlyoutsPage.axaml.cs index 91e92bc227..d6f54df074 100644 --- a/samples/ControlCatalog/Pages/FlyoutsPage.axaml.cs +++ b/samples/ControlCatalog/Pages/FlyoutsPage.axaml.cs @@ -7,7 +7,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class FlyoutsPage : UserControl + public partial class FlyoutsPage : ContentPage { public FlyoutsPage() { diff --git a/samples/ControlCatalog/Pages/FocusPage.xaml b/samples/ControlCatalog/Pages/FocusPage.xaml index f4bad7d138..6cb2647907 100644 --- a/samples/ControlCatalog/Pages/FocusPage.xaml +++ b/samples/ControlCatalog/Pages/FocusPage.xaml @@ -1,9 +1,10 @@ - @@ -47,4 +48,4 @@ - + diff --git a/samples/ControlCatalog/Pages/FocusPage.xaml.cs b/samples/ControlCatalog/Pages/FocusPage.xaml.cs index 2cc8067885..18aae471ab 100644 --- a/samples/ControlCatalog/Pages/FocusPage.xaml.cs +++ b/samples/ControlCatalog/Pages/FocusPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Markup.Xaml; namespace ControlCatalog.Pages; -public partial class FocusPage : UserControl +public partial class FocusPage : ContentPage { public FocusPage() { diff --git a/samples/ControlCatalog/Pages/GesturePage.xaml b/samples/ControlCatalog/Pages/GesturePage.xaml index bce18eab1d..da9ed5f807 100644 --- a/samples/ControlCatalog/Pages/GesturePage.xaml +++ b/samples/ControlCatalog/Pages/GesturePage.xaml @@ -1,11 +1,14 @@ - - - - - - - + + + + + + + + diff --git a/samples/ControlCatalog/Pages/GesturePage.cs b/samples/ControlCatalog/Pages/GesturePage.xaml.cs similarity index 96% rename from samples/ControlCatalog/Pages/GesturePage.cs rename to samples/ControlCatalog/Pages/GesturePage.xaml.cs index d8b89e0ecb..56c09573d0 100644 --- a/samples/ControlCatalog/Pages/GesturePage.cs +++ b/samples/ControlCatalog/Pages/GesturePage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class GesturePage : UserControl + public partial class GesturePage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/HeaderedContentPage.axaml b/samples/ControlCatalog/Pages/HeaderedContentPage.axaml index 86a2b00b72..cbf12695fd 100644 --- a/samples/ControlCatalog/Pages/HeaderedContentPage.axaml +++ b/samples/ControlCatalog/Pages/HeaderedContentPage.axaml @@ -1,8 +1,9 @@ - - + diff --git a/samples/ControlCatalog/Pages/HeaderedContentPage.axaml.cs b/samples/ControlCatalog/Pages/HeaderedContentPage.axaml.cs index ab967c4214..bfe033f90c 100644 --- a/samples/ControlCatalog/Pages/HeaderedContentPage.axaml.cs +++ b/samples/ControlCatalog/Pages/HeaderedContentPage.axaml.cs @@ -4,7 +4,7 @@ using Avalonia.Markup.Xaml; namespace ControlCatalog.Pages; -public partial class HeaderedContentPage : UserControl +public partial class HeaderedContentPage : ContentPage { public HeaderedContentPage() { diff --git a/samples/ControlCatalog/Pages/ImagePage.xaml b/samples/ControlCatalog/Pages/ImagePage.xaml index 444d370e42..abd9ff47b0 100644 --- a/samples/ControlCatalog/Pages/ImagePage.xaml +++ b/samples/ControlCatalog/Pages/ImagePage.xaml @@ -1,5 +1,6 @@ - @@ -65,4 +66,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ImagePage.xaml.cs b/samples/ControlCatalog/Pages/ImagePage.xaml.cs index f8630d7db6..eccdb9435f 100644 --- a/samples/ControlCatalog/Pages/ImagePage.xaml.cs +++ b/samples/ControlCatalog/Pages/ImagePage.xaml.cs @@ -5,7 +5,7 @@ using Avalonia.Media.Imaging; namespace ControlCatalog.Pages { - public partial class ImagePage : UserControl + public partial class ImagePage : ContentPage { public ImagePage() { diff --git a/samples/ControlCatalog/Pages/LabelsPage.axaml b/samples/ControlCatalog/Pages/LabelsPage.axaml index 5bfb2ee10e..cd367aa38a 100644 --- a/samples/ControlCatalog/Pages/LabelsPage.axaml +++ b/samples/ControlCatalog/Pages/LabelsPage.axaml @@ -1,13 +1,14 @@ - - + - + @@ -41,4 +42,4 @@ - + diff --git a/samples/ControlCatalog/Pages/LabelsPage.axaml.cs b/samples/ControlCatalog/Pages/LabelsPage.axaml.cs index f3a7647f8c..b26112b351 100644 --- a/samples/ControlCatalog/Pages/LabelsPage.axaml.cs +++ b/samples/ControlCatalog/Pages/LabelsPage.axaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.Models; namespace ControlCatalog.Pages { - public partial class LabelsPage : UserControl + public partial class LabelsPage : ContentPage { private Person? _person; diff --git a/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml b/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml index 8cf3610b47..d12bbfc302 100644 --- a/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml +++ b/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml @@ -1,5 +1,6 @@ - @@ -24,4 +25,4 @@ - + diff --git a/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml.cs b/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml.cs index 2060790594..e3815238be 100644 --- a/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml.cs +++ b/samples/ControlCatalog/Pages/LayoutTransformControlPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class LayoutTransformControlPage : UserControl + public partial class LayoutTransformControlPage : ContentPage { public LayoutTransformControlPage() { diff --git a/samples/ControlCatalog/Pages/ListBoxPage.xaml b/samples/ControlCatalog/Pages/ListBoxPage.xaml index e3a706bfed..f73a4c18ed 100644 --- a/samples/ControlCatalog/Pages/ListBoxPage.xaml +++ b/samples/ControlCatalog/Pages/ListBoxPage.xaml @@ -1,6 +1,7 @@ - @@ -47,4 +48,4 @@ SelectionMode="{Binding SelectionMode^}" WrapSelection="{Binding WrapSelection}"/> - + diff --git a/samples/ControlCatalog/Pages/ListBoxPage.xaml.cs b/samples/ControlCatalog/Pages/ListBoxPage.xaml.cs index 3dac437f3a..208b5cce4b 100644 --- a/samples/ControlCatalog/Pages/ListBoxPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ListBoxPage.xaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class ListBoxPage : UserControl + public partial class ListBoxPage : ContentPage { public ListBoxPage() { diff --git a/samples/ControlCatalog/Pages/MenuPage.xaml b/samples/ControlCatalog/Pages/MenuPage.xaml index bbcc759ca7..d9fb5d81bf 100644 --- a/samples/ControlCatalog/Pages/MenuPage.xaml +++ b/samples/ControlCatalog/Pages/MenuPage.xaml @@ -1,7 +1,8 @@ - Exported menu fallback @@ -95,4 +96,4 @@ - + diff --git a/samples/ControlCatalog/Pages/MenuPage.xaml.cs b/samples/ControlCatalog/Pages/MenuPage.xaml.cs index a07306b81d..56a229a594 100644 --- a/samples/ControlCatalog/Pages/MenuPage.xaml.cs +++ b/samples/ControlCatalog/Pages/MenuPage.xaml.cs @@ -4,7 +4,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class MenuPage : UserControl + public partial class MenuPage : ContentPage { public MenuPage() { diff --git a/samples/ControlCatalog/Pages/NativeEmbedPage.xaml b/samples/ControlCatalog/Pages/NativeEmbedPage.xaml index 89e636112c..71d622bae4 100644 --- a/samples/ControlCatalog/Pages/NativeEmbedPage.xaml +++ b/samples/ControlCatalog/Pages/NativeEmbedPage.xaml @@ -1,10 +1,11 @@ - @@ -65,4 +66,4 @@ - + diff --git a/samples/ControlCatalog/Pages/NativeEmbedPage.xaml.cs b/samples/ControlCatalog/Pages/NativeEmbedPage.xaml.cs index b9bac10f9a..1cd1f78cc0 100644 --- a/samples/ControlCatalog/Pages/NativeEmbedPage.xaml.cs +++ b/samples/ControlCatalog/Pages/NativeEmbedPage.xaml.cs @@ -7,7 +7,7 @@ using Avalonia.Platform; namespace ControlCatalog.Pages { - public partial class NativeEmbedPage : UserControl + public partial class NativeEmbedPage : ContentPage { public NativeEmbedPage() { diff --git a/samples/ControlCatalog/Pages/NavigationDemoPage.xaml b/samples/ControlCatalog/Pages/NavigationDemoPage.xaml index 4849b2d5b8..0f7536b6a3 100644 --- a/samples/ControlCatalog/Pages/NavigationDemoPage.xaml +++ b/samples/ControlCatalog/Pages/NavigationDemoPage.xaml @@ -1,11 +1,14 @@ - - - - - - - + + + + + + + + diff --git a/samples/ControlCatalog/Pages/NavigationDemoPage.xaml.cs b/samples/ControlCatalog/Pages/NavigationDemoPage.xaml.cs index d65a43a6ad..7ca41ab893 100644 --- a/samples/ControlCatalog/Pages/NavigationDemoPage.xaml.cs +++ b/samples/ControlCatalog/Pages/NavigationDemoPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class NavigationDemoPage : UserControl + public partial class NavigationDemoPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/NotificationsPage.xaml b/samples/ControlCatalog/Pages/NotificationsPage.xaml index b4094d8a2e..2ae1db7d43 100644 --- a/samples/ControlCatalog/Pages/NotificationsPage.xaml +++ b/samples/ControlCatalog/Pages/NotificationsPage.xaml @@ -1,8 +1,9 @@ - - + diff --git a/samples/ControlCatalog/Pages/NotificationsPage.xaml.cs b/samples/ControlCatalog/Pages/NotificationsPage.xaml.cs index f3db564571..5ff67e10dc 100644 --- a/samples/ControlCatalog/Pages/NotificationsPage.xaml.cs +++ b/samples/ControlCatalog/Pages/NotificationsPage.xaml.cs @@ -5,7 +5,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class NotificationsPage : UserControl + public partial class NotificationsPage : ContentPage { private NotificationViewModel _viewModel; diff --git a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml index a112f79c02..dcc84c3ae8 100644 --- a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml +++ b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml @@ -1,8 +1,9 @@ - - + diff --git a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs index 379090830d..db64fba0ef 100644 --- a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs +++ b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml.cs @@ -9,7 +9,7 @@ using MiniMvvm; namespace ControlCatalog.Pages { - public partial class NumericUpDownPage : UserControl + public partial class NumericUpDownPage : ContentPage { public NumericUpDownPage() { diff --git a/samples/ControlCatalog/Pages/OpenGlPage.xaml b/samples/ControlCatalog/Pages/OpenGlPage.xaml index 0e557cc1ad..9119be05f5 100644 --- a/samples/ControlCatalog/Pages/OpenGlPage.xaml +++ b/samples/ControlCatalog/Pages/OpenGlPage.xaml @@ -1,7 +1,8 @@ - @@ -10,4 +11,4 @@ IsVisible="False" VerticalAlignment="Bottom" HorizontalAlignment="Right" Click="SnapshotClick">Snapshot - + diff --git a/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs b/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs index 09173e01a5..51dc4c2c72 100644 --- a/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs +++ b/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs @@ -11,7 +11,7 @@ using ControlCatalog.Pages.OpenGl; namespace ControlCatalog.Pages { - public partial class OpenGlPage : UserControl + public partial class OpenGlPage : ContentPage { public OpenGlPage() { diff --git a/samples/ControlCatalog/Pages/PipsPagerPage.xaml b/samples/ControlCatalog/Pages/PipsPagerPage.xaml index 54112daae0..aee21a7d01 100644 --- a/samples/ControlCatalog/Pages/PipsPagerPage.xaml +++ b/samples/ControlCatalog/Pages/PipsPagerPage.xaml @@ -1,11 +1,14 @@ - - - - - - - + + + + + + + + diff --git a/samples/ControlCatalog/Pages/PipsPagerPage.xaml.cs b/samples/ControlCatalog/Pages/PipsPagerPage.xaml.cs index 0559a265e4..5a3b142f59 100644 --- a/samples/ControlCatalog/Pages/PipsPagerPage.xaml.cs +++ b/samples/ControlCatalog/Pages/PipsPagerPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class PipsPagerPage : UserControl + public partial class PipsPagerPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/PlatformInfoPage.xaml b/samples/ControlCatalog/Pages/PlatformInfoPage.xaml index 22c47f6bef..f86d53b740 100644 --- a/samples/ControlCatalog/Pages/PlatformInfoPage.xaml +++ b/samples/ControlCatalog/Pages/PlatformInfoPage.xaml @@ -1,4 +1,4 @@ - @@ -53,4 +54,4 @@ - + diff --git a/samples/ControlCatalog/Pages/PlatformInfoPage.xaml.cs b/samples/ControlCatalog/Pages/PlatformInfoPage.xaml.cs index 5066bc51de..db1bbef40c 100644 --- a/samples/ControlCatalog/Pages/PlatformInfoPage.xaml.cs +++ b/samples/ControlCatalog/Pages/PlatformInfoPage.xaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class PlatformInfoPage : UserControl + public partial class PlatformInfoPage : ContentPage { public PlatformInfoPage() { diff --git a/samples/ControlCatalog/Pages/PointersPage.xaml b/samples/ControlCatalog/Pages/PointersPage.xaml index dda85316f6..2f958b901b 100644 --- a/samples/ControlCatalog/Pages/PointersPage.xaml +++ b/samples/ControlCatalog/Pages/PointersPage.xaml @@ -1,12 +1,12 @@ - - - + - - + + - - + + - - + + Capture 2 - - - + + diff --git a/samples/ControlCatalog/Pages/PointersPage.xaml.cs b/samples/ControlCatalog/Pages/PointersPage.xaml.cs index adf45029ec..388c8fa382 100644 --- a/samples/ControlCatalog/Pages/PointersPage.xaml.cs +++ b/samples/ControlCatalog/Pages/PointersPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Input; namespace ControlCatalog.Pages; -public partial class PointersPage : UserControl +public partial class PointersPage : TabbedPage { public PointersPage() { diff --git a/samples/ControlCatalog/Pages/ProgressBarPage.xaml b/samples/ControlCatalog/Pages/ProgressBarPage.xaml index 52e1e198b5..3b80b5a6bb 100644 --- a/samples/ControlCatalog/Pages/ProgressBarPage.xaml +++ b/samples/ControlCatalog/Pages/ProgressBarPage.xaml @@ -1,4 +1,8 @@ - + A progress bar control @@ -18,10 +22,10 @@ - - @@ -36,4 +40,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ProgressBarPage.xaml.cs b/samples/ControlCatalog/Pages/ProgressBarPage.xaml.cs index 42b9fe29d7..244161a61e 100644 --- a/samples/ControlCatalog/Pages/ProgressBarPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ProgressBarPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class ProgressBarPage : UserControl + public partial class ProgressBarPage : ContentPage { public ProgressBarPage() { diff --git a/samples/ControlCatalog/Pages/RadioButtonPage.xaml b/samples/ControlCatalog/Pages/RadioButtonPage.xaml index 8623d81b3f..efb63ea124 100644 --- a/samples/ControlCatalog/Pages/RadioButtonPage.xaml +++ b/samples/ControlCatalog/Pages/RadioButtonPage.xaml @@ -1,5 +1,6 @@ - Allows the selection of a single option of many @@ -37,4 +38,4 @@ - + diff --git a/samples/ControlCatalog/Pages/RadioButtonPage.xaml.cs b/samples/ControlCatalog/Pages/RadioButtonPage.xaml.cs index 798df9fe77..8199a7caf5 100644 --- a/samples/ControlCatalog/Pages/RadioButtonPage.xaml.cs +++ b/samples/ControlCatalog/Pages/RadioButtonPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class RadioButtonPage : UserControl + public partial class RadioButtonPage : ContentPage { public RadioButtonPage() { diff --git a/samples/ControlCatalog/Pages/RefreshContainerPage.axaml b/samples/ControlCatalog/Pages/RefreshContainerPage.axaml index f6ea26a84c..06f54dd28a 100644 --- a/samples/ControlCatalog/Pages/RefreshContainerPage.axaml +++ b/samples/ControlCatalog/Pages/RefreshContainerPage.axaml @@ -1,4 +1,4 @@ - - + diff --git a/samples/ControlCatalog/Pages/RefreshContainerPage.axaml.cs b/samples/ControlCatalog/Pages/RefreshContainerPage.axaml.cs index a710cd7e5c..2c886fa9de 100644 --- a/samples/ControlCatalog/Pages/RefreshContainerPage.axaml.cs +++ b/samples/ControlCatalog/Pages/RefreshContainerPage.axaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class RefreshContainerPage : UserControl + public partial class RefreshContainerPage : ContentPage { private RefreshContainerViewModel _viewModel; diff --git a/samples/ControlCatalog/Pages/RelativePanelPage.axaml b/samples/ControlCatalog/Pages/RelativePanelPage.axaml index a6647b0d36..ccc39befd4 100644 --- a/samples/ControlCatalog/Pages/RelativePanelPage.axaml +++ b/samples/ControlCatalog/Pages/RelativePanelPage.axaml @@ -1,8 +1,9 @@ - @@ -60,4 +61,4 @@ - + diff --git a/samples/ControlCatalog/Pages/RelativePanelPage.axaml.cs b/samples/ControlCatalog/Pages/RelativePanelPage.axaml.cs index aec13a18e3..3c59deb791 100644 --- a/samples/ControlCatalog/Pages/RelativePanelPage.axaml.cs +++ b/samples/ControlCatalog/Pages/RelativePanelPage.axaml.cs @@ -2,7 +2,7 @@ namespace ControlCatalog.Pages { - public partial class RelativePanelPage : UserControl + public partial class RelativePanelPage : ContentPage { public RelativePanelPage() { diff --git a/samples/ControlCatalog/Pages/ScreenPage.cs b/samples/ControlCatalog/Pages/ScreenPage.cs index 66e90c2b34..9791152923 100644 --- a/samples/ControlCatalog/Pages/ScreenPage.cs +++ b/samples/ControlCatalog/Pages/ScreenPage.cs @@ -11,7 +11,7 @@ using Avalonia.Threading; namespace ControlCatalog.Pages { - public class ScreenPage : UserControl + public class ScreenPage : ContentPage { private double _leftMost; private double _topMost; diff --git a/samples/ControlCatalog/Pages/ScrollViewerPage.xaml b/samples/ControlCatalog/Pages/ScrollViewerPage.xaml index f931542a04..0567dbe451 100644 --- a/samples/ControlCatalog/Pages/ScrollViewerPage.xaml +++ b/samples/ControlCatalog/Pages/ScrollViewerPage.xaml @@ -1,10 +1,10 @@ - - - + - - + + - - - + + diff --git a/samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs b/samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs index 7c684357d3..cfdd5bab54 100644 --- a/samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ScrollViewerPage.xaml.cs @@ -92,7 +92,7 @@ namespace ControlCatalog.Pages public List AvailableSnapPointsAlignment { get; } } - public partial class ScrollViewerPage : UserControl + public partial class ScrollViewerPage : TabbedPage { public ScrollViewerPage() { diff --git a/samples/ControlCatalog/Pages/SliderPage.xaml b/samples/ControlCatalog/Pages/SliderPage.xaml index 7821e885ba..445564cb54 100644 --- a/samples/ControlCatalog/Pages/SliderPage.xaml +++ b/samples/ControlCatalog/Pages/SliderPage.xaml @@ -1,5 +1,6 @@ - @@ -80,4 +81,4 @@ - + diff --git a/samples/ControlCatalog/Pages/SliderPage.xaml.cs b/samples/ControlCatalog/Pages/SliderPage.xaml.cs index 8345df8716..f65f714300 100644 --- a/samples/ControlCatalog/Pages/SliderPage.xaml.cs +++ b/samples/ControlCatalog/Pages/SliderPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class SliderPage : UserControl + public partial class SliderPage : ContentPage { public SliderPage() { diff --git a/samples/ControlCatalog/Pages/SplitViewPage.xaml b/samples/ControlCatalog/Pages/SplitViewPage.xaml index 201765ad88..144688e358 100644 --- a/samples/ControlCatalog/Pages/SplitViewPage.xaml +++ b/samples/ControlCatalog/Pages/SplitViewPage.xaml @@ -1,8 +1,9 @@ - @@ -109,4 +110,4 @@ - + diff --git a/samples/ControlCatalog/Pages/SplitViewPage.xaml.cs b/samples/ControlCatalog/Pages/SplitViewPage.xaml.cs index b711db3c49..4917a13ccf 100644 --- a/samples/ControlCatalog/Pages/SplitViewPage.xaml.cs +++ b/samples/ControlCatalog/Pages/SplitViewPage.xaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class SplitViewPage : UserControl + public partial class SplitViewPage : ContentPage { public SplitViewPage() { diff --git a/samples/ControlCatalog/Pages/TabControlPage.xaml b/samples/ControlCatalog/Pages/TabControlPage.xaml index a3bacfd92a..e7aa18ea84 100644 --- a/samples/ControlCatalog/Pages/TabControlPage.xaml +++ b/samples/ControlCatalog/Pages/TabControlPage.xaml @@ -1,7 +1,8 @@ - @@ -108,4 +109,4 @@ - + diff --git a/samples/ControlCatalog/Pages/TabControlPage.xaml.cs b/samples/ControlCatalog/Pages/TabControlPage.xaml.cs index b7f34eda86..366b5216ef 100644 --- a/samples/ControlCatalog/Pages/TabControlPage.xaml.cs +++ b/samples/ControlCatalog/Pages/TabControlPage.xaml.cs @@ -6,7 +6,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class TabControlPage : UserControl + public partial class TabControlPage : ContentPage { public TabControlPage() { diff --git a/samples/ControlCatalog/Pages/TabStripPage.xaml b/samples/ControlCatalog/Pages/TabStripPage.xaml index b576beeb5f..f4a47af353 100644 --- a/samples/ControlCatalog/Pages/TabStripPage.xaml +++ b/samples/ControlCatalog/Pages/TabStripPage.xaml @@ -1,6 +1,7 @@ - @@ -31,4 +32,4 @@ - + diff --git a/samples/ControlCatalog/Pages/TabStripPage.xaml.cs b/samples/ControlCatalog/Pages/TabStripPage.xaml.cs index d2873f6586..d830109833 100644 --- a/samples/ControlCatalog/Pages/TabStripPage.xaml.cs +++ b/samples/ControlCatalog/Pages/TabStripPage.xaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class TabStripPage : UserControl + public partial class TabStripPage : ContentPage { public TabStripPage() { diff --git a/samples/ControlCatalog/Pages/TabbedDemoPage.xaml b/samples/ControlCatalog/Pages/TabbedDemoPage.xaml index bb1467060b..58a3b4fe82 100644 --- a/samples/ControlCatalog/Pages/TabbedDemoPage.xaml +++ b/samples/ControlCatalog/Pages/TabbedDemoPage.xaml @@ -1,11 +1,14 @@ - - - - - - - + + + + + + + + diff --git a/samples/ControlCatalog/Pages/TabbedDemoPage.xaml.cs b/samples/ControlCatalog/Pages/TabbedDemoPage.xaml.cs index 51da6330a1..88692c97f3 100644 --- a/samples/ControlCatalog/Pages/TabbedDemoPage.xaml.cs +++ b/samples/ControlCatalog/Pages/TabbedDemoPage.xaml.cs @@ -4,7 +4,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class TabbedDemoPage : UserControl + public partial class TabbedDemoPage : ContentPage { private static readonly (string Group, string Title, string Description, Func Factory)[] Demos = { diff --git a/samples/ControlCatalog/Pages/TextBlockPage.xaml b/samples/ControlCatalog/Pages/TextBlockPage.xaml index 7c0300d318..3418cffe74 100644 --- a/samples/ControlCatalog/Pages/TextBlockPage.xaml +++ b/samples/ControlCatalog/Pages/TextBlockPage.xaml @@ -1,5 +1,6 @@ - A control that can display text @@ -137,4 +138,4 @@ - + diff --git a/samples/ControlCatalog/Pages/TextBlockPage.xaml.cs b/samples/ControlCatalog/Pages/TextBlockPage.xaml.cs index d097d1d083..d10d255a4f 100644 --- a/samples/ControlCatalog/Pages/TextBlockPage.xaml.cs +++ b/samples/ControlCatalog/Pages/TextBlockPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class TextBlockPage : UserControl + public partial class TextBlockPage : ContentPage { public TextBlockPage() { diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml b/samples/ControlCatalog/Pages/TextBoxPage.xaml index 346e561dfc..9b5a412f86 100644 --- a/samples/ControlCatalog/Pages/TextBoxPage.xaml +++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml @@ -1,6 +1,7 @@ - @@ -101,4 +102,4 @@ FontFamily="avares://ControlCatalog/Assets/Fonts#WenQuanYi Micro Hei" Text="计算机科学(是系统性研究信息与计算的理论基础以及它们在计算机系统中如何实现与应用的实用技术的学科。它通常被形容为对那些创造、描述以及转换信息的算法处理的系统研究。计算机科学包含很多分支领域;有些强调特定结果的计算,比如计算机图形学;而有些是探討计算问题的性质,比如计算复杂性理论;还有一些领域專注于怎样实现计算,比如程式語言理論是研究描述计算的方法,而程式设计是应用特定的程式語言解决特定的计算问题,人机交互则是專注于怎样使计算机和计算变得有用、好用,以及随时随地为人所用。 有时公众会误以为计算机科学就是解决计算机问题的事业(比如信息技术),或者只是与使用计算机的经验有关,如玩游戏、上网或者文字处理。其实计算机科学所关注的,不仅仅是去理解实现类似游戏、浏览器这些软件的程序的性质,更要通过现有的知识创造新的程序或者改进已有的程序。" /> - + diff --git a/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs b/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs index 035f951a6b..3c38a05c53 100644 --- a/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs +++ b/samples/ControlCatalog/Pages/TextBoxPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class TextBoxPage : UserControl + public partial class TextBoxPage : ContentPage { public TextBoxPage() { diff --git a/samples/ControlCatalog/Pages/ThemePage.axaml b/samples/ControlCatalog/Pages/ThemePage.axaml index 7eb95471a0..ccc5769fe7 100644 --- a/samples/ControlCatalog/Pages/ThemePage.axaml +++ b/samples/ControlCatalog/Pages/ThemePage.axaml @@ -1,13 +1,14 @@ - - + @@ -52,7 +53,7 @@ - + - + diff --git a/samples/ControlCatalog/Pages/ThemePage.axaml.cs b/samples/ControlCatalog/Pages/ThemePage.axaml.cs index d355b399a4..4f45e93ed0 100644 --- a/samples/ControlCatalog/Pages/ThemePage.axaml.cs +++ b/samples/ControlCatalog/Pages/ThemePage.axaml.cs @@ -4,7 +4,7 @@ using Avalonia.Styling; namespace ControlCatalog.Pages { - public partial class ThemePage : UserControl + public partial class ThemePage : ContentPage { public static ThemeVariant Pink { get; } = new("Pink", ThemeVariant.Light); diff --git a/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml b/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml index 6afe6dd135..126cc7e7d2 100644 --- a/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml +++ b/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml @@ -1,5 +1,6 @@ - @@ -17,7 +18,7 @@ + Text="<ToggleSwitch>headered</ToggleSwitch>"/> @@ -26,14 +27,14 @@ + OnContent="On" + OffContent="Off" + Margin="10"/> - + @@ -55,7 +56,7 @@ ContentOff="Off" />" - + - - + + diff --git a/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml.cs b/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml.cs index 77d77daeed..a60eb295b0 100644 --- a/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ToggleSwitchPage.xaml.cs @@ -2,7 +2,7 @@ namespace ControlCatalog.Pages { - public partial class ToggleSwitchPage : UserControl + public partial class ToggleSwitchPage : ContentPage { public ToggleSwitchPage() { diff --git a/samples/ControlCatalog/Pages/ToolTipPage.xaml b/samples/ControlCatalog/Pages/ToolTipPage.xaml index 8b76cccbc9..cc3a50b8e9 100644 --- a/samples/ControlCatalog/Pages/ToolTipPage.xaml +++ b/samples/ControlCatalog/Pages/ToolTipPage.xaml @@ -1,5 +1,6 @@ - @@ -10,7 +11,7 @@ HorizontalAlignment="Center"> - + diff --git a/samples/ControlCatalog/Pages/ToolTipPage.xaml.cs b/samples/ControlCatalog/Pages/ToolTipPage.xaml.cs index cd0b5c72a8..e436407dc5 100644 --- a/samples/ControlCatalog/Pages/ToolTipPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ToolTipPage.xaml.cs @@ -6,7 +6,7 @@ using Avalonia.Interactivity; namespace ControlCatalog.Pages { - public partial class ToolTipPage : UserControl + public partial class ToolTipPage : ContentPage { public ToolTipPage() { diff --git a/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml b/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml index 03ef86fb61..5435ed278d 100644 --- a/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml +++ b/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml @@ -1,19 +1,20 @@ - - + - + - + - + - + 8 - + @@ -81,4 +82,4 @@ - + diff --git a/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml.cs b/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml.cs index 863ddae6e0..818ab6219d 100644 --- a/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml.cs +++ b/samples/ControlCatalog/Pages/TransitioningContentControlPage.axaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class TransitioningContentControlPage : UserControl + public partial class TransitioningContentControlPage : ContentPage { public TransitioningContentControlPage() { diff --git a/samples/ControlCatalog/Pages/TreeViewPage.xaml b/samples/ControlCatalog/Pages/TreeViewPage.xaml index 2e3fca58cb..88dc65b5f2 100644 --- a/samples/ControlCatalog/Pages/TreeViewPage.xaml +++ b/samples/ControlCatalog/Pages/TreeViewPage.xaml @@ -1,6 +1,7 @@ - @@ -32,4 +33,4 @@ - + diff --git a/samples/ControlCatalog/Pages/TreeViewPage.xaml.cs b/samples/ControlCatalog/Pages/TreeViewPage.xaml.cs index c43c2eb49e..d03590febd 100644 --- a/samples/ControlCatalog/Pages/TreeViewPage.xaml.cs +++ b/samples/ControlCatalog/Pages/TreeViewPage.xaml.cs @@ -3,7 +3,7 @@ using ControlCatalog.ViewModels; namespace ControlCatalog.Pages { - public partial class TreeViewPage : UserControl + public partial class TreeViewPage : ContentPage { public TreeViewPage() { diff --git a/samples/ControlCatalog/Pages/ViewboxPage.xaml b/samples/ControlCatalog/Pages/ViewboxPage.xaml index e66655253c..3848e405db 100644 --- a/samples/ControlCatalog/Pages/ViewboxPage.xaml +++ b/samples/ControlCatalog/Pages/ViewboxPage.xaml @@ -1,6 +1,7 @@ - @@ -50,4 +51,4 @@ - + diff --git a/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs b/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs index c140cb9857..f7b1ea3f75 100644 --- a/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ViewboxPage.xaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; namespace ControlCatalog.Pages { - public partial class ViewboxPage : UserControl + public partial class ViewboxPage : ContentPage { public ViewboxPage() { diff --git a/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml b/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml index df84c0bd6b..0017ee09b5 100644 --- a/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml +++ b/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml @@ -1,9 +1,10 @@ - @@ -50,4 +51,4 @@ - + diff --git a/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml.cs b/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml.cs index d62c7ec10f..2ee8677eba 100644 --- a/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml.cs +++ b/samples/ControlCatalog/Pages/WindowCustomizationsPage.xaml.cs @@ -2,7 +2,7 @@ namespace ControlCatalog.Pages { - public partial class WindowCustomizationsPage : UserControl + public partial class WindowCustomizationsPage : ContentPage { public WindowCustomizationsPage() { diff --git a/samples/ControlCatalog/ScrollPage.xaml b/samples/ControlCatalog/ScrollPage.xaml new file mode 100644 index 0000000000..6d5ecb815e --- /dev/null +++ b/samples/ControlCatalog/ScrollPage.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs index ce9209f61a..0d877b253f 100644 --- a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs +++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs @@ -8,7 +8,7 @@ using MiniMvvm; namespace ControlCatalog.ViewModels { - class MainWindowViewModel : ViewModelBase + partial class MainWindowViewModel : ViewModelBase { private WindowState _windowState; private WindowState[] _windowStates = Array.Empty(); @@ -20,6 +20,7 @@ namespace ControlCatalog.ViewModels private bool _canResize; private bool _canMinimize; private bool _canMaximize; + private int _selectedDecorationIndex; public MainWindowViewModel() { @@ -51,6 +52,8 @@ namespace ControlCatalog.ViewModels CanResize = true; CanMinimize = true; CanMaximize = true; + + Filter(); } public bool ExtendClientAreaEnabled @@ -113,6 +116,12 @@ namespace ControlCatalog.ViewModels set { RaiseAndSetIfChanged(ref _canMaximize, value); } } + public int SelectedDecorationIndex + { + get { return _selectedDecorationIndex; } + set { RaiseAndSetIfChanged(ref _selectedDecorationIndex, value); } + } + public MiniCommand AboutCommand { get; } diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel_PageList.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel_PageList.cs new file mode 100644 index 0000000000..4c85f64765 --- /dev/null +++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel_PageList.cs @@ -0,0 +1,196 @@ +using Avalonia.Controls; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Dialogs; +using System; +using System.ComponentModel.DataAnnotations; +using Avalonia; +using MiniMvvm; +using Avalonia.Collections; +using ControlCatalog.Pages; +using System.Threading.Tasks; +using System.Collections.Generic; +using System.Linq; + +namespace ControlCatalog.ViewModels +{ + partial class MainWindowViewModel + { + private int _selectedPageIndex; + private bool _isDrawerOpened = true; + private bool _ignoreListChange = false; + private string? _query = ""; + private PageItem? _currentItem; + private SplitViewDisplayMode _displayMode; + + private List _items = new() + { + new PageItem("Composition", () => new CompositionPage(), Icons.Layers), + new PageItem("Accelerator", () => new AcceleratorPage(), Icons.Keyboard), + new PageItem("Acrylic", () => new AcrylicPage(), Icons.Blur), + new PageItem("AdornerLayer", () => new AdornerLayerPage(), Icons.Sparkle), + new PageItem("AutoCompleteBox",() => new AutoCompleteBoxPage(), Icons.TextInput), + new PageItem("Border",() => new BorderPage(), Icons.Border), + new PageItem("BitmapCache",() => new BitmapCachePage(), Icons.Lightning), + new PageItem("Buttons",() => new ButtonsPage(), Icons.CursorClick), + new PageItem("ButtonSpinner",() => new ButtonSpinnerPage(), Icons.Spinner), + new PageItem("Calendar",() => new CalendarPage(), Icons.Calendar), + new PageItem("Canvas",() => new CanvasPage(), Icons.Canvas), + new PageItem("CommandBar",() => new CommandBarPage(), Icons.Terminal), + new PageItem("Carousel",() => new Pages.CarouselPage(), Icons.Slides), + new PageItem("CarouselPage",() => new CarouselDemoPage(), Icons.Slides), + new PageItem("CheckBox",() => new CheckBoxPage(), Icons.Checkbox), + new PageItem("Clipboard",() => new ClipboardPage(), Icons.Clipboard), + new PageItem("ColorPicker",() => new ColorPickerPage(), Icons.Palette), + new PageItem("ComboBox",() => new ComboBoxPage(), Icons.Dropdown), + new PageItem("Container Queries",() => new ContainerQueryPage(), Icons.Container), + new PageItem("ContentPage",() => new ContentDemoPage(), Icons.Document), + new PageItem("ContextFlyout",() => new ContextFlyoutPage(), Icons.Menu), + new PageItem("ContextMenu",() => new ContextMenuPage(), Icons.Menu), + new PageItem("Cursor",() => new CursorPage(), Icons.Cursor), + new PageItem("Custom Drawing",() => new CustomDrawing(), Icons.Brush), + new PageItem("DataGrid",() => new DataGridPage(), Icons.Grid), + new PageItem("Data Validation",() => new DataValidationPage(), Icons.Shield), + new PageItem("Date/Time Picker",() => new DateTimePickerPage(), Icons.Clock), + new PageItem("CalendarDatePicker",() => new CalendarDatePickerPage(), Icons.Calendar), + new PageItem("Dialogs",() => new DialogsPage(), Icons.Dialog), + new PageItem("Drag+Drop",() => new DragAndDropPage(), Icons.DragDrop), + new PageItem("DrawerPage",() => new DrawerDemoPage(), Icons.Drawer), + new PageItem("Expander",() => new ExpanderPage(), Icons.Expand), + new PageItem("Flyouts",() => new FlyoutsPage(), Icons.Flyout), + new PageItem("Focus",() => new FocusPage(), Icons.Target), + new PageItem("Gestures",() => new GesturePage(), Icons.Gesture), + new PageItem("Image",() => new ImagePage(), Icons.Image), + new PageItem("Label",() => new LabelsPage(), Icons.Tag), + new PageItem("LayoutTransformControl",() => new LayoutTransformControlPage(), Icons.Transform), + new PageItem("ListBox",() => new ListBoxPage(), Icons.List), + new PageItem("Menu",() => new MenuPage(), Icons.Menu), + new PageItem("NavigationPage",() => new NavigationDemoPage(), Icons.Navigation), + new PageItem("Notifications",() => new NotificationsPage(), Icons.Bell), + new PageItem("NumericUpDown",() => new NumericUpDownPage(), Icons.Number), + new PageItem("OpenGL",() => new OpenGlPage(), Icons.Cube3D), + new PageItem("OpenGL Lease",() => new OpenGlLeasePage(), Icons.Cube3D), + new PageItem("PipsPager",() => new PipsPagerPage(), Icons.HorizontalDots), + new PageItem("Platform Information",() => new PlatformInfoPage(), Icons.Info), + new PageItem("Pointers",() => new PointersPage(), Icons.Cursor), + new PageItem("ProgressBar",() => new ProgressBarPage(), Icons.Progress), + new PageItem("RadioButton",() => new RadioButtonPage(), Icons.Radio), + new PageItem("RefreshContainer",() => new RefreshContainerPage(), Icons.Refresh), + new PageItem("RelativePanel",() => new RelativePanelPage(), Icons.Layout), + new PageItem("ScrollViewer",() => new ScrollViewerPage(), Icons.Scroll), + new PageItem("Slider",() => new SliderPage(), Icons.Tune), + new PageItem("SplitView",() => new SplitViewPage(), Icons.Split), + new PageItem("TabbedPage",() => new TabbedDemoPage(), Icons.Tab), + new PageItem("TabControl",() => new TabControlPage(), Icons.Tab), + new PageItem("TabStrip",() => new TabStripPage(), Icons.Tab), + new PageItem("TextBox",() => new TextBoxPage(), Icons.TextInput), + new PageItem("TextBlock",() => new TextBlockPage(), Icons.TextInput), + new PageItem("Theme Variants",() => new ThemePage(), Icons.Theme), + new PageItem("ToggleSwitch",() => new ToggleSwitchPage(), Icons.Toggle), + new PageItem("ToolTip",() => new ToolTipPage(), Icons.Tooltip), + new PageItem("TransitioningContentControl",() => new TransitioningContentControlPage(), Icons.Transition), + new PageItem("TreeView",() => new TreeViewPage(), Icons.Tree), + new PageItem("Viewbox",() => new ViewboxPage(), Icons.Viewbox), + new PageItem("Native Embed",() => new NativeEmbedPage(), Icons.Puzzle), + new PageItem("Window Customizations",() => new WindowCustomizationsPage(), Icons.Window), + new PageItem("HeaderedContentControl",() => new HeaderedContentPage(), Icons.Header), + new PageItem("Screens",() => new ScreenPage(), Icons.Monitor), + }; + + public AvaloniaList Pages { get; } = new AvaloniaList(); + + public void Filter(string? query = "") + { + try + { + _ignoreListChange = true; + Pages.Clear(); + + if (!string.IsNullOrWhiteSpace(query)) + Pages.AddRange(_items.Where(x => x.Header.Contains(query))); + else + Pages.AddRange(_items); + } + finally + { + _ignoreListChange = false; + if (_currentItem != null) + { + var newIndex = Pages.IndexOf(_currentItem); + if (newIndex != -1) + { + SelectedPageIndex = newIndex; + } + } + } + } + + public INavigation? Navigator { get; internal set; } + + public int SelectedPageIndex + { + get { return _selectedPageIndex; } + set + { + RaiseAndSetIfChanged(ref _selectedPageIndex, value); + + if (!_ignoreListChange) + { + NavigateTo(_selectedPageIndex); + + if (DisplayMode == SplitViewDisplayMode.CompactOverlay || DisplayMode == SplitViewDisplayMode.Overlay) + IsDrawerOpened = false; + } + } + } + + public bool IsDrawerOpened + { + get { return _isDrawerOpened; } + set { RaiseAndSetIfChanged(ref _isDrawerOpened, value); } + } + + public SplitViewDisplayMode DisplayMode + { + get { return _displayMode; } + set { RaiseAndSetIfChanged(ref _displayMode, value); } + } + + public string? Query + { + get { return _query; } + set + { + RaiseAndSetIfChanged(ref _query, value); + + Filter(value); + } + } + + private async void NavigateTo(int pageIndex) + { + if (pageIndex < 0 || pageIndex >= Pages.Count || Navigator is null) + return; + + var item = Pages[pageIndex]; + + if (item != null) + { + var view = item.Factory(); + if (view is Page page && view.GetType() != Navigator.NavigationStack.LastOrDefault()?.GetType()) + { + _currentItem = item; + await Navigator.ReplaceAsync(page); + } + } + } + } + + class PageItem(string header, Func factory, string? iconData = null) + { + public string Header { get; } = header; + public Func Factory { get; } = factory; + public string? IconData { get; } = iconData; + + public bool IsVisible { get; set; } = true; + } +} diff --git a/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml b/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml index d9b3e3c73f..b4d9900617 100644 --- a/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml +++ b/samples/SampleControls/HamburgerMenu/HamburgerMenu.xaml @@ -33,8 +33,8 @@ #FFFFFFFF #FFF2F2F2 - - + + 40 220 36 @@ -134,14 +134,14 @@ - +