├── .avalonia └── AvaloniaPreviewer.target ├── .editorconfig ├── .gitignore ├── .vscode └── settings.json ├── AntDesign.Avalonia.sln ├── Build ├── Directory.Packages.targets ├── Directory.build.common.props └── Directory.build.common.targets ├── Directory.Build.props ├── Directory.Packages.props ├── Directory.build.targets ├── Directory.buildcpp.props ├── LICENSE.md ├── Nuget.bat ├── Packages ├── AntDesign.Avalonia │ ├── AntDesign.Avalonia.csproj │ └── Config.Numerge.json └── Logo │ └── antdesign@avalonia-logo.png ├── README.md ├── Source ├── AntDesign.ColorPicker │ ├── Accents │ │ ├── AntDesignAccents.axaml │ │ ├── AntDesignCGeometry.axaml │ │ ├── AntDesignDark.axaml │ │ └── AntDesignLight.axaml │ ├── AntDesign.ColorPicker.csproj │ ├── AntDesignColorPicker.axaml │ ├── AntDesignColorPicker.axaml.cs │ ├── Assists │ │ ├── ColorSliderAssists.cs │ │ └── ColorViewAssists.cs │ ├── Converters │ │ └── RadioButtonStyleConverter.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── _globalusing.cs │ └── Styles │ │ ├── AntDesignControls.axaml │ │ ├── ColorPicker.axaml │ │ ├── ColorPickerShared.axaml │ │ ├── ColorPreviewer.axaml │ │ ├── ColorSlider.axaml │ │ ├── ColorSpectrum.axaml │ │ └── ColorView.axaml ├── AntDesign.Controls │ ├── AntDesign.Controls.csproj │ ├── ProgressBarButton.cs │ ├── Properties │ │ └── _globalusing.cs │ └── Storage │ │ └── StorageProviderHelpers.cs ├── AntDesign.DataGrid │ ├── Accents │ │ ├── AntDesignAccents.axaml │ │ ├── AntDesignDark.axaml │ │ └── AntDesignLight.axaml │ ├── AntDesign.DataGrid.csproj │ ├── AntDesignDataGrid.axaml │ ├── AntDesignDataGrid.axaml.cs │ ├── Assists │ │ └── DataGridCellAssists.cs │ ├── Converters │ │ ├── CornerRadiusFiltersConverter.cs │ │ ├── GridLine2HeightConverter.cs │ │ └── Margin2MarginConverter.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── _globalusing.cs │ └── Styles │ │ ├── AntDesignControls.axaml │ │ ├── DataGrid.axaml │ │ ├── DataGridCell.axaml │ │ ├── DataGridColumn.axaml │ │ ├── DataGridRow.axaml │ │ └── DataGridStyles.axaml ├── AntDesign.FontManager │ ├── AntDesign.FontManager.csproj │ ├── Assets │ │ └── Fonts │ │ │ └── AliBaba │ │ │ ├── AlibabaPuHuiTi-Black.ttf │ │ │ ├── AlibabaPuHuiTi-Bold.ttf │ │ │ ├── AlibabaPuHuiTi-ExtraBold.ttf │ │ │ ├── AlibabaPuHuiTi-Heavy.ttf │ │ │ ├── AlibabaPuHuiTi-Light.ttf │ │ │ ├── AlibabaPuHuiTi-Medium.ttf │ │ │ ├── AlibabaPuHuiTi-Regular.ttf │ │ │ ├── AlibabaPuHuiTi-SemiBold.ttf │ │ │ └── AlibabaPuHuiTi-Thin.ttf │ ├── AvaloniaAppBuilderExtensions.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── _globalusing.cs │ └── Settings │ │ └── FontSettings.cs ├── AntDesign.Icons │ ├── AntDesign.Icons.csproj │ └── Class1.cs ├── AntDesign.Toolkit │ ├── AntDesign.Toolkit.csproj │ ├── AvaloniaAppBuilderExtensions.cs │ ├── Helpers │ │ └── OperatingSystemEx.cs │ └── Properties │ │ ├── ArgumentNullException.cs │ │ ├── AssemblyInfo.cs │ │ └── _globalusing.cs ├── AntDesign │ ├── Accents │ │ ├── AntDesignAccents.axaml │ │ ├── AntDesignAccents1.axaml │ │ ├── AntDesignColorMatching.axaml │ │ ├── AntDesignConverters.axaml │ │ ├── AntDesignDescriptions.axaml │ │ ├── AntDesignGeometry.axaml │ │ ├── Dark │ │ │ ├── AntDesignCommon.axaml │ │ │ ├── AutoCompleteBox.axaml │ │ │ ├── Button.axaml │ │ │ ├── ButtonSpinner.axaml │ │ │ ├── Calendar.axaml │ │ │ ├── CalendarButton.axaml │ │ │ ├── CalendarDatePicker.axaml │ │ │ ├── CalendarDayButton.axaml │ │ │ ├── CalendarItem.axaml │ │ │ ├── CaptionButtons.axaml │ │ │ ├── CheckBox.axaml │ │ │ ├── ComboBox.axaml │ │ │ ├── ComboBoxItem.axaml │ │ │ ├── ContextMenu.axaml │ │ │ ├── DatePicker.axaml │ │ │ ├── DropDownButton.axaml │ │ │ ├── EmbeddableControlRoot.axaml │ │ │ ├── Expander.axaml │ │ │ ├── FlyoutPresenter.axaml │ │ │ ├── FocusAdorner.axaml │ │ │ ├── GridSplitter.axaml │ │ │ ├── ListBox.axaml │ │ │ ├── ListBoxItem.axaml │ │ │ ├── ManagedFileChooser.axaml │ │ │ ├── Menu.axaml │ │ │ ├── MenuFlyoutPresenter.axaml │ │ │ ├── MenuItem.axaml │ │ │ ├── MenuScrollViewer.axaml │ │ │ ├── NotificationCard.axaml │ │ │ ├── ProgressBar.axaml │ │ │ ├── RadioButton.axaml │ │ │ ├── RefreshVisualizer.axaml │ │ │ ├── RepeatButton.axaml │ │ │ ├── ScrollBar.axaml │ │ │ ├── ScrollViewer.axaml │ │ │ ├── SelectableTextBlock.axaml │ │ │ ├── Separator.axaml │ │ │ ├── Slider.axaml │ │ │ ├── SplitButton.axaml │ │ │ ├── SplitView.axaml │ │ │ ├── Tabs.axaml │ │ │ ├── TextBox.axaml │ │ │ ├── TimePicker.axaml │ │ │ ├── ToggleButton.axaml │ │ │ ├── ToggleSwitch.axaml │ │ │ ├── ToolTip.axaml │ │ │ ├── TreeViewItem.axaml │ │ │ ├── Window.axaml │ │ │ └── _AntDesignDark.axaml │ │ └── Light │ │ │ ├── AntDesignCommon.axaml │ │ │ ├── AutoCompleteBox.axaml │ │ │ ├── Button.axaml │ │ │ ├── ButtonSpinner.axaml │ │ │ ├── Calendar.axaml │ │ │ ├── CalendarButton.axaml │ │ │ ├── CalendarDatePicker.axaml │ │ │ ├── CalendarDayButton.axaml │ │ │ ├── CalendarItem.axaml │ │ │ ├── CaptionButtons.axaml │ │ │ ├── CheckBox.axaml │ │ │ ├── ComboBox.axaml │ │ │ ├── ComboBoxItem.axaml │ │ │ ├── ContextMenu.axaml │ │ │ ├── DatePicker.axaml │ │ │ ├── DropDownButton.axaml │ │ │ ├── EmbeddableControlRoot.axaml │ │ │ ├── Expander.axaml │ │ │ ├── FlyoutPresenter.axaml │ │ │ ├── FocusAdorner.axaml │ │ │ ├── GridSplitter.axaml │ │ │ ├── ListBox.axaml │ │ │ ├── ListBoxItem.axaml │ │ │ ├── ManagedFileChooser.axaml │ │ │ ├── Menu.axaml │ │ │ ├── MenuFlyoutPresenter.axaml │ │ │ ├── MenuItem.axaml │ │ │ ├── MenuScrollViewer.axaml │ │ │ ├── NotificationCard.axaml │ │ │ ├── ProgressBar.axaml │ │ │ ├── RadioButton.axaml │ │ │ ├── RefreshVisualizer.axaml │ │ │ ├── RepeatButton.axaml │ │ │ ├── ScrollBar.axaml │ │ │ ├── ScrollViewer.axaml │ │ │ ├── SelectableTextBlock.axaml │ │ │ ├── Separator.axaml │ │ │ ├── Slider.axaml │ │ │ ├── SplitButton.axaml │ │ │ ├── SplitView.axaml │ │ │ ├── Tabs.axaml │ │ │ ├── TextBox.axaml │ │ │ ├── TimePicker.axaml │ │ │ ├── ToggleButton.axaml │ │ │ ├── ToggleSwitch.axaml │ │ │ ├── ToolTip.axaml │ │ │ ├── TreeViewItem.axaml │ │ │ ├── Window.axaml │ │ │ └── _AntDesignLight.axaml │ ├── AntDesign.axaml │ ├── AntDesign.axaml.cs │ ├── AntDesign.csproj │ ├── AntDesignColorPalette.Property.cs │ ├── AntDesignColorPalette.cs │ ├── AntDesignColorPaletteCollection.cs │ ├── Assists │ │ ├── AutoCompleteBoxAssists.cs │ │ ├── ButtonAssists.cs │ │ ├── ButtonSpinnerAssists.cs │ │ ├── CalendarButtonAssists.cs │ │ ├── CalendarDatePickerAssists.cs │ │ ├── CarouselAssists.cs │ │ ├── CheckBoxAssists.cs │ │ ├── ComboBoxAssists.cs │ │ ├── ControlAssists.cs │ │ ├── ExpanderAssists.cs │ │ ├── ListBoxItemAssists.cs │ │ ├── MenuItemAssists.cs │ │ ├── ProgressBarAssists.cs │ │ ├── SeparatorAssists.cs │ │ ├── SliderAssists.cs │ │ ├── SplitButtonAssists.cs │ │ ├── TextBoxAssists.cs │ │ ├── ToggleButtonAssists.cs │ │ ├── ToggleSwitchAssists.cs │ │ ├── TreeViewAssists.cs │ │ └── TreeViewItemAssists.cs │ ├── Behaviors │ │ ├── AttachableCollection.cs │ │ ├── Behavior.cs │ │ ├── Behavior@T.cs │ │ ├── IAttachedObject.cs │ │ ├── Interaction.cs │ │ ├── MenuItemBehaviors.cs │ │ ├── Multiplexer.cs │ │ ├── PointerBehavior.cs │ │ └── ToggleSwitchBehaviors.cs │ ├── Colours.cs │ ├── Controls │ │ └── Ripple │ │ │ ├── RippleEffect.cs │ │ │ ├── RippleEffectAx.cs │ │ │ ├── RippleEffectZx.cs │ │ │ └── RippleEffectx.cs │ ├── Converters │ │ ├── AutoSizeConverter.cs │ │ ├── BorderOffsetMarginConverter.cs │ │ ├── BorderThicknessFilterConverter.cs │ │ ├── Bounds2SizeConverter.cs │ │ ├── BoundsBorderThickness2SizeConverter.cs │ │ ├── ColorToBrushConverter.cs │ │ ├── Double2MarginConverters.cs │ │ ├── Height2CornerRadiusConverter.cs │ │ ├── IBitmapToImageConverter.cs │ │ ├── Items2ObjectsConverter.cs │ │ ├── MarginMultipliersConverter.cs │ │ ├── PopupHorizontalOffsetConverter.cs │ │ ├── PopupSizeConverter.cs │ │ ├── Size2RoundConverter.cs │ │ ├── Size2SizeConverters.cs │ │ └── Thickness2MarginConverter.cs │ ├── Enums │ │ ├── AntStatus.cs │ │ ├── BorderEdges.cs │ │ └── Direction.cs │ ├── Extensions │ │ └── Classes.cs │ ├── Helpers │ │ └── PARTNameHelper.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── _globalusing.cs │ └── Styles │ │ ├── AntDesignControls.axaml │ │ ├── AutoCompleteBox.axaml │ │ ├── Button.axaml │ │ ├── ButtonSpinner.axaml │ │ ├── Calendar.axaml │ │ ├── CalendarButton.axaml │ │ ├── CalendarDatePicker.axaml │ │ ├── CalendarDayButton.axaml │ │ ├── CalendarItem.axaml │ │ ├── CaptionButtons.axaml │ │ ├── Carousel.axaml │ │ ├── CheckBox.axaml │ │ ├── ComboBox.axaml │ │ ├── ComboBoxItem.axaml │ │ ├── ContentControl.axaml │ │ ├── ContextMenu.axaml │ │ ├── DataValidationErrors.axaml │ │ ├── DatePicker.axaml │ │ ├── DateTimePickerShared.axaml │ │ ├── DropDownButton.axaml │ │ ├── EmbeddableControlRoot.axaml │ │ ├── Expander.axaml │ │ ├── FlyoutPresenter.axaml │ │ ├── FocusAdorner.axaml │ │ ├── GridSplitter.axaml │ │ ├── ItemsControl.axaml │ │ ├── Label.axaml │ │ ├── ListBox.axaml │ │ ├── ListBoxItem.axaml │ │ ├── ManagedFileChooser.axaml │ │ ├── Menu.axaml │ │ ├── MenuFlyoutPresenter.axaml │ │ ├── MenuItem.axaml │ │ ├── MenuScrollViewer.axaml │ │ ├── NativeMenuBar.axaml │ │ ├── NotificationCard.axaml │ │ ├── NumericUpDown.axaml │ │ ├── OverlayPopupHost.axaml │ │ ├── PathIcon.axaml │ │ ├── PopupRoot.axaml │ │ ├── ProgressBar.axaml │ │ ├── RadioButton.axaml │ │ ├── RefreshContainer.axaml │ │ ├── RefreshVisualizer.axaml │ │ ├── RepeatButton.axaml │ │ ├── ScrollBar.axaml │ │ ├── ScrollViewer.axaml │ │ ├── SelectableTextBlock.axaml │ │ ├── Separator.axaml │ │ ├── Slider.axaml │ │ ├── SplitButton.axaml │ │ ├── SplitView.axaml │ │ ├── TabControl.axaml │ │ ├── TabItem.axaml │ │ ├── TabStrip.axaml │ │ ├── TabStripItem.axaml │ │ ├── TexBlock.axaml │ │ ├── TextBox.axaml │ │ ├── ThemeVariantScope.axaml │ │ ├── TimePicker.axaml │ │ ├── TitleBar.axaml │ │ ├── ToggleButton.axaml │ │ ├── ToggleSwitch.axaml │ │ ├── ToolTip.axaml │ │ ├── TransitioningContentControl.axaml │ │ ├── TreeView.axaml │ │ ├── TreeViewItem.axaml │ │ ├── UserControl.axaml │ │ ├── Window.axaml │ │ └── WindowNotificationManager.axaml ├── Avalonia.ReactiveUI.Toolkit │ ├── Assists │ │ └── RoutedViewHostAssists.cs │ ├── Avalonia.ReactiveUI.Toolkit.csproj │ ├── Class1.cs │ ├── Properties │ │ └── _globalusing.cs │ ├── ReactiveObjects │ │ ├── ReactiveObject@.cs │ │ ├── ReactiveObjectBase.cs │ │ ├── ViewModelBase.cs │ │ ├── ViewModelRoutableBase.cs │ │ └── ViewModelRoutableBase@.cs │ └── Routers │ │ ├── IRoutingViewLocator.cs │ │ ├── IRoutingViewLocatorManager.cs │ │ └── LocalizedString.cs ├── Avalonia.SourceGenerator │ ├── Avalonia.SourceGenerator.csproj │ └── Class1.cs └── Samples │ ├── AntDesign.Sample.Android │ ├── AntDesign.Sample.Android.csproj │ ├── Icon.png │ ├── MainActivity.cs │ ├── Properties │ │ └── AndroidManifest.xml │ ├── Resources │ │ ├── drawable │ │ │ └── splash_screen.xml │ │ └── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ ├── environment.device.txt │ └── environment.emulator.txt │ ├── AntDesign.Sample.Browser.Blazor │ ├── AntDesign.Sample.Browser.Blazor.csproj │ ├── App.razor │ ├── App.razor.cs │ ├── Pages │ │ └── Index.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Shared │ │ └── MainLayout.razor │ ├── _Imports.razor │ └── wwwroot │ │ ├── css │ │ └── app.css │ │ ├── favicon.ico │ │ └── index.html │ ├── AntDesign.Sample.Desktop │ ├── AntDesign.Sample.Desktop.csproj │ ├── Program.cs │ ├── Properties │ │ ├── launchSettings.json │ │ └── rd.xml │ └── app.manifest │ ├── AntDesign.Sample.DesktopDrm │ ├── AntDesign.Sample.DesktopDrm.csproj │ ├── Program.cs │ └── app.manifest │ ├── AntDesign.Sample.Shared │ ├── AntDesign - Backup.Sample.Shared.csproj │ ├── AntDesign.Sample.Shared.csproj │ ├── App.axaml │ ├── App.axaml.cs │ ├── Assets │ │ ├── Images │ │ │ └── antdesign-painting.jpg │ │ ├── Styles │ │ │ └── AntDesignSampleGeometry.axaml │ │ ├── antdesign-logo.svg │ │ ├── antdesign@avalonia-logo.png │ │ └── avalonia-logo.ico │ ├── Assists │ │ └── RoutedViewHostAssists.cs │ ├── Converters │ │ ├── DataGridRowAlternatingRowColorConverter.cs │ │ └── DataGridRowIndexConverter.cs │ ├── Extensions │ │ └── IServiceCollectionExtensions.cs │ ├── Models │ │ ├── AutoCompletionModel.cs │ │ └── Person.cs │ ├── Properties │ │ ├── _globalusing.cs │ │ └── rd.xml │ ├── Routers │ │ ├── IMainRoutingViewLocator.cs │ │ ├── MainRoutingViewLocator.cs │ │ ├── Router.cs │ │ └── RouterChangedEventArgs.cs │ ├── Services │ │ ├── IThemeService.cs │ │ └── ThemeService.cs │ ├── ViewModels │ │ ├── AutoCompleteViewModel.cs │ │ ├── ButtonSpinnerViewModel.cs │ │ ├── ButtonViewModel.cs │ │ ├── CalendarDatePickerViewModel.cs │ │ ├── CalendarViewModel.cs │ │ ├── CarouselViewModel.cs │ │ ├── CheckBoxViewModel.cs │ │ ├── CollapseViewModel.cs │ │ ├── ColorPickerViewModel.cs │ │ ├── ComboBoxViewModel.cs │ │ ├── DataGridViewModel.cs │ │ ├── DatePickerViewModel.cs │ │ ├── DialogsViewModel.cs │ │ ├── DropDownButtonViewModel.cs │ │ ├── InputViewModel.cs │ │ ├── ListBoxViewModel.cs │ │ ├── MainViewModel.cs │ │ ├── MenuViewModel.cs │ │ ├── NumericUpDownViewModel.cs │ │ ├── OverviewViewModel.cs │ │ ├── ProgressBarViewModel.cs │ │ ├── RadioButtonViewModel.cs │ │ ├── RepeatButtonViewModel.cs │ │ ├── SliderViewModel.cs │ │ ├── SplitButtonViewModel.cs │ │ ├── TabStripViewModel.cs │ │ ├── TabsViewModel.cs │ │ ├── TextViewModel.cs │ │ ├── TimePickerViewModel.cs │ │ ├── ToggleButtonViewModel.cs │ │ ├── ToggleSplitButtonViewModel.cs │ │ ├── ToggleSwitchViewModel.cs │ │ └── TreesViewModel.cs │ └── Views │ │ ├── AutoCompleteView.axaml │ │ ├── AutoCompleteView.axaml.cs │ │ ├── ButtonSpinnerView.axaml │ │ ├── ButtonSpinnerView.axaml.cs │ │ ├── ButtonView.axaml │ │ ├── ButtonView.axaml.cs │ │ ├── CalendarDatePickerView.axaml │ │ ├── CalendarDatePickerView.axaml.cs │ │ ├── CalendarView.axaml │ │ ├── CalendarView.axaml.cs │ │ ├── CarouselView.axaml │ │ ├── CarouselView.axaml.cs │ │ ├── CheckBoxView.axaml │ │ ├── CheckBoxView.axaml.cs │ │ ├── CollapseView.axaml │ │ ├── CollapseView.axaml.cs │ │ ├── ColorPickerView.axaml │ │ ├── ColorPickerView.axaml.cs │ │ ├── ColorPickerViewEx.axaml │ │ ├── ColorPickerViewEx.axaml.cs │ │ ├── ComboBoxView.axaml │ │ ├── ComboBoxView.axaml.cs │ │ ├── DataGridView.axaml │ │ ├── DataGridView.axaml.cs │ │ ├── DatePickerView.axaml │ │ ├── DatePickerView.axaml.cs │ │ ├── DialogsView.axaml │ │ ├── DialogsView.axaml.cs │ │ ├── DropDownButtonView.axaml │ │ ├── DropDownButtonView.axaml.cs │ │ ├── InputView.axaml │ │ ├── InputView.axaml.cs │ │ ├── ListBoxView.axaml │ │ ├── ListBoxView.axaml.cs │ │ ├── MainView.axaml │ │ ├── MainView.axaml.cs │ │ ├── MainWindow.axaml │ │ ├── MainWindow.axaml.cs │ │ ├── MenuView.axaml │ │ ├── MenuView.axaml.cs │ │ ├── NumericUpDownView.axaml │ │ ├── NumericUpDownView.axaml.cs │ │ ├── OverviewView.axaml │ │ ├── OverviewView.axaml.cs │ │ ├── ProgressBarView.axaml │ │ ├── ProgressBarView.axaml.cs │ │ ├── RadioButtonView.axaml │ │ ├── RadioButtonView.axaml.cs │ │ ├── RepeatButtonView.axaml │ │ ├── RepeatButtonView.axaml.cs │ │ ├── SliderView.axaml │ │ ├── SliderView.axaml.cs │ │ ├── SplitButtonView.axaml │ │ ├── SplitButtonView.axaml.cs │ │ ├── SwitchView.axaml │ │ ├── SwitchView.axaml.cs │ │ ├── TabStripView.axaml │ │ ├── TabStripView.axaml.cs │ │ ├── TabsView.axaml │ │ ├── TabsView.axaml.cs │ │ ├── TextView.axaml │ │ ├── TextView.axaml.cs │ │ ├── TimePickerView.axaml │ │ ├── TimePickerView.axaml.cs │ │ ├── ToggleButtonView.axaml │ │ ├── ToggleButtonView.axaml.cs │ │ ├── ToggleSplitButtonView.axaml │ │ ├── ToggleSplitButtonView.axaml.cs │ │ ├── ToggleSwitchView.axaml │ │ ├── ToggleSwitchView.axaml.cs │ │ ├── TreesView.axaml │ │ └── TreesView.axaml.cs │ ├── AntDesign.Sample.Web │ ├── AntDesign.Sample.Web.csproj │ ├── AppBundle │ │ ├── Logo.svg │ │ ├── app.css │ │ ├── favicon.ico │ │ ├── index.html │ │ └── main.js │ ├── Program.cs │ ├── Properties │ │ ├── launchSettings.json │ │ └── rd.xml │ └── runtimeconfig.template.json │ └── AntDesign.Sample.iOS │ ├── AntDesign.Sample.iOS.csproj │ ├── AppDelegate.cs │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ └── Resources │ └── LaunchScreen.xib └── global.json /.avalonia/AvaloniaPreviewer.target: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 8 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dotnet.defaultSolution": "AntDesign.Avalonia.sln", 3 | "window.zoomLevel": 1,// 左侧菜单栏的字体大小 4 | "editor.mouseWheelZoom": true,// 按住ctrl可以设置代码的字体大小 5 | "git.autofetch": true, 6 | "files.autoSave": "onFocusChange", 7 | "json.schemas": [ 8 | 9 | 10 | ], 11 | "editor.fontSize": 14, 12 | "editor.fontWeight": "normal", 13 | "editor.fontFamily": "Consolas, 'Courier New', monospace,‘Cascadia Code’", 14 | "cmake.configureOnOpen": false 15 | } -------------------------------------------------------------------------------- /Build/Directory.Packages.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 11.0.0.1 5 | $(RepositoryDirectory)nuget\ 6 | 11.0.0avalonia11.0.0 7 | AvaloniaDeveloper 8 | AvaloniaDeveloperOrg 9 | This repository is a set of styles that will help you customize your application in an appropriate ant-design. 10 | antdesign@avalonia-logo.png 11 | avalonia xaml ant design theme colour color ui ux ant-design alibaba-ant-design 12 | https://github.com/AvaloniaDeveloperOrg/AntDesign.Avalonia 13 | https://github.com/AvaloniaDeveloperOrg/AntDesign.Avalonia 14 | git 15 | 1.0.0.0 16 | True 17 | MIT 18 | README.md 19 | $(AntDesignVersion) 20 | $(AntDesignPackageOutputPath) 21 | 22 | -------------------------------------------------------------------------------- /Build/Directory.build.common.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | NETSTANDARD2_1_OR_GREATER 7 | 8 | 9 | 10 | 11 | true 12 | true 13 | 14 | 15 | -------------------------------------------------------------------------------- /Directory.build.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Directory.buildcpp.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $(SolutionDir).vs\$(SolutionName)\Intermediate\$(PlatformTarget)\$(ProjectName)\$(Configuration)\ 7 | $(SolutionDir)Binary\Modules\ 8 | 9 | 10 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 ChisterWu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Nuget.bat: -------------------------------------------------------------------------------- 1 | echo a = %1 2 | echo b = %2 3 | 4 | dotnet nuget push nuget\AntDesign.Avalonia.%1.nupkg --api-key %2 --source https://api.nuget.org/v3/index.json 5 | dotnet nuget push nuget\AntDesign.Style.%1.nupkg --api-key %2 --source https://api.nuget.org/v3/index.json 6 | dotnet nuget push nuget\AntDesign.ColorPicker.%1.nupkg --api-key %2 --source https://api.nuget.org/v3/index.json 7 | dotnet nuget push nuget\AntDesign.DataGrid.%1.nupkg --api-key %2 --source https://api.nuget.org/v3/index.json 8 | dotnet nuget push nuget\AntDesign.Toolkit.%1.nupkg --api-key %2 --source https://api.nuget.org/v3/index.json -------------------------------------------------------------------------------- /Packages/AntDesign.Avalonia/AntDesign.Avalonia.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0;net6.0;net5.0;netstandard2.0 5 | $(RepositoryDirectory)antdesign\ 6 | 7 | 8 | 9 | 10 | AntDesign.Avalonia 11 | AntDesign.Avalonia 12 | 13 | 14 | 15 | 16 | 17 | 18 | True 19 | \ 20 | 21 | 22 | True 23 | \ 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Packages/AntDesign.Avalonia/Config.Numerge.json: -------------------------------------------------------------------------------- 1 | { 2 | "Packages": 3 | [ 4 | { 5 | "Id": "AntDesign.Avalonia", 6 | "MergeAll": true, 7 | "Merge": [ 8 | { 9 | "Id": "AntDesign.Style", 10 | "IgnoreMissingFrameworkBinaries": true, 11 | "IgnoreMissingFrameworkDependencies": true 12 | }, 13 | { 14 | "Id": "AntDesign.ColorPicker", 15 | "IgnoreMissingFrameworkBinaries": true, 16 | "IgnoreMissingFrameworkDependencies": true 17 | }, 18 | { 19 | "Id": "AntDesign.DataGrid", 20 | "IgnoreMissingFrameworkBinaries": true, 21 | "IgnoreMissingFrameworkDependencies": true 22 | }, 23 | { 24 | "Id": "Avalonia.Toolkit", 25 | "IgnoreMissingFrameworkBinaries": true, 26 | "IgnoreMissingFrameworkDependencies": true 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /Packages/Logo/antdesign@avalonia-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Packages/Logo/antdesign@avalonia-logo.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/README.md -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/AntDesign.ColorPicker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | true 6 | AntDesign 7 | 8 | 9 | 10 | AntDesign.ColorPicker 11 | AntDesign.ColorPicker 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | True 30 | \ 31 | 32 | 33 | True 34 | \ 35 | 36 | 37 | 38 | 39 | 40 | 41 | all 42 | build; analyzers 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/AntDesignColorPicker.axaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/AntDesignColorPicker.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign; 2 | public partial class AntDesignColorPicker : Styles 3 | { 4 | public AntDesignColorPicker(IServiceProvider? serviceProvider = default) 5 | { 6 | AvaloniaXamlLoader.Load(serviceProvider, this); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/Assists/ColorSliderAssists.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Assists; 2 | public class ColorSliderAssists 3 | { 4 | public static readonly AvaloniaProperty ThumbBoxShadowProperty = AvaloniaProperty.RegisterAttached("ThumbBoxShadow", typeof(ColorSliderAssists)); 5 | public static void SetThumbBoxShadow(AvaloniaObject dependencyObject, BoxShadows value) => dependencyObject.SetValue(ThumbBoxShadowProperty, value); 6 | public static BoxShadows GetThumbBoxShadow(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ThumbBoxShadowProperty); 7 | 8 | public static readonly AvaloniaProperty BoxShadowProperty = AvaloniaProperty.RegisterAttached("BoxShadow", typeof(ColorSliderAssists)); 9 | public static void SetBoxShadow(AvaloniaObject dependencyObject, BoxShadows value) => dependencyObject.SetValue(BoxShadowProperty, value); 10 | public static BoxShadows GetBoxShadow(AvaloniaObject dependencyObject) => dependencyObject.GetValue(BoxShadowProperty); 11 | } 12 | -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/Assists/ColorViewAssists.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | 3 | namespace AntDesign.Assists; 4 | public class ColorViewAssists 5 | { 6 | public static readonly AvaloniaProperty RadioButtonStyleProperty = AvaloniaProperty.RegisterAttached("RadioButtonStyle", typeof(ColorViewAssists)); 7 | public static void SetRadioButtonStyle(AvaloniaObject dependencyObject, ControlTheme? value) => dependencyObject.SetValue(RadioButtonStyleProperty, value); 8 | public static ControlTheme? GetRadioButtonStyle(AvaloniaObject dependencyObject) => dependencyObject.GetValue(RadioButtonStyleProperty); 9 | } 10 | -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/Converters/RadioButtonStyleConverter.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Data.Converters; 3 | using Avalonia.Markup.Xaml.XamlIl.Runtime; 4 | using System.Globalization; 5 | 6 | namespace AntDesign.Converters; 7 | internal class RadioButtonStyleConverter : IValueConverter 8 | { 9 | object? IValueConverter.Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 10 | { 11 | if (value == null && parameter is not null) 12 | return parameter; 13 | 14 | return value; 15 | } 16 | 17 | object? IValueConverter.ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Metadata; 2 | 3 | [assembly: XmlnsPrefix("https://github.com/avaloniaui", nameof(AntDesign))] 4 | [assembly: XmlnsDefinition("https://github.com/avaloniaui", nameof(AntDesign))] 5 | [assembly: XmlnsDefinition("https://github.com/avaloniaui", $"{nameof(AntDesign)}.{nameof(AntDesign.Assists)}")] 6 | 7 | [assembly: XmlnsPrefix("https://ant.design.com/avalonia", nameof(AntDesign))] 8 | [assembly: XmlnsDefinition("https://ant.design.com/avalonia", nameof(AntDesign))] 9 | [assembly: XmlnsDefinition("https://ant.design.com/avalonia", $"{nameof(AntDesign)}.{nameof(AntDesign.Assists)}")] -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 | global using Avalonia; 2 | global using Avalonia.Controls.Primitives; 3 | global using Avalonia.Markup.Xaml; 4 | global using Avalonia.Media; 5 | global using Avalonia.Styling; 6 | -------------------------------------------------------------------------------- /Source/AntDesign.ColorPicker/Styles/AntDesignControls.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/AntDesign.Controls/AntDesign.Controls.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | all 11 | build; analyzers 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Source/AntDesign.Controls/ProgressBarButton.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Controls; 2 | public class ProgressBarButton : Button 3 | { 4 | public ProgressBarButton() 5 | { 6 | 7 | } 8 | 9 | protected override Type StyleKeyOverride => base.StyleKeyOverride; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Source/AntDesign.Controls/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 | global using AntDesign.Controls.Storage; 2 | global using Avalonia; 3 | global using Avalonia.Controls; 4 | global using Avalonia.Dialogs; 5 | global using Avalonia.Dialogs.Internal; 6 | global using Avalonia.Layout; 7 | global using Avalonia.Platform.Storage; 8 | global using System.Runtime.InteropServices; 9 | global using System.Security; 10 | global using System.Text; 11 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Accents/AntDesignAccents.axaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 8 | 45 9 | 35 10 | 11 | Bold 12 | 12,0,0,0 13 | 0 14 | 15 | 1 16 | 10,10,0,0 17 | 16 18 | 19 | 8 20 | 21 | 0.4 22 | 23 | 4 24 | 0 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/AntDesign.DataGrid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | true 6 | AntDesign 7 | 8 | 9 | 10 | AntDesign.DataGrid 11 | AntDesign.DataGrid 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | True 30 | \ 31 | 32 | 33 | True 34 | \ 35 | 36 | 37 | 38 | 39 | 40 | 41 | all 42 | build; analyzers 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/AntDesignDataGrid.axaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/AntDesignDataGrid.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign; 2 | public partial class AntDesignDataGrid : Styles 3 | { 4 | public AntDesignDataGrid(IServiceProvider? serviceProvider = default) 5 | { 6 | AvaloniaXamlLoader.Load(serviceProvider, this); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Converters/CornerRadiusFiltersConverter.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls.Converters; 2 | 3 | namespace AntDesign.Converters; 4 | 5 | public class CornerRadiusFiltersConverter : IMultiValueConverter 6 | { 7 | public Corners Filter { get; set; } 8 | 9 | public double Scale { get; set; } = 1.0; 10 | 11 | public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture) 12 | { 13 | if (values.Count < 2) 14 | return AvaloniaProperty.UnsetValue; 15 | 16 | if (values[0] is not CornerRadius cornerRadius) 17 | return AvaloniaProperty.UnsetValue; 18 | 19 | double.TryParse(values[1]?.ToString(), out var width); 20 | 21 | if (width > 0) 22 | return new CornerRadius(0.0, Filter.HasFlag(Corners.TopRight) ? (cornerRadius.TopRight * Scale) : 0.0, Filter.HasFlag(Corners.BottomRight) ? (cornerRadius.BottomRight * Scale) : 0.0, Filter.HasFlag(Corners.BottomLeft) ? (cornerRadius.BottomLeft * Scale) : 0.0); 23 | else 24 | return new CornerRadius(Filter.HasFlag(Corners.TopLeft) ? (cornerRadius.TopLeft * Scale) : 0.0, Filter.HasFlag(Corners.TopRight) ? (cornerRadius.TopRight * Scale) : 0.0, Filter.HasFlag(Corners.BottomRight) ? (cornerRadius.BottomRight * Scale) : 0.0, Filter.HasFlag(Corners.BottomLeft) ? (cornerRadius.BottomLeft * Scale) : 0.0); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Converters/GridLine2HeightConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class GridLine2HeightConverter : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (Enum.TryParse(value?.ToString(), out var gridLine)) 7 | { 8 | switch (gridLine) 9 | { 10 | case DataGridGridLinesVisibility.Vertical: 11 | case DataGridGridLinesVisibility.All: 12 | return double.NaN; 13 | case DataGridGridLinesVisibility.None: 14 | case DataGridGridLinesVisibility.Horizontal: 15 | default: 16 | return 20d; 17 | } 18 | } 19 | 20 | return double.NaN; 21 | } 22 | 23 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Converters/Margin2MarginConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class Margin2MarginConverter : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | 7 | return value; 8 | } 9 | 10 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Metadata; 2 | 3 | [assembly: XmlnsPrefix("https://github.com/avaloniaui", $"{nameof(AntDesign)}")] 4 | [assembly: XmlnsDefinition("https://github.com/avaloniaui", $"{nameof(AntDesign)}")] 5 | [assembly: XmlnsDefinition("https://github.com/avaloniaui", $"{nameof(AntDesign)}.{nameof(AntDesign.Assists)}")] 6 | 7 | [assembly: XmlnsPrefix("https://ant.design.com/avalonia", $"{nameof(AntDesign)}")] 8 | [assembly: XmlnsDefinition("https://ant.design.com/avalonia", $"{nameof(AntDesign)}")] 9 | [assembly: XmlnsDefinition("https://ant.design.com/avalonia", $"{nameof(AntDesign)}.{nameof(AntDesign.Assists)}")] -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 | global using Avalonia; 2 | global using Avalonia.Controls; 3 | global using Avalonia.Data.Converters; 4 | global using Avalonia.Markup.Xaml; 5 | global using Avalonia.Media; 6 | global using Avalonia.Styling; 7 | global using System.Globalization; 8 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Styles/AntDesignControls.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Source/AntDesign.DataGrid/Styles/DataGridStyles.axaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/AntDesign.FontManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | true 6 | 7 | 8 | 9 | AntDesign.FontManager 10 | AntDesign.FontManager 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | True 24 | \ 25 | 26 | 27 | True 28 | \ 29 | 30 | 31 | 32 | 33 | 34 | 35 | all 36 | build; analyzers 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Black.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Bold.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-ExtraBold.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Heavy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Heavy.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Light.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Medium.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Regular.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-SemiBold.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/AntDesign.FontManager/Assets/Fonts/AliBaba/AlibabaPuHuiTi-Thin.ttf -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/AvaloniaAppBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.FontManager.Settings; 2 | using Avalonia; 3 | using Avalonia.Media; 4 | using Avalonia.Media.Fonts; 5 | using System.Diagnostics.CodeAnalysis; 6 | 7 | 8 | namespace AntDesign.FontManager; 9 | public static class AvaloniaAppBuilderExtensions 10 | { 11 | public static AppBuilder UseAntDesignFontManager([DisallowNull] this AppBuilder builder, Action? configDelegate = default) 12 | { 13 | var setting = new FontSettings(); 14 | configDelegate?.Invoke(setting); 15 | 16 | //this setting can make app crash when publish for NativeAOT 17 | return builder.With(new FontManagerOptions 18 | { 19 | DefaultFamilyName = setting.DefaultFontFamily, 20 | FontFallbacks = new[] 21 | { 22 | new FontFallback 23 | { 24 | FontFamily = new FontFamily(setting.DefaultFontFamily) 25 | } 26 | } 27 | 28 | }).ConfigureFonts(manager => manager.AddFontCollection(new EmbeddedFontCollection(setting.Key, setting.Source))); 29 | 30 | //return builder.ConfigureFonts(manager => manager.AddFontCollection(new EmbeddedFontCollection(setting.Key, setting.Source))); 31 | } 32 | } -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Metadata; 2 | 3 | [assembly: XmlnsPrefix("https://github.com/avaloniaui", $"{nameof(AntDesign)}.{nameof(AntDesign.FontManager)}")] 4 | [assembly: XmlnsDefinition("https://github.com/avaloniaui", $"{nameof(AntDesign)}.{nameof(AntDesign.FontManager)}")] 5 | [assembly: XmlnsDefinition("https://github.com/avaloniaui", $"{nameof(AntDesign)}.{nameof(AntDesign.FontManager)}.{nameof(AntDesign.FontManager.Settings)}")] 6 | 7 | 8 | [assembly: XmlnsPrefix("https://ant.design.com/avalonia", $"{nameof(AntDesign)}.{nameof(AntDesign.FontManager)}")] 9 | [assembly: XmlnsDefinition("https://ant.design.com/avalonia", $"{nameof(AntDesign)}.{nameof(AntDesign.FontManager)}")] 10 | [assembly: XmlnsDefinition("https://ant.design.com/avalonia", $"{nameof(AntDesign)}.{nameof(AntDesign.FontManager)}.{nameof(AntDesign.FontManager.Settings)}")] -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Source/AntDesign.FontManager/Settings/FontSettings.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.FontManager.Settings; 2 | public class FontSettings 3 | { 4 | public string DefaultFontFamily = "fonts:AntDesignFontFamilies#Alibaba PuHuiTi 2.0"; 5 | public Uri Key { get; set; } = new Uri("fonts:AntDesignFontFamilies", UriKind.Absolute); 6 | public Uri Source { get; set; } = new Uri("avares://AntDesign.FontManager/Assets/Fonts/AliBaba", UriKind.Absolute); 7 | } 8 | -------------------------------------------------------------------------------- /Source/AntDesign.Icons/AntDesign.Icons.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/AntDesign.Icons/Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AntDesign.Icons; 4 | public class Class1 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Source/AntDesign.Toolkit/AntDesign.Toolkit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | true 6 | 7 | 8 | 9 | AntDesign.Toolkit 10 | AntDesign.Toolkit 11 | 12 | 13 | 14 | 15 | 16 | 17 | True 18 | \ 19 | 20 | 21 | True 22 | \ 23 | 24 | 25 | 26 | 27 | 28 | 29 | all 30 | build; analyzers 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Source/AntDesign.Toolkit/AvaloniaAppBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Toolkit; 2 | 3 | public static class AvaloniaAppBuilderExtensions 4 | { 5 | public static AppBuilder UseAntDesignToolkit([DisallowNull] this AppBuilder builder) 6 | { 7 | return builder; 8 | } 9 | } -------------------------------------------------------------------------------- /Source/AntDesign.Toolkit/Helpers/OperatingSystemEx.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace AntDesign.Toolkit.Helpers; 4 | public sealed class OperatingSystemEx 5 | { 6 | #if NET6_0_OR_GREATER 7 | public static bool IsWindows() => OperatingSystem.IsWindows(); 8 | public static bool IsMacOS() => OperatingSystem.IsMacOS(); 9 | public static bool IsLinux() => OperatingSystem.IsLinux(); 10 | public static bool IsAndroid() => OperatingSystem.IsAndroid(); 11 | public static bool IsIOS() => OperatingSystem.IsIOS(); 12 | public static bool IsBrowser() => OperatingSystem.IsBrowser(); 13 | public static bool IsOSPlatform(string platform) => OperatingSystem.IsOSPlatform(platform); 14 | #else 15 | public static bool IsWindows() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); 16 | public static bool IsMacOS() => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); 17 | public static bool IsLinux() => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); 18 | public static bool IsAndroid() => IsOSPlatform("ANDROID"); 19 | public static bool IsIOS() => IsOSPlatform("IOS"); 20 | public static bool IsBrowser() => IsOSPlatform("BROWSER"); 21 | public static bool IsOSPlatform(string platform) => RuntimeInformation.IsOSPlatform(OSPlatform.Create(platform)); 22 | #endif 23 | } -------------------------------------------------------------------------------- /Source/AntDesign.Toolkit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Metadata; 2 | 3 | [assembly: XmlnsPrefix("https://github.com/avaloniaui", $"{nameof(AntDesign)}.{nameof(AntDesign.Toolkit)}")] 4 | [assembly: XmlnsDefinition("https://github.com/avaloniaui", $"{nameof(AntDesign)}.{nameof(AntDesign.Toolkit)}")] 5 | 6 | 7 | [assembly: XmlnsPrefix("https://ant.design.com/avalonia", $"{nameof(AntDesign)}.{nameof(AntDesign.Toolkit)}")] 8 | [assembly: XmlnsDefinition("https://ant.design.com/avalonia", $"{nameof(AntDesign)}.{nameof(AntDesign.Toolkit)}")] 9 | -------------------------------------------------------------------------------- /Source/AntDesign.Toolkit/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 | global using Avalonia; 2 | global using System.Diagnostics.CodeAnalysis; 3 | global using System.Runtime.InteropServices; 4 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/AntDesignAccents1.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | true 7 | 8 | 9 | 10 | scaleX(0.125) translateX(-2px) 11 | scaleY(0.125) translateY(-2px) 12 | 13 | 14 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/AntDesignDescriptions.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | File Name 7 | OK 8 | Cancel 9 | Show hidden files 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/AutoCompleteBox.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 0 0 10 1 #4FFFFFFF 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/Calendar.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/CalendarDatePicker.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 0 0 10 1 #4FFFFFFF 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/CalendarItem.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/CaptionButtons.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/CheckBox.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ComboBoxItem.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ContextMenu.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 10 1 #4FFFFFFF 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/EmbeddableControlRoot.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/Expander.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/FlyoutPresenter.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 10 1 #4FFFFFFF 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/FocusAdorner.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/GridSplitter.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ListBox.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ManagedFileChooser.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 5 0 LightGray 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/MenuFlyoutPresenter.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 10 1 #4FFFFFFF 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/MenuScrollViewer.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/NotificationCard.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 6 8 0 #4FFFFFFF 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ProgressBar.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/RefreshVisualizer.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ScrollBar.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ScrollViewer.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/SelectableTextBlock.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/Separator.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/Slider.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/SplitView.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/Tabs.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/ToolTip.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Dark/Window.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/AutoCompleteBox.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 0 0 10 1 #4F000000 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/Calendar.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/CalendarDatePicker.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 0 0 10 1 #4F000000 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/CalendarItem.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/CaptionButtons.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/CheckBox.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ComboBoxItem.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ContextMenu.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 10 1 #4F000000 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/EmbeddableControlRoot.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/Expander.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/FlyoutPresenter.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 10 1 #4F000000 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/FocusAdorner.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/GridSplitter.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ListBox.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ManagedFileChooser.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 5 0 LightGray 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/MenuFlyoutPresenter.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 0 10 1 #4F000000 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/MenuScrollViewer.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/NotificationCard.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 0 6 8 0 #4F000000 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ProgressBar.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/RefreshVisualizer.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ScrollBar.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ScrollViewer.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/SelectableTextBlock.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/Separator.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/Slider.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/SplitView.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/Tabs.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/ToolTip.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Accents/Light/Window.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/AntDesign/AntDesignColorPalette.Property.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign; 2 | 3 | partial class AntDesignColorPalette 4 | { 5 | const string g_AntDesignPrimaryColor = "AntDesignPrimaryColor"; 6 | const string g_AntDesignSecondlyColor = "AntDesignSecondlyColor"; 7 | const string g_AntDesignThirdlyColor = "AntDesignThirdlyColor"; 8 | const string g_AntDesignAssistColor5 = "AntDesignAssistColor5"; 9 | const string g_RippleColor = "RippleColor"; 10 | const string g_OverlayCornerRadius = "OverlayCornerRadius"; 11 | 12 | Color _defaultAntDesignPrimaryColor = Color.Parse("#FF1677FF"); 13 | Color _defaultAntDesignSecondlyColor = Color.Parse("#FF4096FF"); 14 | Color _defaultAntDesignThirdlyColor = Color.Parse("#FF1668DC"); 15 | Color _defaultAntDesignAssistColor5 = Color.Parse("#4F9ad2ff"); 16 | Color _defaultRippleColor = Color.Parse("#9B40a9ff"); 17 | 18 | Color _primaryAccentColor; 19 | 20 | public static readonly DirectProperty PrimaryAccentProperty = AvaloniaProperty.RegisterDirect(nameof(PrimaryAccent), r => r.PrimaryAccent, (r, v) => r.PrimaryAccent = v); 21 | public Color PrimaryAccent 22 | { 23 | get => _primaryAccentColor; 24 | set => SetAndRaise(PrimaryAccentProperty, ref _primaryAccentColor, value); 25 | } 26 | 27 | public Color PrimaryColor 28 | { 29 | get => GetColor(g_AntDesignPrimaryColor); 30 | set => SetColor(g_AntDesignPrimaryColor, value); 31 | } 32 | 33 | 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Source/AntDesign/Assists/CarouselAssists.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Assists; 2 | public class CarouselAssists 3 | { 4 | public static readonly StyledProperty ShowButtonsProperty = AvaloniaProperty.RegisterAttached("ShowButtons", typeof(CarouselAssists)); 5 | public static void SetShowButtons(AvaloniaObject dependencyObject, IBrush value) => dependencyObject.SetValue(ShowButtonsProperty, value); 6 | public static bool GetShowButtons(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ShowButtonsProperty); 7 | 8 | public static readonly AvaloniaProperty ShowDotsProperty = AvaloniaProperty.RegisterAttached("ShowDots", typeof(CarouselAssists)); 9 | public static void SetShowDots(AvaloniaObject dependencyObject, IBrush value) => dependencyObject.SetValue(ShowDotsProperty, value); 10 | public static bool GetShowDots(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ShowDotsProperty); 11 | } 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Assists/TreeViewAssists.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Assists; 2 | public class TreeViewAssists 3 | { 4 | public static readonly AvaloniaProperty ShowLineProperty 5 | = AvaloniaProperty.RegisterAttached("ShowLine", typeof(TreeViewAssists)); 6 | public static void SetShowLine(AvaloniaObject dependencyObject, bool value) => dependencyObject.SetValue(ShowLineProperty, value); 7 | public static bool GetShowLine(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ShowLineProperty); 8 | 9 | public static readonly AvaloniaProperty ShowIconProperty 10 | = AvaloniaProperty.RegisterAttached("ShowIcon", typeof(TreeViewAssists)); 11 | public static void SetShowIcon(AvaloniaObject dependencyObject, bool value) => dependencyObject.SetValue(ShowIconProperty, value); 12 | public static bool GetShowIcon(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ShowIconProperty); 13 | 14 | public static readonly AvaloniaProperty ShowLeafIconProperty 15 | = AvaloniaProperty.RegisterAttached("ShowLeafIcon", typeof(TreeViewAssists)); 16 | public static void SetShowLeafIcon(AvaloniaObject dependencyObject, bool value) => dependencyObject.SetValue(ShowLeafIconProperty, value); 17 | public static bool GetShowLeafIcon(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ShowLeafIconProperty); 18 | } 19 | -------------------------------------------------------------------------------- /Source/AntDesign/Behaviors/Behavior.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Behaviors; 2 | public abstract class Behavior : AvaloniaObject, IAttachedObject 3 | { 4 | internal Behavior(Type associatedType) 5 | { 6 | _associatedType = associatedType; 7 | } 8 | 9 | private Type _associatedType; 10 | private AvaloniaObject? _associatedObject; 11 | 12 | protected Type AssociatedType 13 | { 14 | get 15 | { 16 | VerifyAccess(); 17 | return _associatedType; 18 | } 19 | } 20 | 21 | public AvaloniaObject? AssociatedObject => _associatedObject; 22 | 23 | public void Attach(AvaloniaObject avaloniaObject) 24 | { 25 | if (_associatedObject != avaloniaObject) 26 | { 27 | OnAttaching(); 28 | _associatedObject = avaloniaObject; 29 | OnAttached(); 30 | } 31 | } 32 | 33 | public void Detach(AvaloniaObject avaloniaObject) 34 | { 35 | OnDetaching(avaloniaObject); 36 | _associatedObject = default; 37 | OnDetached(); 38 | } 39 | 40 | protected virtual void OnAttaching() 41 | { 42 | 43 | } 44 | 45 | protected virtual void OnAttached() 46 | { 47 | 48 | } 49 | 50 | protected virtual void OnDetaching(AvaloniaObject avaloniaObject) 51 | { 52 | 53 | } 54 | 55 | protected virtual void OnDetached() 56 | { 57 | 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Source/AntDesign/Behaviors/Behavior@T.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Behaviors; 2 | public abstract class Behavior : Behavior where T : AvaloniaObject 3 | { 4 | protected Behavior() : base(typeof(T)) 5 | { 6 | 7 | } 8 | 9 | protected new T? AssociatedObject => (T?)base.AssociatedObject; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Behaviors/IAttachedObject.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Behaviors; 2 | public interface IAttachedObject 3 | { 4 | AvaloniaObject? AssociatedObject { get; } 5 | void Attach(AvaloniaObject avaloniaObject); 6 | void Detach(AvaloniaObject avaloniaObject); 7 | } 8 | -------------------------------------------------------------------------------- /Source/AntDesign/Behaviors/Interaction.cs: -------------------------------------------------------------------------------- 1 |  namespace AntDesign.Behaviors; 2 | 3 | public static class Interaction 4 | { 5 | static Interaction() 6 | { 7 | BehaviorsProperty.Changed.AddClassHandler((s, e) => 8 | { 9 | if (s == null) 10 | return; 11 | 12 | if (e.OldValue.Value is not null) 13 | e.OldValue.Value.Detach(s); 14 | 15 | if (e.NewValue.Value is not null) 16 | e.NewValue.Value.Attach(s); 17 | }); 18 | } 19 | 20 | public static readonly AvaloniaProperty BehaviorsProperty = AvaloniaProperty.RegisterAttached("Behaviors", typeof(Interaction)); 21 | public static void SetBehaviors(AvaloniaObject dependencyObject, Behavior? value) => dependencyObject.SetValue(BehaviorsProperty, value); 22 | public static Behavior? GetBehaviors(AvaloniaObject dependencyObject) => dependencyObject.GetValue(BehaviorsProperty); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Source/AntDesign/Behaviors/MenuItemBehaviors.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Behaviors; 2 | public class MenuItemBehaviors : Behavior 3 | { 4 | public MenuItemBehaviors() 5 | { 6 | _snapshot = new(); 7 | } 8 | protected Dictionary _snapshot; 9 | 10 | protected override void OnAttached() 11 | { 12 | base.OnAttached(); 13 | if (AssociatedObject is null) 14 | return; 15 | 16 | if (_snapshot.ContainsKey(AssociatedObject)) 17 | return; 18 | 19 | var pointer = new PointerBehavior(); 20 | pointer.Attach(AssociatedObject); 21 | _snapshot.Add(AssociatedObject, pointer); 22 | } 23 | 24 | protected override void OnDetaching(AvaloniaObject avaloniaObject) 25 | { 26 | base.OnDetaching(avaloniaObject); 27 | if (avaloniaObject is not MenuItem menuItem) 28 | return; 29 | 30 | _snapshot.TryGetValue(menuItem, out var pointer); 31 | pointer.Detach(menuItem); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/AntDesign/Colours.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign; 2 | public enum Colours 3 | { 4 | None, 5 | Red 6 | } 7 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/AutoSizeConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | 3 | public class AutoSizeConverter : IValueConverter 4 | { 5 | public double Default { get; set; } 6 | 7 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 8 | { 9 | double newValue = Default; 10 | if (!double.TryParse(parameter?.ToString(), out var paraValue)) 11 | newValue = paraValue; 12 | 13 | if (value is not Rect rect) 14 | return newValue; 15 | 16 | if (rect.Width == 0 && rect.Height == 0) 17 | return newValue; 18 | 19 | return Math.Min(rect.Width, rect.Height); 20 | } 21 | 22 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/BorderOffsetMarginConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | 3 | public class BorderOffsetMarginConverter : IValueConverter 4 | { 5 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 6 | { 7 | if (value is not Thickness margin) 8 | return value; 9 | 10 | int.TryParse(parameter?.ToString(), out int offset); 11 | var step = -(margin.Bottom + offset); 12 | return new Thickness(0, 0, 0, step); 13 | } 14 | 15 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/BorderThicknessFilterConverter.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Enums; 2 | 3 | namespace AntDesign.Converters; 4 | public class BorderThicknessFilterConverter : IValueConverter 5 | { 6 | public BorderEdges Edges { get; set; } 7 | 8 | public double Scale { get; set; } = 1.0; 9 | 10 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 11 | { 12 | if (value is not Thickness thickness) 13 | return value; 14 | 15 | return new Thickness(Edges.HasFlag(BorderEdges.Left) ? (thickness.Left) * Scale : 0d, 16 | Edges.HasFlag(BorderEdges.Top) ? (thickness.Top) * Scale : 0d, 17 | Edges.HasFlag(BorderEdges.Right) ? (thickness.Right) * Scale : 0d, 18 | Edges.HasFlag(BorderEdges.Bottom) ? (thickness.Bottom) * Scale : 0d); 19 | } 20 | 21 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/Bounds2SizeConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class Bounds2SizeConverter : IMultiValueConverter 3 | { 4 | public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (values.Count < 4) 7 | return default; 8 | 9 | double max = 0; 10 | if (values[0] is Rect offContentRect) 11 | max = Math.Max(max, offContentRect.Width); 12 | 13 | if (values[1] is Rect onContentRect) 14 | max = Math.Max(max, onContentRect.Width); 15 | 16 | double.TryParse(values[2]?.ToString(), out var size); 17 | 18 | var width = max + size; 19 | var doubleSize = 2 * size; 20 | 21 | return Math.Max(width, doubleSize); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/ColorToBrushConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | /// 3 | /// Converts the given value into an when a conversion is possible. 4 | /// 5 | public class ColorToBrushConverter : IValueConverter 6 | { 7 | /// 8 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 9 | { 10 | if (value is IBrush brush) 11 | return brush; 12 | else if (value is Color valueColor) 13 | return new SolidColorBrush(valueColor); 14 | 15 | else if (value is HslColor valueHslColor) 16 | return new SolidColorBrush(valueHslColor.ToRgb()); 17 | else if (value is HsvColor valueHsvColor) 18 | return new SolidColorBrush(valueHsvColor.ToRgb()); 19 | 20 | return AvaloniaProperty.UnsetValue; 21 | } 22 | 23 | /// 24 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 25 | { 26 | return AvaloniaProperty.UnsetValue; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/Double2MarginConverters.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Enums; 2 | 3 | namespace AntDesign.Converters; 4 | 5 | public class Double2MarginConverters : IValueConverter 6 | { 7 | public Direction Direction { get; set; } 8 | 9 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 10 | { 11 | if (value is not Rect rect) 12 | return new Thickness(0); 13 | 14 | double.TryParse(parameter?.ToString(), out var offset); 15 | if (double.IsNaN(offset)) 16 | return new Thickness(0); 17 | 18 | var min = Math.Min(rect.Width, rect.Height); 19 | 20 | switch (Direction) 21 | { 22 | case Direction.Left: 23 | return new Thickness(min + offset, 0, offset, 0 ); 24 | case Direction.Right: 25 | return new Thickness(offset, 0, min + offset, 0 ); 26 | case Direction.Top: 27 | return new Thickness(0, min + offset, 0, offset); 28 | case Direction.Bottom: 29 | return new Thickness(0, offset, 0, min + offset); 30 | default: 31 | break; 32 | } 33 | 34 | return new Thickness(0); 35 | } 36 | 37 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/Height2CornerRadiusConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class Height2CornerRadiusConverter : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | double.TryParse(value?.ToString(), out var height); 7 | return new CornerRadius(height); 8 | } 9 | 10 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/IBitmapToImageConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | 3 | public class IBitmapToImageConverter : IValueConverter 4 | { 5 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 6 | { 7 | if (value != null && value is Bitmap bm) 8 | return new Image { Source = bm }; 9 | 10 | return null; 11 | } 12 | 13 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 14 | { 15 | throw new NotImplementedException(); 16 | } 17 | } -------------------------------------------------------------------------------- /Source/AntDesign/Converters/Items2ObjectsConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class Items2ObjectsConverter : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (value is IEnumerable lists) 7 | return lists.Select(t => new object()); 8 | 9 | return AvaloniaProperty.UnsetValue; 10 | } 11 | 12 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/PopupHorizontalOffsetConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class PopupHorizontalOffsetConverter : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (value is not Thickness thickness) 7 | return default; 8 | 9 | return -thickness.Left; 10 | } 11 | 12 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/PopupSizeConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class PopupSizeConverter : IMultiValueConverter 3 | { 4 | public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (values is null) 7 | return default; 8 | 9 | if (values.Count < 2) 10 | return default; 11 | 12 | if (values[0] is not Rect rect) 13 | return default; 14 | 15 | if (values[1] is not Thickness thickness) 16 | return default; 17 | 18 | return rect.Width + thickness.Left + thickness.Right; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/Size2RoundConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class Size2RoundConverter : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (value is not Rect rect) 7 | return value; 8 | var max = Math.Max(rect.Width, rect.Height); 9 | return new CornerRadius(max); 10 | } 11 | 12 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/Size2SizeConverters.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Converters; 2 | public class Size2SizeConverters : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (value is not Rect rect) 7 | return default; 8 | 9 | var width = rect.Width; 10 | var height = rect.Height; 11 | 12 | if (bool.TryParse(parameter?.ToString(), out var bRet)) 13 | { 14 | if (bRet) 15 | { 16 | var max = Math.Max(width, height); 17 | var min = Math.Min(width, height); 18 | return max - min; 19 | } 20 | } 21 | 22 | return Math.Min(width, height); 23 | } 24 | 25 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/AntDesign/Converters/Thickness2MarginConverter.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Enums; 2 | 3 | namespace AntDesign.Converters; 4 | public class Thickness2MarginConverter : IValueConverter 5 | { 6 | public bool Reverse { get; set; } 7 | public BorderEdges Edges { get; set; } 8 | public double Scale { get; set; } = 1.0; 9 | 10 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 11 | { 12 | if (value is not Thickness thickness) 13 | return value; 14 | 15 | if (Reverse) 16 | return new Thickness(Edges.HasFlag(BorderEdges.Left) ? (thickness.Left) * -Scale : 0d, 17 | Edges.HasFlag(BorderEdges.Top) ? (thickness.Top) * -Scale : 0d, 18 | Edges.HasFlag(BorderEdges.Right) ? (thickness.Right) * -Scale : 0d, 19 | Edges.HasFlag(BorderEdges.Bottom) ? (thickness.Bottom) * -Scale : 0d); 20 | else 21 | return new Thickness(Edges.HasFlag(BorderEdges.Left) ? (thickness.Left) * Scale : 0d, 22 | Edges.HasFlag(BorderEdges.Top) ? (thickness.Top) * Scale : 0d, 23 | Edges.HasFlag(BorderEdges.Right) ? (thickness.Right) * Scale : 0d, 24 | Edges.HasFlag(BorderEdges.Bottom) ? (thickness.Bottom) * Scale : 0d); 25 | } 26 | 27 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/AntDesign/Enums/AntStatus.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign; 2 | public enum AntStatus 3 | { 4 | Default, 5 | Info, 6 | Success, 7 | Warning, 8 | Error, 9 | } 10 | -------------------------------------------------------------------------------- /Source/AntDesign/Enums/BorderEdges.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Enums; 2 | 3 | [Flags] 4 | public enum BorderEdges 5 | { 6 | None = 0x0, 7 | Left = 0x1, 8 | Right = 0x2, 9 | Top = 0x4, 10 | Bottom = 0x8, 11 | } 12 | -------------------------------------------------------------------------------- /Source/AntDesign/Enums/Direction.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Enums; 2 | 3 | [Flags] 4 | public enum Direction 5 | { 6 | None = 0x0, 7 | Left = 0x1, 8 | Right = 0x2, 9 | Top = 0x4, 10 | Bottom = 0x8, 11 | } -------------------------------------------------------------------------------- /Source/AntDesign/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 | global using Avalonia; 2 | global using Avalonia.Animation; 3 | global using Avalonia.Animation.Easings; 4 | global using Avalonia.Collections; 5 | global using Avalonia.Controls; 6 | global using Avalonia.Controls.Primitives; 7 | global using Avalonia.Controls.Templates; 8 | global using Avalonia.Data; 9 | global using Avalonia.Data.Converters; 10 | global using Avalonia.Input; 11 | global using Avalonia.Markup.Xaml; 12 | global using Avalonia.Media; 13 | global using Avalonia.Media.Imaging; 14 | global using Avalonia.Styling; 15 | global using Avalonia.Threading; 16 | global using System.Collections; 17 | global using System.Globalization; 18 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/ContentControl.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/EmbeddableControlRoot.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/FocusAdorner.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 9 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/GridSplitter.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/ItemsControl.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/NativeMenuBar.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/OverlayPopupHost.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/PopupRoot.axaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/RefreshContainer.axaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/RefreshVisualizer.axaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/SelectableTextBlock.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 | 23 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/TexBlock.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 8 | 9 | 13 | 17 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/ThemeVariantScope.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/AntDesign/Styles/UserControl.axaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/Assists/RoutedViewHostAssists.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.Assists; 2 | 3 | public static class RoutedViewHostAssists 4 | { 5 | static RoutedViewHostAssists() 6 | { 7 | ViewLocatorProperty.Changed.AddClassHandler((r, e) => 8 | { 9 | r.ViewLocator = e.NewValue.Value; 10 | }); 11 | } 12 | 13 | public static readonly AvaloniaProperty ViewLocatorProperty = 14 | AvaloniaProperty.RegisterAttached("ViewLocator", typeof(RoutedViewHostAssists)); 15 | 16 | public static void SetViewLocator(AvaloniaObject dependencyObject, IViewLocator? value) => dependencyObject.SetValue(ViewLocatorProperty, value); 17 | public static IViewLocator? GetViewLocator(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ViewLocatorProperty); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/Avalonia.ReactiveUI.Toolkit.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | all 13 | build; analyzers 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Avalonia.ReactiveUI.Toolkit; 4 | public class Class1 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 | global using ReactiveUI; 2 | global using System.ComponentModel; 3 | global using System.Globalization; 4 | global using System.Reactive.Disposables; 5 | global using System.Runtime.CompilerServices; 6 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/ReactiveObjects/ReactiveObject@.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | public class ReactiveObject : ReactiveObjectBase where T : class 4 | { 5 | public T? TObject { get; protected set; } 6 | } 7 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/ReactiveObjects/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | public abstract class ViewModelBase : ReactiveObject, IActivatableViewModel 4 | { 5 | public ViewModelBase() 6 | { 7 | TObject = this; 8 | Activator = new(); 9 | this.WhenActivated(disposables => 10 | { 11 | Activating(); 12 | Disposable.Create(() => Disposing()).DisposeWith(disposables); 13 | }); 14 | } 15 | 16 | public ViewModelActivator Activator { get; } 17 | 18 | 19 | protected virtual void Activating() 20 | { 21 | 22 | } 23 | 24 | protected virtual void Disposing() 25 | { 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/ReactiveObjects/ViewModelRoutableBase.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | public class ViewModelRoutableBase : ViewModelBase, IRoutableViewModel 4 | { 5 | public ViewModelRoutableBase(string? urlPathSegment) 6 | { 7 | UrlPathSegment = urlPathSegment; 8 | TObject = this; 9 | } 10 | 11 | public string? UrlPathSegment { get;} 12 | public IScreen HostScreen { get; set; } = default!; 13 | } 14 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/ReactiveObjects/ViewModelRoutableBase@.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | public class ViewModelRoutableBase : ViewModelRoutableBase where TViewModel : class 4 | { 5 | public ViewModelRoutableBase():base(typeof(TViewModel).FullName) 6 | { 7 | } 8 | 9 | public TViewModel? ViewModel => TObject as TViewModel; 10 | } 11 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/Routers/IRoutingViewLocator.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.Routers; 2 | public interface IRoutingViewLocator : IViewLocator 3 | { 4 | RoutingState Make(IScreen screen); 5 | } 6 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/Routers/IRoutingViewLocatorManager.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.Routers; 2 | 3 | public interface IRoutingViewLocatorManager : INotifyPropertyChanged 4 | { 5 | CultureInfo CurrentCulture { get; set; } 6 | } 7 | -------------------------------------------------------------------------------- /Source/Avalonia.ReactiveUI.Toolkit/Routers/LocalizedString.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.ReactiveUI.Toolkit.Routers; 2 | public class LocalizedString : INotifyPropertyChanged 3 | { 4 | public LocalizedString(IRoutingViewLocatorManager locatorManager, Func generator) 5 | : this(generator) 6 | { 7 | locatorManager.PropertyChanged += (s, e) => RaiseLocalizedChanged(); 8 | } 9 | 10 | public LocalizedString(Func generator) 11 | { 12 | _generator = generator; 13 | } 14 | 15 | readonly Func _generator; 16 | 17 | public event PropertyChangedEventHandler? PropertyChanged; 18 | 19 | public string Localized => _generator(); 20 | 21 | public static implicit operator LocalizedString(Func generator) => new LocalizedString(generator); 22 | 23 | public void RaiseLocalizedChanged() => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Localized))); 24 | } 25 | -------------------------------------------------------------------------------- /Source/Avalonia.SourceGenerator/Avalonia.SourceGenerator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/Avalonia.SourceGenerator/Class1.cs: -------------------------------------------------------------------------------- 1 | namespace Avalonia.SourceGenerator; 2 | 3 | public class Class1 4 | { 5 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/AntDesign.Sample.Android.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Exe 4 | net7.0-android 5 | 21 6 | com.CompanyName.AntDesign.Avalonia 7 | 1 8 | 1.0 9 | apk 10 | False 11 | true 12 | AntDesign.Sample 13 | 14 | 15 | 16 | 17 | Resources\drawable\Icon.png 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Android/Icon.png -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.Content.PM; 2 | using AntDesign.FontManager; 3 | using Avalonia; 4 | using Avalonia.Android; 5 | using Avalonia.ReactiveUI; 6 | 7 | namespace AntDesign.Sample; 8 | 9 | [Activity(Label = "AntDesign.Avalonia.Android", 10 | Theme = "@style/MyTheme.NoActionBar", 11 | Icon = "@drawable/icon", 12 | MainLauncher = true, 13 | ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] 14 | public class MainActivity : AvaloniaMainActivity 15 | { 16 | protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) 17 | { 18 | return base.CustomizeAppBuilder(builder) 19 | .UseReactiveUI() 20 | .UseAntDesignFontManager(); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/Resources/drawable/splash_screen.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | #FFFFFF 4 | 5 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 6 | 7 | 11 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/environment.device.txt: -------------------------------------------------------------------------------- 1 | DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend 2 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Android/environment.emulator.txt: -------------------------------------------------------------------------------- 1 | DOTNET_DiagnosticPorts=10.0.2.2:9001,suspend 2 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/App.razor.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Sample.Browser.Blazor; 2 | 3 | public partial class App 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | @using Avalonia.Browser.Blazor 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/Program.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Browser.Blazor; 3 | using Avalonia.ReactiveUI; 4 | using AntDesign.FontManager; 5 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 6 | using System.Runtime.Versioning; 7 | using antdesignApp = AntDesign.Sample.App; 8 | using blazorApp = AntDesign.Sample.Browser.Blazor.App; 9 | 10 | [assembly: SupportedOSPlatform("browser")] 11 | public class Program 12 | { 13 | public static async Task Main(string[] args) 14 | { 15 | var host = CreateHostBuilder(args).Build(); 16 | await StartAvaloniaApp(); 17 | await host.RunAsync(); 18 | } 19 | 20 | public static async Task StartAvaloniaApp() 21 | { 22 | await AppBuilder.Configure() 23 | .UseReactiveUI() 24 | .UseAntDesignFontManager() 25 | .StartBlazorAppAsync(); 26 | } 27 | 28 | public static WebAssemblyHostBuilder CreateHostBuilder(string[] args) 29 | { 30 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 31 | 32 | builder.RootComponents.Add("#app"); 33 | 34 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 35 | 36 | return builder; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:13961", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "AntDesign.Sample.Browser.Blazor": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:9001;http://localhost:9000", 18 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 |
5 | @Body 6 |
7 |
8 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Browser.Blazor; 2 | @using Browser.Blazor.Shared; 3 | @using System.Net.Http 4 | @using System.Net.Http.Json 5 | @using Microsoft.AspNetCore.Components.Forms 6 | @using Microsoft.AspNetCore.Components.Routing 7 | @using Microsoft.AspNetCore.Components.Web 8 | @using Microsoft.AspNetCore.Components.Web.Virtualization 9 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 10 | @using Microsoft.JSInterop 11 | @using SkiaSharp -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | margin: 0; 4 | height: 100vh; 5 | overflow: hidden; 6 | touch-action: none; 7 | } 8 | 9 | a, .btn-link { 10 | color: #0366d6; 11 | } 12 | 13 | .btn-primary { 14 | color: #fff; 15 | background-color: #1b6ec2; 16 | border-color: #1861ac; 17 | } 18 | 19 | .content { 20 | padding-top: 1.1rem; 21 | } 22 | 23 | .valid.modified:not([type=checkbox]) { 24 | outline: 1px solid #26b050; 25 | } 26 | 27 | .invalid { 28 | outline: 1px solid red; 29 | } 30 | 31 | .validation-message { 32 | color: red; 33 | } 34 | 35 | #blazor-error-ui { 36 | background: lightyellow; 37 | bottom: 0; 38 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 39 | display: none; 40 | left: 0; 41 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 42 | position: fixed; 43 | width: 100%; 44 | z-index: 1000; 45 | } 46 | 47 | #blazor-error-ui .dismiss { 48 | cursor: pointer; 49 | position: absolute; 50 | right: 0.75rem; 51 | top: 0.5rem; 52 | } 53 | 54 | #app, .page { 55 | height: 100%; 56 | } 57 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Browser.Blazor/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Browser.Blazor/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | AntDesign Sample 8 | 9 | 10 | 11 | 12 | 13 |
Powered by Avalonia
14 | 15 |
16 | An unhandled error has occurred. 17 | Reload 18 | 🗙 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Desktop/AntDesign.Sample.Desktop.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WinExe 4 | net7.0 5 | true 6 | copyused 7 | AntDesign.Sample 8 | 9 | 10 | 11 | app.manifest 12 | 13 | 14 | 15 | 16 | true 17 | 18 | true 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Desktop/Program.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls; 3 | using AntDesign.FontManager; 4 | using Avalonia.ReactiveUI; 5 | 6 | namespace AntDesign.Sample; 7 | 8 | internal class Program 9 | { 10 | // Initialization code. Don't use any Avalonia, third-party APIs or any 11 | // SynchronizationContext-reliant code before AppMain is called: things aren't initialized 12 | // yet and stuff might break. 13 | [STAThread] 14 | public static void Main(string[] args) =>BuildAvaloniaApp() 15 | .StartWithClassicDesktopLifetime(args, shutdownMode: ShutdownMode.OnMainWindowClose); 16 | 17 | // Avalonia configuration, don't remove; also used by visual designer. 18 | public static AppBuilder BuildAvaloniaApp() 19 | => AppBuilder.Configure() 20 | .UsePlatformDetect() 21 | .UseAntDesignFontManager() 22 | .LogToTrace() 23 | .UseReactiveUI(); 24 | } 25 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Desktop/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Desktop": { 4 | "commandName": "Project", 5 | "distributionName": "" 6 | }, 7 | "WSL": { 8 | "commandName": "WSL2", 9 | "distributionName": "" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Desktop/Properties/rd.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Desktop/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.DesktopDrm/AntDesign.Sample.DesktopDrm.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net7.0 6 | true 7 | AntDesign.Sample 8 | 9 | 10 | 11 | app.manifest 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.DesktopDrm/Program.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.FontManager; 2 | using Avalonia; 3 | using Avalonia.ReactiveUI; 4 | 5 | namespace AntDesign.Sample.DesktopDrm; 6 | 7 | class Program 8 | { 9 | [STAThread] 10 | public static int Main(string[] args) 11 | { 12 | var builder = BuildAvaloniaApp(); 13 | if (args.Contains("--drm")) 14 | { 15 | SilenceConsole(); 16 | 17 | // If Card0, Card1 and Card2 all don't work. You can also try: 18 | // return builder.StartLinuxFbDev(args); 19 | // return builder.StartLinuxDrm(args, "/dev/dri/card1"); 20 | return builder.StartLinuxDrm(args, "/dev/dri/card1", 1D); 21 | } 22 | 23 | return builder.StartWithClassicDesktopLifetime(args); 24 | } 25 | 26 | public static AppBuilder BuildAvaloniaApp() 27 | => AppBuilder.Configure() 28 | .UsePlatformDetect() 29 | .UseAntDesignFontManager() 30 | .LogToTrace() 31 | .UseReactiveUI(); 32 | 33 | private static void SilenceConsole() 34 | { 35 | new Thread(() => 36 | { 37 | Console.CursorVisible = false; 38 | while (true) 39 | Console.ReadKey(true); 40 | }) 41 | { IsBackground = true }.Start(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.DesktopDrm/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Assets/Images/antdesign-painting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Shared/Assets/Images/antdesign-painting.jpg -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Assets/antdesign@avalonia-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Shared/Assets/antdesign@avalonia-logo.png -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Shared/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Assists/RoutedViewHostAssists.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Sample.Assists; 2 | 3 | public static class RoutedViewHostAssists 4 | { 5 | static RoutedViewHostAssists() 6 | { 7 | ViewLocatorProperty.Changed.AddClassHandler((r, e) => 8 | { 9 | r.ViewLocator = e.NewValue.Value; 10 | }); 11 | } 12 | 13 | public static readonly AvaloniaProperty ViewLocatorProperty = 14 | AvaloniaProperty.RegisterAttached("ViewLocator", typeof(RoutedViewHostAssists)); 15 | 16 | public static void SetViewLocator(AvaloniaObject dependencyObject, IViewLocator? value) => dependencyObject.SetValue(ViewLocatorProperty, value); 17 | public static IViewLocator? GetViewLocator(AvaloniaObject dependencyObject) => dependencyObject.GetValue(ViewLocatorProperty); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Converters/DataGridRowAlternatingRowColorConverter.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Media; 2 | 3 | namespace AntDesign.Sample.Converters; 4 | public class DataGridRowAlternatingRowColorConverter : IValueConverter 5 | { 6 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 7 | { 8 | if (value is DataGridRow row) 9 | { 10 | var index = row.GetIndex(); 11 | if (index % 2 == 0) 12 | return Brushes.Yellow; 13 | 14 | } 15 | 16 | return AvaloniaProperty.UnsetValue; 17 | } 18 | 19 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Converters/DataGridRowIndexConverter.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Sample.Converters; 2 | public class DataGridRowIndexConverter : IValueConverter 3 | { 4 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 5 | { 6 | if (value is DataGridRow row) 7 | return row.GetIndex(); 8 | 9 | return AvaloniaProperty.UnsetValue; 10 | } 11 | 12 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Extensions/IServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Sample.Extensions; 2 | 3 | public static class IServiceCollectionExtensions 4 | { 5 | public static IServiceCollection AddViewWithViewModelSingleton([DisallowNull] this IServiceCollection container) 6 | where View : class where ViewModel : class, INotifyPropertyChanged 7 | { 8 | return container.AddSingleton().AddSingleton(); 9 | } 10 | 11 | public static IServiceCollection AddViewWithViewModelScoped([DisallowNull] this IServiceCollection container) 12 | where View : class where ViewModel : class, INotifyPropertyChanged 13 | { 14 | return container.AddScoped().AddScoped(); 15 | } 16 | 17 | public static IServiceCollection AddViewWithViewModelTransient([DisallowNull]this IServiceCollection container) 18 | where View : class where ViewModel : class, INotifyPropertyChanged 19 | { 20 | return container.AddTransient().AddTransient(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Models/AutoCompletionModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.Models; 4 | public class AutoCompletionModel : ReactiveObject 5 | { 6 | public AutoCompletionModel() 7 | { 8 | 9 | } 10 | 11 | string? _name; 12 | public string? Name 13 | { 14 | get => _name; 15 | set => SetProperty(ref _name, value); 16 | } 17 | 18 | 19 | string? _caption; 20 | public string? Caption 21 | { 22 | get => _caption; 23 | set => SetProperty(ref _caption, value); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Models/Person.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.Models; 4 | public class Person : ReactiveObject 5 | { 6 | public Person() 7 | { 8 | 9 | } 10 | 11 | int _id; 12 | public int Id 13 | { 14 | get => _id; 15 | set => SetProperty(ref _id, value); 16 | } 17 | 18 | string? _name; 19 | public string? Name 20 | { 21 | get => _name; 22 | set => SetProperty(ref _name, value); 23 | } 24 | 25 | int _age; 26 | public int Age 27 | { 28 | get => _age; 29 | set => SetProperty(ref _age, value); 30 | } 31 | 32 | string? _address; 33 | public string? Address 34 | { 35 | get => _address; 36 | set => SetProperty(ref _address, value); 37 | } 38 | 39 | string? _tags; 40 | public string? Tags 41 | { 42 | get => _tags; 43 | set => SetProperty(ref _tags, value); 44 | } 45 | 46 | string? _actions; 47 | public string? Actions 48 | { 49 | get => _actions; 50 | set => SetProperty(ref _actions, value); 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Properties/_globalusing.cs: -------------------------------------------------------------------------------- 1 | global using Avalonia; 2 | global using Avalonia.Controls; 3 | global using Avalonia.Controls.ApplicationLifetimes; 4 | global using Avalonia.Interactivity; 5 | global using Avalonia.Markup.Xaml; 6 | global using Avalonia.ReactiveUI; 7 | global using Avalonia.Styling; 8 | global using Microsoft.Extensions.DependencyInjection; 9 | global using ReactiveUI; 10 | global using System.Collections.ObjectModel; 11 | global using System.ComponentModel; 12 | global using System.Diagnostics.CodeAnalysis; 13 | global using System.Reactive; 14 | global using Avalonia.Data.Converters; 15 | global using System.Globalization; -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Properties/rd.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Routers/IMainRoutingViewLocator.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | using Avalonia.ReactiveUI.Toolkit.Routers; 3 | 4 | namespace AntDesign.Sample.Routers; 5 | 6 | public interface IMainRoutingViewLocator : IRoutingViewLocator 7 | { 8 | //bool AddHandler<> 9 | ObservableCollection Routers(); 10 | bool AddRouter(string? token = default, Func? routerNameCallBack = default) 11 | where TView : IViewFor 12 | where TViewModel : ViewModelRoutableBase; 13 | 14 | bool AddGroupRouter(Func? routerNameCallBack); 15 | 16 | bool Navigate(string token); 17 | bool NavigateWithView() where TView : IViewFor; 18 | bool NavigateWithViewModel() where TViewModel : ViewModelRoutableBase; 19 | 20 | bool GoBack(); 21 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Routers/Router.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.Routers; 2 | 3 | namespace AntDesign.Sample.Routers; 4 | public class Router 5 | { 6 | public Router(string token, Func? generator) 7 | { 8 | Token = token; 9 | if (generator is null) 10 | LocalizedString = new(() => Token); 11 | else 12 | LocalizedString = generator; 13 | } 14 | public bool IsPlaceholder { get; set; } = false; 15 | public string Token { get; } 16 | public LocalizedString LocalizedString { get; } 17 | public Type? ViewType { get; set; } 18 | public Type? ViewModelType { get; set; } 19 | 20 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Routers/RouterChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Sample.Routers; 2 | internal class RouterChangedEventArgs 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Services/IThemeService.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Sample.Services; 2 | public interface IThemeService 3 | { 4 | string ActualThemeName { get; } 5 | event EventHandler? ActualThemeVariantChanged; 6 | bool Switch(string themeName); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/AutoCompleteViewModel.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.Models; 2 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 3 | 4 | namespace AntDesign.Sample.ViewModels; 5 | public class AutoCompleteViewModel : ViewModelRoutableBase 6 | { 7 | public AutoCompleteViewModel() 8 | { 9 | for (int i = 0; i < 10; i++) 10 | { 11 | var data = new AutoCompletionModel 12 | { 13 | Name = $"AntDesign-{i}", 14 | Caption = $"AutoCompletion-{i}" 15 | }; 16 | 17 | AutoCompletes.Add(data); 18 | } 19 | } 20 | 21 | public ObservableCollection AutoCompletes { get; } = new(); 22 | 23 | 24 | 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ButtonSpinnerViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ButtonSpinnerViewModel : ViewModelRoutableBase 5 | { 6 | public ButtonSpinnerViewModel() 7 | { 8 | SpinCommand = ReactiveCommand.Create(args => 9 | { 10 | switch (args.Direction) 11 | { 12 | case SpinDirection.Increase: 13 | Message = $"点击了左边的按钮"; 14 | break; 15 | case SpinDirection.Decrease: 16 | Message = $"点击了右边的按钮"; 17 | break; 18 | default: 19 | break; 20 | } 21 | }); 22 | } 23 | 24 | 25 | private string _message = ""; 26 | public string Message 27 | { 28 | get => _message; 29 | set => SetProperty(ref _message, value); 30 | } 31 | 32 | public ReactiveCommand SpinCommand { get; } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ButtonViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ButtonViewModel : ViewModelRoutableBase 5 | { 6 | public ButtonViewModel(IServiceProvider serviceProvider) 7 | { 8 | } 9 | 10 | 11 | 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/CalendarDatePickerViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class CalendarDatePickerViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/CalendarViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class CalendarViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/CarouselViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class CarouselViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/CheckBoxViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class CheckBoxViewModel : ViewModelRoutableBase 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/CollapseViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class CollapseViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ColorPickerViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ColorPickerViewModel : ViewModelRoutableBase 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ComboBoxViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ComboBoxViewModel : ViewModelRoutableBase 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/DataGridViewModel.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.Models; 2 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 3 | 4 | namespace AntDesign.Sample.ViewModels; 5 | public class DataGridViewModel : ViewModelRoutableBase 6 | { 7 | public DataGridViewModel() 8 | { 9 | for (int i = 0; i < 4; i++) 10 | { 11 | var person = new Person() 12 | { 13 | Id = i + 1, 14 | Name = $"John Brown_{i}", 15 | Age = Random.Shared.Next(20, 80), 16 | Address = $"New York No.{i + 1} Lake Park", 17 | Tags = $"NICE DEVELOPER", 18 | Actions = "Invite John Brown Delete", 19 | }; 20 | 21 | Persons.Add(person); 22 | } 23 | } 24 | 25 | public ObservableCollection Persons { get; } = new(); 26 | } 27 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/DatePickerViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class DatePickerViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/DialogsViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class DialogsViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/DropDownButtonViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class DropDownButtonViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/InputViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class InputViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ListBoxViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ListBoxViewModel : ViewModelRoutableBase 5 | { 6 | 7 | public ObservableCollection SelectedItems { get; } = new(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/MenuViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class MenuViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/NumericUpDownViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class NumericUpDownViewModel : ViewModelRoutableBase 5 | { 6 | private string _formater = "{0}"; 7 | public string Formater 8 | { 9 | get => _formater; 10 | set => SetProperty(ref _formater, value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ProgressBarViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ProgressBarViewModel : ViewModelRoutableBase 5 | { 6 | private string _formater = "{0}"; 7 | public string Formater 8 | { 9 | get => _formater; 10 | set => SetProperty(ref _formater, value); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/RadioButtonViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class RadioButtonViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/RepeatButtonViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class RepeatButtonViewModel : ViewModelRoutableBase 5 | { 6 | public RepeatButtonViewModel() 7 | { 8 | RepeatCommand = ReactiveCommand.Create(() => 9 | { 10 | Count++; 11 | }); 12 | } 13 | 14 | private int _count = 0; 15 | public int Count 16 | { 17 | get => _count; 18 | set => SetProperty(ref _count, value); 19 | } 20 | 21 | private string _message = ""; 22 | public string Message 23 | { 24 | get => _message; 25 | set => SetProperty(ref _message, value); 26 | } 27 | 28 | public ReactiveCommand RepeatCommand { get; } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/SliderViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class SliderViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/SplitButtonViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class SplitButtonViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/TabStripViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class TabStripViewModel : ViewModelRoutableBase 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/TabsViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class TabsViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/TextViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class TextViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/TimePickerViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class TimePickerViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ToggleButtonViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ToggleButtonViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ToggleSplitButtonViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ToggleSplitButtonViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/ToggleSwitchViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class ToggleSwitchViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/ViewModels/TreesViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.ReactiveUI.Toolkit.ReactiveObjects; 2 | 3 | namespace AntDesign.Sample.ViewModels; 4 | public class TreesViewModel : ViewModelRoutableBase 5 | { 6 | } 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/AutoCompleteView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class AutoCompleteView : ReactiveUserControl 6 | { 7 | public AutoCompleteView() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ButtonSpinnerView.axaml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Shared/Views/ButtonSpinnerView.axaml.cs -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ButtonView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class ButtonView : ReactiveUserControl 5 | { 6 | public ButtonView() 7 | { 8 | InitializeComponent(); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/CalendarDatePickerView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class CalendarDatePickerView : ReactiveUserControl 5 | { 6 | public CalendarDatePickerView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/CalendarView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class CalendarView : ReactiveUserControl 5 | { 6 | public CalendarView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/CarouselView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class CarouselView : ReactiveUserControl 5 | { 6 | public CarouselView() 7 | { 8 | InitializeComponent(); 9 | //carousel.AutoScrollToSelectedItem = true; 10 | //Carousel carousel = new Carousel(); 11 | //carousel.Previous(); 12 | //carousel.Next(); 13 | //carousel.PageTransition 14 | //FontWeight 15 | //DataGridColumnHeader.Corner 16 | 17 | //CornerRadiusFilterConverter 18 | 19 | //Carousel carousel = new Carousel(); 20 | //carousel.Items 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/CheckBoxView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class CheckBoxView : ReactiveUserControl 6 | { 7 | public CheckBoxView() 8 | { 9 | InitializeComponent(); 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/CollapseView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class CollapseView : ReactiveUserControl 5 | { 6 | public CollapseView() 7 | { 8 | InitializeComponent(); 9 | 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ColorPickerView.axaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ColorPickerView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls.Primitives; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class ColorPickerView : ReactiveUserControl 6 | { 7 | public ColorPickerView() 8 | { 9 | InitializeComponent(); 10 | //ColorPreviewer.PaddingProperty 11 | //ColorSlider 12 | 13 | //TabControl.CornerRadiusProperty 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ColorPickerViewEx.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls.Primitives; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class ColorPickerViewEx : ReactiveUserControl 6 | { 7 | public ColorPickerViewEx() 8 | { 9 | InitializeComponent(); 10 | //ColorPreviewer.PaddingProperty 11 | //ColorSlider 12 | 13 | //TabControl.CornerRadiusProperty 14 | 15 | //VisualBrush 16 | //Track.BoundsProperty 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ComboBoxView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class ComboBoxView : ReactiveUserControl 5 | { 6 | public ComboBoxView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/DataGridView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using DataGridView = Avalonia.Controls.DataGrid; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class DataGridView : ReactiveUserControl 6 | { 7 | public DataGridView() 8 | { 9 | InitializeComponent(); 10 | 11 | //DataGridTextColumn dataGridTextColumn = new DataGridTextColumn(); 12 | //dataGridTextColumn.SortMemberPath 13 | 14 | //DataGridColumnHeader dataGridColumnHeader = new DataGridColumnHeader(); 15 | //DataGridView dataGridView = new DataGridView(); 16 | //dataGridView.RowHeaderWidth 17 | //Avalonia.Controls.DataGrid.RowHeaderWidthProperty 18 | 19 | //ControlTheme. 20 | //DataGridRow 21 | //DataGridCell 22 | 23 | //DataGridCellsPresenter 24 | 25 | //DataGridColumnHeadersPresenter 26 | 27 | //File.Copy() 28 | 29 | //DataGrid dataGrid = new DataGrid(); 30 | //DataGridRow row = new DataGridRow(); 31 | 32 | //dataGrid.DataTemplates 33 | 34 | //DataGrid.SelectedItems 35 | //Border.BoxShadowProperty 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/DatePickerView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class DatePickerView : ReactiveUserControl 5 | { 6 | public DatePickerView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/DialogsView.axaml.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Shared/Views/DialogsView.axaml.cs -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/DropDownButtonView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class DropDownButtonView : ReactiveUserControl 5 | { 6 | public DropDownButtonView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/InputView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class InputView : ReactiveUserControl 5 | { 6 | public InputView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ListBoxView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class ListBoxView : ReactiveUserControl 5 | { 6 | public ListBoxView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/MainView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | 5 | public partial class MainView : ReactiveUserControl 6 | { 7 | public MainView() 8 | { 9 | InitializeComponent(); 10 | //Popup.WindowManagerAddShadowHintProperty 11 | // ListBox.ItemContainerTheme 12 | //ListBox.ItemContainerThemeProperty 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/MainWindow.axaml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/MainWindow.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | 5 | public partial class MainWindow : ReactiveWindow 6 | { 7 | public MainWindow() 8 | { 9 | InitializeComponent(); 10 | //ShowInTaskbar 11 | //WindowStartupLocation= 12 | } 13 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/MenuView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls.Primitives; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class MenuView : ReactiveUserControl 6 | { 7 | public MenuView() 8 | { 9 | InitializeComponent(); 10 | //Popup 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/NumericUpDownView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class NumericUpDownView : ReactiveUserControl 5 | { 6 | public NumericUpDownView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/OverviewView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls.Primitives; 3 | 4 | namespace AntDesign.Sample.Views; 5 | 6 | public partial class OverviewView : ReactiveUserControl 7 | { 8 | public OverviewView() 9 | { 10 | InitializeComponent(); 11 | //Button.IsPressedProperty 12 | //Popup.HorizontalOffsetProperty 13 | //ContentPresenter.ForegroundProperty 14 | //ContentPresenter.BorderThicknessProperty 15 | 16 | //var vm = new OverviewView(); 17 | 18 | //JsonSerializer.Serialize(vm, JsonSerializerOptions.); 19 | //new Binding 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ProgressBarView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class ProgressBarView : ReactiveUserControl 5 | { 6 | public ProgressBarView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/RadioButtonView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class RadioButtonView : ReactiveUserControl 5 | { 6 | public RadioButtonView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/RepeatButtonView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class RepeatButtonView : ReactiveUserControl 5 | { 6 | public RepeatButtonView() 7 | { 8 | InitializeComponent(); 9 | 10 | PART_RepeatButton.Click += PART_RepeatButton_Click; 11 | } 12 | 13 | int _count; 14 | private void PART_RepeatButton_Click(object? sender, RoutedEventArgs e) 15 | { 16 | 17 | PART_TextBlock.Text = $"{_count++}"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/SliderView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class SliderView : ReactiveUserControl 5 | { 6 | public SliderView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/SplitButtonView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class SplitButtonView : ReactiveUserControl 5 | { 6 | public SplitButtonView() 7 | { 8 | InitializeComponent(); 9 | //ToggleSplitButton 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/SwitchView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class SwitchView : UserControl 5 | { 6 | public SwitchView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/TabStripView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class TabStripView : ReactiveUserControl 6 | { 7 | public TabStripView() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/TabsView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls.Presenters; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class TabsView : ReactiveUserControl 6 | { 7 | public TabsView() 8 | { 9 | InitializeComponent(); 10 | //ItemsPresenter.VerticalAlignmentProperty 11 | //TabControl.TabStripPlacementProperty 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/TextView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class TextView : ReactiveUserControl 5 | { 6 | public TextView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/TimePickerView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class TimePickerView : ReactiveUserControl 5 | { 6 | public TimePickerView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ToggleButtonView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | 3 | namespace AntDesign.Sample.Views; 4 | public partial class ToggleButtonView : ReactiveUserControl 5 | { 6 | public ToggleButtonView() 7 | { 8 | InitializeComponent(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ToggleSplitButtonView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls.Converters; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class ToggleSplitButtonView : ReactiveUserControl 6 | { 7 | public ToggleSplitButtonView() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/ToggleSwitchView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Controls; 3 | using Avalonia.Media; 4 | 5 | namespace AntDesign.Sample.Views; 6 | public partial class ToggleSwitchView : ReactiveUserControl 7 | { 8 | public ToggleSwitchView() 9 | { 10 | InitializeComponent(); 11 | //TranslateTransform 12 | //ToggleSwitch.CheckedEvent 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Shared/Views/TreesView.axaml.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample.ViewModels; 2 | using Avalonia.Markup.Xaml.MarkupExtensions; 3 | 4 | namespace AntDesign.Sample.Views; 5 | public partial class TreesView : ReactiveUserControl 6 | { 7 | public TreesView() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/AppBundle/Logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/AppBundle/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroSugarDeveloperOrg/AntDesign.Avalonia/bde1bb4692d1c710292276c5e946538013bab51a/Source/Samples/AntDesign.Sample.Web/AppBundle/favicon.ico -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/AppBundle/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AntDesign.Avalonia.Web 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |

21 | Powered by 22 | Avalonia UI 23 |

24 |
25 | Avalonia Logo 26 |
27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/AppBundle/main.js: -------------------------------------------------------------------------------- 1 | import { dotnet } from './dotnet.js' 2 | 3 | const is_browser = typeof window != "undefined"; 4 | if (!is_browser) throw new Error(`Expected to be running in a browser`); 5 | 6 | const dotnetRuntime = await dotnet 7 | .withDiagnosticTracing(false) 8 | .withApplicationArgumentsFromQuery() 9 | .create(); 10 | 11 | const config = dotnetRuntime.getConfig(); 12 | 13 | await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]); -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/Program.cs: -------------------------------------------------------------------------------- 1 | using AntDesign.Sample; 2 | using Avalonia; 3 | using Avalonia.Browser; 4 | using Avalonia.ReactiveUI; 5 | using AntDesign.FontManager; 6 | using System.Runtime.Versioning; 7 | 8 | [assembly: SupportedOSPlatform("browser")] 9 | 10 | internal partial class Program 11 | { 12 | private static async Task Main(string[] args) 13 | { 14 | await BuildAvaloniaApp() 15 | .UseReactiveUI() 16 | .UseAntDesignFontManager() 17 | .StartBrowserAppAsync("out"); 18 | } 19 | 20 | public static AppBuilder BuildAvaloniaApp() 21 | => AppBuilder.Configure(); 22 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "AntDesign.Avalonia.Web": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "environmentVariables": { 7 | "ASPNETCORE_ENVIRONMENT": "Development" 8 | }, 9 | "applicationUrl": "https://localhost:8001;http://localhost:8000", 10 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/debug?browser={browserInspectUri}" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/Properties/rd.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.Web/runtimeconfig.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "wasmHostProperties": { 3 | "perHostConfig": [ 4 | { 5 | "name": "browser", 6 | "html-path": "index.html", 7 | "Host": "browser" 8 | } 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.iOS/AntDesign.Sample.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Exe 4 | net7.0-ios 5 | 10.0 6 | manual 7 | iossimulator-x64 8 | AntDesign.Sample 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.iOS; 3 | using Avalonia.ReactiveUI; 4 | using AntDesign.FontManager; 5 | 6 | namespace AntDesign.Sample; 7 | 8 | // The UIApplicationDelegate for the application. This class is responsible for launching the 9 | // User Interface of the application, as well as listening (and optionally responding) to 10 | // application events from iOS. 11 | [Register("AppDelegate")] 12 | public partial class AppDelegate : AvaloniaAppDelegate 13 | { 14 | protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) 15 | { 16 | return builder.UseReactiveUI().UseAntDesignFontManager(); 17 | } 18 | } -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Samples/AntDesign.Sample.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | namespace AntDesign.Sample; 2 | 3 | public class Application 4 | { 5 | // This is the main entry point of the application. 6 | static void Main(string[] args) 7 | { 8 | // if you want to use a different Application Delegate class from "AppDelegate" 9 | // you can specify it here. 10 | UIApplication.Main(args, null, typeof(AppDelegate)); 11 | } 12 | } -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "7.0.100", 4 | "allowPrerelease": true, 5 | "rollForward": "latestMajor" 6 | } 7 | } 8 | --------------------------------------------------------------------------------