├── Samples
├── ReadMe.txt
├── Demo
│ ├── Resources
│ │ ├── Sun.png
│ │ ├── Cart.png
│ │ ├── Email.png
│ │ ├── Filter.png
│ │ ├── Search.png
│ │ ├── Family-Guy.png
│ │ ├── Gmail-Logo.png
│ │ ├── Icon-None.png
│ │ ├── Menu-Flex.png
│ │ ├── Menu-Grid.png
│ │ ├── Menu-Home.png
│ │ ├── Menu-Image.png
│ │ ├── Menu-Misc.png
│ │ ├── Menu-Paper.png
│ │ ├── Menu-Path.png
│ │ ├── Menu-Pixy.png
│ │ ├── Menu-Popup.png
│ │ ├── Scooby-Doo.png
│ │ ├── American-Flag.png
│ │ ├── Bobs-Burgers.jpg
│ │ ├── ElectricRed.jpg
│ │ ├── Frogui-Logo-a.png
│ │ ├── Frogui-Logo.png
│ │ ├── Lesarde-Logo.png
│ │ ├── Menu-Border.png
│ │ ├── Menu-Button.png
│ │ ├── Menu-CheckBox.png
│ │ ├── Menu-Droplist.png
│ │ ├── Menu-Ellipse.png
│ │ ├── Menu-ListBox.png
│ │ ├── Menu-Slider.png
│ │ ├── Menu-TextBox.png
│ │ ├── The-Jetsons.jpg
│ │ ├── The-Simpsons.jpg
│ │ ├── Checkered-Dark.png
│ │ ├── Checkered-Light.png
│ │ ├── Disenchantment.jpg
│ │ ├── Menu-HtmlBlock.png
│ │ ├── Menu-Rectangle.png
│ │ ├── Menu-ScrollBar.png
│ │ ├── Menu-TextBlock.png
│ │ ├── The-Flintstones.jpg
│ │ ├── Checkered-Medium.png
│ │ ├── King-Of-The-Hill.png
│ │ ├── Menu-ItemsControl.png
│ │ ├── Menu-NumericEdit.png
│ │ ├── Menu-RadioButton.png
│ │ ├── Menu-ScrollViewer.png
│ │ ├── Icon-VaryDesign-Sign.png
│ │ ├── Icon-BrushVariety-Image.png
│ │ ├── Icon-BrushVariety-Solid.png
│ │ ├── Icon-FontStretch-Normal.png
│ │ ├── Icon-TextAlignment-Left.png
│ │ ├── Icon-VaryDesign-Arrow.png
│ │ ├── Icon-VaryDesign-Chevron.png
│ │ ├── Icon-FontStretch-Expanded.png
│ │ ├── Icon-Orientation-Vertical.png
│ │ ├── Icon-StrokePattern-Dashed.png
│ │ ├── Icon-StrokePattern-Dotted.png
│ │ ├── Icon-StrokePattern-Double.png
│ │ ├── Icon-StrokePattern-Groove.png
│ │ ├── Icon-StrokePattern-Inset.png
│ │ ├── Icon-StrokePattern-Outset.png
│ │ ├── Icon-StrokePattern-Ridge.png
│ │ ├── Icon-StrokePattern-Solid.png
│ │ ├── Icon-TextAlignment-Center.png
│ │ ├── Icon-TextAlignment-Right.png
│ │ ├── Icon-VaryDesign-LineArrow.png
│ │ ├── Icon-VaryDesign-Triangle.png
│ │ ├── Icon-FontStretch-Condensed.png
│ │ ├── Icon-Orientation-Horizontal.png
│ │ ├── Icon-PopupPlacementMode-Left.png
│ │ ├── Icon-PopupPlacementMode-Top.png
│ │ ├── Icon-TextAlignment-Justify.png
│ │ ├── Icon-TrackEdgeDesign-Round.png
│ │ ├── Icon-TrackEdgeDesign-Square.png
│ │ ├── Icon-FontStretch-ExtraExpanded.png
│ │ ├── Icon-FontStretch-SemiCondensed.png
│ │ ├── Icon-FontStretch-SemiExpanded.png
│ │ ├── Icon-FontStretch-UltraExpanded.png
│ │ ├── Icon-PixyLayout-TextAboveImage.png
│ │ ├── Icon-PixyLayout-TextBelowImage.png
│ │ ├── Icon-PopupPlacementMode-Bottom.png
│ │ ├── Icon-PopupPlacementMode-Center.png
│ │ ├── Icon-PopupPlacementMode-Right.png
│ │ ├── Icon-TextDecorationStyle-Solid.png
│ │ ├── Icon-TextDecorationStyle-Wavy.png
│ │ ├── Icon-TrackEdgeDesign-HalfRound.png
│ │ ├── Icon-BrushVariety-LinearGradient.png
│ │ ├── Icon-BrushVariety-RadialGradient.png
│ │ ├── Icon-ButtonAccentDesign-OutArrow.png
│ │ ├── Icon-FontStretch-ExtraCondensed.png
│ │ ├── Icon-FontStretch-UltraCondensed.png
│ │ ├── Icon-PixyLayout-TextLeftOfImage.png
│ │ ├── Icon-PixyLayout-TextRightOfImage.png
│ │ ├── Icon-PopupPlacementMode-Absolute.png
│ │ ├── Icon-PopupPlacementMode-Pointer.png
│ │ ├── Icon-PopupPlacementMode-Relative.png
│ │ ├── Icon-TextDecorationLines-Overline.png
│ │ ├── Icon-TextDecorationStyle-Dashed.png
│ │ ├── Icon-TextDecorationStyle-Dotted.png
│ │ ├── Icon-TextDecorationStyle-Double.png
│ │ ├── Icon-TrackEdgeDesign-QuarterRound.png
│ │ ├── Icon-TextDecorationLines-Underline.png
│ │ ├── Icon-PopupPlacementMode-AbsolutePoint.png
│ │ ├── Icon-PopupPlacementMode-PointerPoint.png
│ │ ├── Icon-PopupPlacementMode-RelativePoint.png
│ │ └── Icon-TextDecorationLines-Strikethrough.png
│ ├── libman.json
│ ├── IExampleView.cs
│ ├── Shared
│ │ ├── PersonView.cs
│ │ ├── CartoonView.cs
│ │ ├── BitmapInfoView.cs
│ │ ├── BrushInfoView.xaml
│ │ ├── BrushInfo.cs
│ │ ├── CartoonModel.cs
│ │ ├── CartoonView.xaml
│ │ ├── BitmapInfoView.xaml
│ │ ├── StringView.cs
│ │ ├── WrappingFlex.cs
│ │ ├── BrushInfoView.cs
│ │ ├── PersonView.xaml
│ │ ├── Brushes.cs
│ │ ├── Bitmaps.cs
│ │ ├── ImageBrushes.cs
│ │ ├── LinearGradientBrushes.cs
│ │ └── RadialGradientBrushes.cs
│ ├── Examples
│ │ ├── Path
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Flex
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Grid
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Pixy
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Border
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Image
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Ellipse
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── TextBox
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── HtmlBlock
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Rectangle
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── TextBlock
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── NumericEdit
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Slider
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Droplist
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── _Misc
│ │ │ ├── Animation A
│ │ │ │ ├── View.xaml
│ │ │ │ └── View.cs
│ │ │ ├── Home
│ │ │ │ └── View.xaml
│ │ │ ├── Binding A
│ │ │ │ ├── View.cs
│ │ │ │ └── View.xaml
│ │ │ ├── Calculator
│ │ │ │ ├── MyAssets.xaml
│ │ │ │ └── View.cs
│ │ │ ├── Tip Calculator
│ │ │ │ ├── MoneyBlock.cs
│ │ │ │ ├── Money.cs
│ │ │ │ ├── View.cs
│ │ │ │ └── View.xaml
│ │ │ ├── Alignment Properties
│ │ │ │ └── View.cs
│ │ │ └── Observable A
│ │ │ │ ├── View.cs
│ │ │ │ └── View.xaml
│ │ ├── ListBox
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── ItemsControl
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── ScrollBar
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── ScrollViewer
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ ├── Button
│ │ │ ├── View.cs
│ │ │ └── View.xaml
│ │ ├── CheckBox
│ │ │ ├── View.cs
│ │ │ └── View.xaml
│ │ ├── RadioButton
│ │ │ ├── View.cs
│ │ │ └── View.xaml
│ │ ├── Popup
│ │ │ ├── View.xaml
│ │ │ └── View.cs
│ │ └── Paper
│ │ │ ├── View.cs
│ │ │ └── View.xaml
│ ├── Editors
│ │ ├── BrushVariety.cs
│ │ ├── PercentEditor.cs
│ │ ├── FontWeightEditor.cs
│ │ ├── BorderPatternEditor.cs
│ │ ├── IEditor.cs
│ │ ├── BooleanEditor.cs
│ │ ├── Segment.cs
│ │ ├── DoubleEditor.cs
│ │ ├── DecimalEditor.cs
│ │ ├── MagicSegmenter.cs
│ │ ├── EnumTextEditor.cs
│ │ ├── TextEditor.cs
│ │ ├── LengthEditorBase.cs
│ │ ├── EnumImageEditor.cs
│ │ ├── DoubleSlider.cs
│ │ ├── BrushEditor.cs
│ │ ├── ItemsSourceEditor.cs
│ │ ├── MagicSlider.cs
│ │ ├── NullableSolidColorBrushEditor.cs
│ │ ├── FontSizeEditor.cs
│ │ ├── ThicknessEditor.cs
│ │ ├── CornerRadiusEditor.cs
│ │ ├── FontFamilyEditor.cs
│ │ ├── CheckedEditorPart.cs
│ │ ├── LengthEditor.cs
│ │ ├── AngleEditor.cs
│ │ ├── IntEditor.cs
│ │ ├── EffectEditor.cs
│ │ ├── BrushSlider.cs
│ │ └── EnumEditor.cs
│ ├── Program.cs
│ ├── App.cs
│ ├── Example.cs
│ ├── PresetSelector.cs
│ ├── App.xaml
│ └── MainWindow.xaml
├── Console
│ ├── HelloFriend
│ │ ├── libman.json
│ │ ├── Program.cs
│ │ ├── App.cs
│ │ └── HelloFriend.csproj
│ ├── HelloWorld
│ │ ├── Program.cs
│ │ ├── App.cs
│ │ └── HelloWorld.csproj
│ └── ReadKeyFun
│ │ ├── Program.cs
│ │ ├── ReadKeyFun.csproj
│ │ └── App.cs
├── HelloWorldA
│ ├── App.xaml
│ ├── Greeting.xaml
│ ├── Greeting.cs
│ ├── Program.cs
│ ├── App.cs
│ └── HelloWorldA.csproj
├── HelloWorldB
│ ├── App.xaml
│ ├── Greeting.xaml
│ ├── Model.cs
│ ├── Program.cs
│ ├── App.cs
│ ├── Greeting.cs
│ └── HelloWorldB.csproj
├── HelloWorldC
│ ├── App.xaml
│ ├── Greeting.xaml
│ ├── Program.cs
│ ├── App.cs
│ ├── Greeting.cs
│ ├── HelloWorldC.csproj
│ └── ViewModel.cs
└── Readme.md
├── README.md
└── .gitignore
/Samples/ReadMe.txt:
--------------------------------------------------------------------------------
1 | Frogui Samples
2 | ==============
3 |
4 |
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Sun.png
--------------------------------------------------------------------------------
/Samples/Demo/libman.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "defaultProvider": "cdnjs",
4 | "libraries": []
5 | }
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Cart.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Email.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Filter.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Search.png
--------------------------------------------------------------------------------
/Samples/Console/HelloFriend/libman.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0",
3 | "defaultProvider": "cdnjs",
4 | "libraries": []
5 | }
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Family-Guy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Family-Guy.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Gmail-Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Gmail-Logo.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-None.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-None.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Flex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Flex.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Grid.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Home.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Image.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Misc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Misc.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Paper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Paper.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Path.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Path.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Pixy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Pixy.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Popup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Popup.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Scooby-Doo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Scooby-Doo.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/American-Flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/American-Flag.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Bobs-Burgers.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Bobs-Burgers.jpg
--------------------------------------------------------------------------------
/Samples/Demo/Resources/ElectricRed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/ElectricRed.jpg
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Frogui-Logo-a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Frogui-Logo-a.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Frogui-Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Frogui-Logo.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Lesarde-Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Lesarde-Logo.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Border.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Button.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-CheckBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-CheckBox.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Droplist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Droplist.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Ellipse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Ellipse.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-ListBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-ListBox.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Slider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Slider.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-TextBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-TextBox.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/The-Jetsons.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/The-Jetsons.jpg
--------------------------------------------------------------------------------
/Samples/Demo/Resources/The-Simpsons.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/The-Simpsons.jpg
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Checkered-Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Checkered-Dark.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Checkered-Light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Checkered-Light.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Disenchantment.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Disenchantment.jpg
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-HtmlBlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-HtmlBlock.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-Rectangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-Rectangle.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-ScrollBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-ScrollBar.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-TextBlock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-TextBlock.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/The-Flintstones.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/The-Flintstones.jpg
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Checkered-Medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Checkered-Medium.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/King-Of-The-Hill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/King-Of-The-Hill.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-ItemsControl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-ItemsControl.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-NumericEdit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-NumericEdit.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-RadioButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-RadioButton.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Menu-ScrollViewer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Menu-ScrollViewer.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-VaryDesign-Sign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-VaryDesign-Sign.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-BrushVariety-Image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-BrushVariety-Image.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-BrushVariety-Solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-BrushVariety-Solid.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-Normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-Normal.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextAlignment-Left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextAlignment-Left.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-VaryDesign-Arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-VaryDesign-Arrow.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-VaryDesign-Chevron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-VaryDesign-Chevron.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-Expanded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-Expanded.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-Orientation-Vertical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-Orientation-Vertical.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Dashed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Dashed.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Dotted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Dotted.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Double.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Double.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Groove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Groove.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Inset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Inset.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Outset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Outset.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Ridge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Ridge.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-StrokePattern-Solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-StrokePattern-Solid.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextAlignment-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextAlignment-Center.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextAlignment-Right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextAlignment-Right.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-VaryDesign-LineArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-VaryDesign-LineArrow.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-VaryDesign-Triangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-VaryDesign-Triangle.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-Condensed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-Condensed.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-Orientation-Horizontal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-Orientation-Horizontal.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Left.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Top.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextAlignment-Justify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextAlignment-Justify.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TrackEdgeDesign-Round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TrackEdgeDesign-Round.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TrackEdgeDesign-Square.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TrackEdgeDesign-Square.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-ExtraExpanded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-ExtraExpanded.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-SemiCondensed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-SemiCondensed.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-SemiExpanded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-SemiExpanded.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-UltraExpanded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-UltraExpanded.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PixyLayout-TextAboveImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PixyLayout-TextAboveImage.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PixyLayout-TextBelowImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PixyLayout-TextBelowImage.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Bottom.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Center.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Right.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationStyle-Solid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationStyle-Solid.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationStyle-Wavy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationStyle-Wavy.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TrackEdgeDesign-HalfRound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TrackEdgeDesign-HalfRound.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-BrushVariety-LinearGradient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-BrushVariety-LinearGradient.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-BrushVariety-RadialGradient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-BrushVariety-RadialGradient.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-ButtonAccentDesign-OutArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-ButtonAccentDesign-OutArrow.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-ExtraCondensed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-ExtraCondensed.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-FontStretch-UltraCondensed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-FontStretch-UltraCondensed.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PixyLayout-TextLeftOfImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PixyLayout-TextLeftOfImage.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PixyLayout-TextRightOfImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PixyLayout-TextRightOfImage.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Absolute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Absolute.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Pointer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Pointer.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-Relative.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-Relative.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationLines-Overline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationLines-Overline.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationStyle-Dashed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationStyle-Dashed.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationStyle-Dotted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationStyle-Dotted.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationStyle-Double.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationStyle-Double.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TrackEdgeDesign-QuarterRound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TrackEdgeDesign-QuarterRound.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationLines-Underline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationLines-Underline.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-AbsolutePoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-AbsolutePoint.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-PointerPoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-PointerPoint.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-PopupPlacementMode-RelativePoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-PopupPlacementMode-RelativePoint.png
--------------------------------------------------------------------------------
/Samples/Demo/Resources/Icon-TextDecorationLines-Strikethrough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lesarde-co/frogui/HEAD/Samples/Demo/Resources/Icon-TextDecorationLines-Strikethrough.png
--------------------------------------------------------------------------------
/Samples/Demo/IExampleView.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using System;
3 |
4 | namespace Demo
5 | {
6 | public interface IExampleView
7 | {
8 | Element MainElement { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/PersonView.cs:
--------------------------------------------------------------------------------
1 | namespace Demo
2 | {
3 | public partial class PersonView : Lesarde.Frogui.Controls.Grid
4 | {
5 | public PersonView()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/CartoonView.cs:
--------------------------------------------------------------------------------
1 | namespace Demo
2 | {
3 | public partial class CartoonView : Lesarde.Frogui.Controls.Border
4 | {
5 | public CartoonView()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/BitmapInfoView.cs:
--------------------------------------------------------------------------------
1 | namespace Demo
2 | {
3 | public partial class BitmapInfoView : Lesarde.Frogui.Controls.Border
4 | {
5 | public BitmapInfoView()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Path/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Flex/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Grid/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Pixy/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Border/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Image/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Ellipse/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/TextBox/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/HtmlBlock/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Rectangle/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/TextBlock/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/NumericEdit/View.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Slider/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Droplist/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Animation A/View.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
--------------------------------------------------------------------------------
/Samples/HelloWorldA/App.xaml:
--------------------------------------------------------------------------------
1 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/HelloWorldB/App.xaml:
--------------------------------------------------------------------------------
1 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/HelloWorldC/App.xaml:
--------------------------------------------------------------------------------
1 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/BrushVariety.cs:
--------------------------------------------------------------------------------
1 | using Lesarde;
2 | using System;
3 |
4 | namespace Demo
5 | {
6 | [Flags]
7 | public enum BrushVariety : uint
8 | {
9 | None = FLAG.Flag_01,
10 | Solid = FLAG.Flag_02,
11 | LinearGradient = FLAG.Flag_03,
12 | RadialGradient = FLAG.Flag_04,
13 | Image = FLAG.Flag_05
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ListBox/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ItemsControl/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/PercentEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Data;
4 |
5 | namespace Demo
6 | {
7 | public class PercentEditor : DoubleSlider
8 | {
9 | public PercentEditor()
10 | {
11 | SmallChange = 0.01m;
12 | LargeChange = SmallChange;
13 | Maximum = 1.0m;
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/FontWeightEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui.Media;
2 |
3 | namespace Demo
4 | {
5 | public class FontWeightEditor : EnumEditor
6 | {
7 | protected override void PrepSegment(Segment segment, string name, FontWeightKind value)
8 | {
9 | segment.Text = name;
10 | segment.Value = FontWeight.FromKind(value);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ScrollBar/View.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Home/View.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/BorderPatternEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 |
5 | namespace Demo
6 | {
7 | public class BorderPatternEditor : EnumEditor
8 | {
9 | protected override void PrepSegment(Segment segment, string name, StrokePattern value)
10 | {
11 | segment.Text = name;
12 | segment.Value = new BorderPattern(value);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Samples/HelloWorldB/Greeting.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/BrushInfoView.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
--------------------------------------------------------------------------------
/Samples/HelloWorldA/Greeting.xaml:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/Samples/HelloWorldC/Greeting.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/BrushInfo.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui.Media;
2 |
3 | namespace Demo
4 | {
5 | /***************************************************************************************************
6 | BrushInfo class
7 | ***************************************************************************************************/
8 |
9 | public class BrushInfo
10 | {
11 | public Brush Brush { get; set; }
12 | public string Name { get; set; }
13 |
14 | public string BrushTypeName => Brush.GetType().Name;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ScrollViewer/View.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/CartoonModel.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui.Media;
2 | using static Demo.Bitmaps;
3 |
4 | namespace Demo
5 | {
6 | public class CartoonModel
7 | {
8 | public string Name { get; set; }
9 | public string Producer { get; set; }
10 | public string StartYear { get; set; }
11 | public ImageSource Image { get; set; }
12 |
13 | public CartoonModel(BitmapInfo info, string producer, string startYear)
14 | {
15 | Name = info.Name;
16 | Image = info.Bitmap;
17 | Producer = producer;
18 | StartYear = startYear;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/Demo/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Demo
4 | {
5 | /***************************************************************************************************
6 | Program class
7 | ***************************************************************************************************/
8 | ///
9 | /// This class contain the the app's entry point method.
10 | ///
11 | public class Program
12 | {
13 | static void Main(string[] args)
14 | {
15 | // Create and run the app
16 | var app = new App();
17 | app.Run();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Pixy/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_Pixy
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the element.
11 | ///
12 | public partial class View : Decorator, IExampleView
13 | {
14 | Element IExampleView.MainElement => e_pixy;
15 |
16 | public View()
17 | {
18 | InitializeComponent();
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/Samples/Demo/Editors/IEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 |
3 | namespace Demo
4 | {
5 | /***************************************************************************************************
6 |
7 | public interface IEditor class
8 | ***************************************************************************************************/
9 | ///
10 | /// Interface for a property editor. A property editor is a control designed to a
11 | /// of an .
12 | ///
13 | public interface IEditor
14 | {
15 | void BindIt(Element targetObject, DependencyProperty targetProperty);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/BooleanEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 |
6 | namespace Demo
7 | {
8 | public class BooleanEditor : CheckBox, IPropertyEditor
9 | {
10 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty)
11 | {
12 | SetBinding(CheckBox.IsCheckedProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
13 | }
14 |
15 | public BooleanEditor()
16 | {
17 | BorderThickness = Length.ZeroPx;
18 | CornerRadius = CornerRadius.InPixels(2);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Button/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_Button
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the class.
11 | ///
12 | public partial class View : Decorator, IExampleView
13 | {
14 | public View()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | Element IExampleView.MainElement => e_button;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/CheckBox/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_CheckBox
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the class.
11 | ///
12 | public partial class View : Flex, IExampleView
13 | {
14 | public View()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | Element IExampleView.MainElement => e_checkBox;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/HtmlBlock/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_HtmlBlock
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the element.
11 | ///
12 | public partial class View : Decorator, IExampleView
13 | {
14 | Element IExampleView.MainElement => e_htmlBlock;
15 |
16 | public View()
17 | {
18 | InitializeComponent();
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/RadioButton/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_RadioButton
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the class.
11 | ///
12 | public partial class View : Flex, IExampleView
13 | {
14 | public View()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | Element IExampleView.MainElement => e_radioButton;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Image/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Shapes;
4 |
5 | namespace Demo.Example_Image
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the element.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | Element IExampleView.MainElement => e_image;
16 |
17 | public View()
18 | {
19 | InitializeComponent();
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Border/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Shapes;
4 |
5 | namespace Demo.Example_Border
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the element.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | Element IExampleView.MainElement => e_border;
16 |
17 | public View()
18 | {
19 | InitializeComponent();
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/NumericEdit/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_NumericEdit
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the element.
11 | ///
12 | public partial class View : Decorator, IExampleView
13 | {
14 | Element IExampleView.MainElement => e_numericEdit;
15 |
16 | public View()
17 | {
18 | InitializeComponent();
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/TextBox/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Shapes;
4 |
5 | namespace Demo.Example_TextBox
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the element.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | Element IExampleView.MainElement => e_textBox;
16 |
17 | public View()
18 | {
19 | InitializeComponent();
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Rectangle/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Shapes;
4 |
5 | namespace Demo.Example_Rectangle
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the element.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | Element IExampleView.MainElement => e_rectangle;
16 |
17 | public View()
18 | {
19 | InitializeComponent();
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/TextBlock/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Shapes;
4 |
5 | namespace Demo.Example_TextBlock
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the element.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | Element IExampleView.MainElement => e_textBlock;
16 |
17 | public View()
18 | {
19 | InitializeComponent();
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Ellipse/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Shapes;
4 |
5 | namespace Demo.Example_Ellipse
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the element.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | Element IExampleView.MainElement => e_ellipse;
16 |
17 | public View()
18 | {
19 | InitializeComponent();
20 | }
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ListBox/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_ListBox
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the class.
11 | ///
12 | public partial class View : Decorator, IExampleView
13 | {
14 | Element IExampleView.MainElement => e_listBox;
15 |
16 | public View()
17 | {
18 | InitializeComponent();
19 |
20 | e_listBox.ItemViewMatcher = Common.ItemsControlViewMatcher;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Droplist/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_Droplist
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the class.
11 | ///
12 | public partial class View : Decorator, IExampleView
13 | {
14 | Element IExampleView.MainElement => e_droplist;
15 |
16 | public View()
17 | {
18 | InitializeComponent();
19 |
20 | e_droplist.ItemViewMatcher = Common.ItemsControlViewMatcher;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Samples/Console/HelloFriend/Program.cs:
--------------------------------------------------------------------------------
1 | namespace HelloFriend
2 | {
3 | /***************************************************************************************************
4 | Program class
5 | ***************************************************************************************************/
6 | ///
7 | /// Demonstrates how to read and write to the console.
8 | ///
9 | class Program
10 | {
11 | ///
12 | /// This is the app entry point. Console processing should be done in
13 | /// .
14 | ///
15 | static void Main(string[] args)
16 | {
17 | // Create and run the app
18 | var app = new App();
19 | app.ScopeType = typeof(Lesarde.Frogui.Scope);
20 |
21 | app.Run();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Samples/Console/HelloWorld/Program.cs:
--------------------------------------------------------------------------------
1 | namespace HelloWorldA
2 | {
3 | /***************************************************************************************************
4 | Program class
5 | ***************************************************************************************************/
6 | ///
7 | /// Demonstrates the classic Hello World app in a console.
8 | ///
9 | class Program
10 | {
11 | ///
12 | /// This is the app entry point. Console processing should be done in
13 | /// .
14 | ///
15 | static void Main(string[] args)
16 | {
17 | // Create and run the app
18 | var app = new App();
19 | app.ScopeType = typeof(Lesarde.Frogui.Scope);
20 |
21 | app.Run();
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/Samples/Demo/Editors/Segment.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Media.Imaging;
3 | using System;
4 |
5 | namespace Demo
6 | {
7 | /***************************************************************************************************
8 | Segment class
9 | ***************************************************************************************************/
10 | ///
11 | /// Model for an item in a . Derives from
12 | /// so has and properties,
13 | /// and adds a property.
14 | ///
15 | public class Segment : PixyModel
16 | {
17 | public object Value { get; set; }
18 |
19 | public Segment() { }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ItemsControl/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Shapes;
4 |
5 | namespace Demo.Example_ItemsControl
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the class.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | public View()
16 | {
17 | InitializeComponent();
18 |
19 | e_itemsControl.ItemViewMatcher = Common.ItemsControlViewMatcher;
20 | }
21 |
22 | Element IExampleView.MainElement => e_itemsControl;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Binding A/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using System;
4 | using System.Reactive.Linq;
5 |
6 | namespace Demo.Example_Binding_A
7 | {
8 | /***************************************************************************************************
9 | View class
10 | ***************************************************************************************************/
11 | ///
12 | /// Demonstrates the class.
13 | ///
14 | public partial class View : Flex, IExampleView
15 | {
16 | public View()
17 | {
18 | InitializeComponent();
19 |
20 | e_tb1.DataContext = e_tb2;
21 | e_tb2.DataContext = e_tb3;
22 |
23 | }
24 |
25 | Element IExampleView.MainElement => this;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/DoubleEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 |
6 | namespace Demo
7 | {
8 | public class DoubleEditor : NumericEdit, IPropertyEditor
9 | {
10 | /*******************************************************************************
11 | BindToSourceProperty()
12 | *******************************************************************************/
13 |
14 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(NumberDoubleProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
15 |
16 | public DoubleEditor()
17 | {
18 | TypeFilter = NumericTypeFilter.Double;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Samples/HelloWorldA/Greeting.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 |
5 | namespace HelloWorldA
6 | {
7 | /***************************************************************************************************
8 | Greeting class
9 | ***************************************************************************************************/
10 | ///
11 | /// This class is a that displays "Hello, World!".
12 | /// Note this is a partial class, the code-behind for the Greeting.xaml file.
13 | ///
14 | public partial class Greeting : TextBlock
15 | {
16 | public Greeting()
17 | {
18 | // Initialize this object.
19 | InitializeComponent();
20 |
21 | // Add your code here
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Samples/HelloWorldB/Model.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 |
3 | namespace HelloWorldB
4 | {
5 | /***************************************************************************************************
6 | Model class
7 | ***************************************************************************************************/
8 | ///
9 | /// Used to model this application's message. Given the simple requirements of this app, having
10 | /// a model class is excessive, but serves as an ideal way to demonstrate how to design
11 | /// models and views.
12 | ///
13 | /// Note that this Model is a plain old CLR type, since it does not inherit from .
14 | ///
15 | public class Model
16 | {
17 | public string Message { get; } = "Hello, World!";
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/DecimalEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 |
6 | namespace Demo
7 | {
8 | public class DecimalEditor : NumericEdit, IPropertyEditor
9 | {
10 | /*******************************************************************************
11 | BindToSourceProperty()
12 | *******************************************************************************/
13 |
14 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(NumberDecimalProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
15 |
16 | public DecimalEditor()
17 | {
18 | TypeFilter = NumericTypeFilter.Decimal;
19 | }
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Samples/HelloWorldA/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace HelloWorldA
4 | {
5 | /***************************************************************************************************
6 | Program class
7 | ***************************************************************************************************/
8 | ///
9 | /// Demonstrates the classic Hello World app.
10 | ///
11 | public class Program
12 | {
13 | ///
14 | /// This is the app entry point.
15 | ///
16 | static void Main(string[] args)
17 | {
18 | // Create and run a new app object
19 | var app = new App();
20 | app.Run();
21 |
22 | // Your code here, though generally app-level code should be added to the App class, which
23 | // is the singleton that is created above.
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Samples/HelloWorldB/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace HelloWorldB
4 | {
5 | /***************************************************************************************************
6 | Program class
7 | ***************************************************************************************************/
8 | ///
9 | /// Demonstrates the classic Hello World app.
10 | ///
11 | public class Program
12 | {
13 | ///
14 | /// This is the app entry point.
15 | ///
16 | static void Main(string[] args)
17 | {
18 | // Create and run a new app object
19 | var app = new App();
20 | app.Run();
21 |
22 | // Your code here, though generally app-level code should be added to the App class, which
23 | // is the singleton that is created above.
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Samples/HelloWorldC/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace HelloWorldC
4 | {
5 | /***************************************************************************************************
6 | Program class
7 | ***************************************************************************************************/
8 | ///
9 | /// Demonstrates the classic Hello World app.
10 | ///
11 | public class Program
12 | {
13 | ///
14 | /// This is the app entry point.
15 | ///
16 | static void Main(string[] args)
17 | {
18 | // Create and run a new app object
19 | var app = new App();
20 | app.Run();
21 |
22 | // Your code here, though generally app-level code should be added to the App class, which
23 | // is the singleton that is created above.
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Calculator/MyAssets.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 | Lighter
7 | helvetica
8 | #06090E
9 | White
10 | Red
11 |
12 |
13 |
14 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [](https://github.com/lesarde-co/frogui#frogui)Frog`ui`
2 |
3 | **Frogui** is a UI framework that allows developers familiar with C#, .NET and Visual Studio to build native client _web apps_ using their existing skills, with no need to learn or use JavaScript or other web technologies. Check out our [website](https://lesarde.com/frogui) for an the most up to date information.
4 |
5 | ## [](https://github.com/lesarde-co/frogui#contributing)Live Samples
6 |
7 | The main sample, **Demo**, is hosted [here](https://lesarde-co.github.io/), allowing you to experience true .NET running on the web.
8 |
9 | ## [](https://github.com/lesarde-co/frogui#contributing)Contributing
10 |
11 | This repo contains samples to use with Frogui, all neatly organized in a Visual Studio solution [here](https://github.com/lesarde-co/frogui/tree/master/Samples). Your contributions to the Sample solution are welcomed!
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Popup/View.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/MagicSegmenter.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using System.Linq;
4 | namespace Demo
5 | {
6 | public abstract class MagicSegmentor : Segmentor
7 | {
8 | public abstract Segment[] Segments { get; }
9 |
10 | public MagicSegmentor()
11 | {
12 | Initialize();
13 | }
14 |
15 | protected virtual void Initialize()
16 | {
17 | HorizontalAlignment = HorizontalAlignment.Left;
18 | VerticalAlignment = VerticalAlignment.Top;
19 |
20 | SelectedValuePath = new PropertyPath(nameof(Segment.Value));
21 |
22 | foreach (var cur in Segments)
23 | Items.Add(cur);
24 |
25 | SelectedItem = Items[0];
26 | }
27 |
28 | public void SelectBySegmentValue(object value)
29 | {
30 | foreach (Segment segment in Items)
31 | if (segment.Value == value || segment.Value.Equals(value))
32 | {
33 | SelectedItem = segment;
34 | return;
35 | }
36 | }
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/EnumTextEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui.Controls;
2 |
3 | namespace Demo
4 | {
5 | /***************************************************************************************************
6 | EnumImageEditor class
7 | ***************************************************************************************************/
8 | ///
9 | /// Edits an enum property using a whose members display the enum value's name.
10 | ///
11 | ///
12 | public class EnumTextEditor : EnumEditor
13 | {
14 | /*******************************************************************************
15 | PrepSegment()
16 | *******************************************************************************/
17 |
18 | protected override void PrepSegment(Segment segment, string name, T value)
19 | {
20 | segment.Text = name;
21 | segment.Value = value;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/CartoonView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/TextEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 |
6 | namespace Demo
7 | {
8 | /***************************************************************************************************
9 | TextEditor class
10 | ***************************************************************************************************/
11 | ///
12 | /// Edits a property.
13 | ///
14 | public class TextEditor : TextBox, IPropertyEditor
15 | {
16 | /*******************************************************************************
17 | BindToSourceProperty()
18 | *******************************************************************************/
19 |
20 | public void BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(TextProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/BitmapInfoView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Samples/HelloWorldB/App.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 |
3 | namespace HelloWorldB
4 | {
5 | /***************************************************************************************************
6 | App class
7 | ***************************************************************************************************/
8 | ///
9 | /// Used for this application's singleton object, deriving from
10 | /// which all single-page apps must do.
11 | /// Note that this is a partial class.
12 | ///
13 | public partial class App : SinglePageApplication
14 | {
15 | /*******************************************************************************
16 | $
17 | *******************************************************************************/
18 | ///
19 | /// Creates an object.
20 | ///
21 | public App()
22 | {
23 | InitializeComponent();
24 |
25 | // Your code here
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Samples/HelloWorldC/App.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 |
3 | namespace HelloWorldC
4 | {
5 | /***************************************************************************************************
6 | App class
7 | ***************************************************************************************************/
8 | ///
9 | /// Used for this application's singleton object, deriving from
10 | /// which all single-page apps must do.
11 | /// Note that this is a partial class.
12 | ///
13 | public partial class App : SinglePageApplication
14 | {
15 | /*******************************************************************************
16 | $
17 | *******************************************************************************/
18 | ///
19 | /// Creates an object.
20 | ///
21 | public App()
22 | {
23 | InitializeComponent();
24 |
25 | // Your code here
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Paper/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_Paper
5 | {
6 | /***************************************************************************************************
7 | View class
8 | ***************************************************************************************************/
9 | ///
10 | /// Demonstrates the element.
11 | ///
12 | public partial class View : Decorator, IExampleView
13 | {
14 | /***********************************************************
15 | MainElement property
16 | ***********************************************************/
17 |
18 | Element IExampleView.MainElement => e_paper;
19 |
20 | /*******************************************************************************
21 | $
22 | *******************************************************************************/
23 |
24 | public View()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Samples/Demo/App.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Input;
3 |
4 | namespace Demo
5 | {
6 | /***************************************************************************************************
7 | App class (code-behind)
8 | ***************************************************************************************************/
9 | ///
10 | /// The application object singleton. inherits from
11 | /// , which indicates that it is meant to be a Single Page GUI
12 | /// Application (SPA).
13 | ///
14 | public partial class App : SinglePageApplication
15 | {
16 | /*******************************************************************************
17 | $
18 | *******************************************************************************/
19 | ///
20 | /// Creates an object.
21 | ///
22 | public App()
23 | {
24 | InitializeComponent();
25 |
26 | // Add user code here
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/Samples/Console/HelloWorld/App.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using System.Threading.Tasks;
3 |
4 | namespace HelloWorldA
5 | {
6 | /***************************************************************************************************
7 | App class
8 | ***************************************************************************************************/
9 | ///
10 | /// Used for this application's singleton object, deriving from
11 | /// which all console apps must do.
12 | ///
13 | public class App : ConsoleApplication
14 | {
15 | ///
16 | /// This is where console interaction begins, much like the static main()
17 | /// method in a traditional console app.
18 | ///
19 | public async override Task MainAsync()
20 | {
21 | // Greet the world
22 | Console.WriteLine("Hello, World!");
23 |
24 | // This await is optional but prevents a compiler warning since this method is async.
25 | await Task.CompletedTask;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Samples/HelloWorldA/App.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 |
3 | namespace HelloWorldA
4 | {
5 | /***************************************************************************************************
6 | App class
7 | ***************************************************************************************************/
8 | ///
9 | /// Used for this application's singleton object, deriving from
10 | /// which all single-page apps must do.
11 | /// Note that this is a partial class because it is the code-behind for the App.xaml file.
12 | ///
13 | public partial class App : SinglePageApplication
14 | {
15 | /*******************************************************************************
16 | $
17 | *******************************************************************************/
18 | ///
19 | /// Creates an object.
20 | ///
21 | public App()
22 | {
23 | InitializeComponent();
24 |
25 | // Add your code here
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/CheckBox/View.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Paper/View.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Popup/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 | using Lesarde.Frogui.Shapes;
5 |
6 | namespace Demo.Example_Popup
7 | {
8 | /***************************************************************************************************
9 | View class
10 | ***************************************************************************************************/
11 | ///
12 | /// Demonstrates the element.
13 | ///
14 | public partial class View : Decorator, IExampleView
15 | {
16 | /***********************************************************
17 | MainElement property
18 | ***********************************************************/
19 |
20 | Element IExampleView.MainElement => e_popup;
21 |
22 | /*******************************************************************************
23 | $
24 | *******************************************************************************/
25 |
26 | public View()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/LengthEditorBase.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 |
5 | namespace Demo
6 | {
7 | public abstract class LengthEditorBase : NumericEdit, IPropertyEditor
8 | {
9 | /***********************************************************
10 | AvoidRecursion property
11 | ***********************************************************/
12 |
13 | protected bool AvoidRecursion { get; set; }
14 |
15 | /*******************************************************************************
16 | $
17 | *******************************************************************************/
18 |
19 | public LengthEditorBase()
20 | {
21 | TypeFilter = NumericTypeFilter.Double;
22 |
23 | Focusable = true;
24 | Height = Length.InPixels(20);
25 | VaryButtonDesign = VaryDesign.Triangle;
26 | VaryButtonLength = Length.InPixels(15);
27 | SmallChange = 1;
28 | LargeChange = 10;
29 | }
30 |
31 | public abstract void BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ScrollViewer/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 | using Lesarde.Frogui.Shapes;
5 |
6 | namespace Demo.Example_ScrollViewer
7 | {
8 | /***************************************************************************************************
9 | View class
10 | ***************************************************************************************************/
11 | ///
12 | /// Demonstrates the element.
13 | ///
14 | public partial class View : Decorator, IExampleView
15 | {
16 | /***********************************************************
17 | MainElement property
18 | ***********************************************************/
19 |
20 | Element IExampleView.MainElement => e_scrollViewer;
21 |
22 | /*******************************************************************************
23 | $
24 | *******************************************************************************/
25 |
26 | public View()
27 | {
28 | InitializeComponent();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/StringView.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 |
5 | namespace Demo
6 | {
7 | internal class StringView : TextBlock
8 | {
9 | public StringView()
10 | {
11 | Foreground = SolidColorBrushes.White.Brush;
12 | FontSize = Lesarde.Frogui.Media.FontSize.FromKind(Lesarde.Frogui.Media.FontSizeKind.Large);
13 | FontWeight = Lesarde.Frogui.Media.FontWeight.FromKind(Lesarde.Frogui.Media.FontWeightKind.Normal);
14 | TextShadowColor = (SolidColorBrush)SolidColorBrushes.Black.Brush;
15 | TextShadowBlur = Length.InPixels(3);
16 | TextShadowHorizontalOffset = Length.InPixels(1);
17 | TextShadowVerticalOffset = Length.InPixels(1);
18 | VerticalAlignment = VerticalAlignment.Center;
19 | Padding = Thickness.InPixels(2);
20 | Margin = new Thickness(Length.InPixels(4), Length.InPixels(0), Length.InPixels(4), Length.InPixels(0));
21 |
22 | // When the data context changes update the Text property
23 | AddPropertyChangedListener(Element.DataContextProperty, v => { Text = v?.ToString(); });
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/EnumImageEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui.Controls;
2 |
3 | namespace Demo
4 | {
5 | /***************************************************************************************************
6 | EnumImageEditor class
7 | ***************************************************************************************************/
8 | ///
9 | /// Edits an enum property using a whose members display an image representing
10 | /// the enum value.
11 | ///
12 | ///
13 | public class EnumImageEditor : EnumEditor
14 | {
15 | /*******************************************************************************
16 | PrepSegment()
17 | *******************************************************************************/
18 |
19 | protected override void PrepSegment(Segment segment, string name, T value)
20 | {
21 | if ("None" == name)
22 | segment.ImageSource = MakeImageSource("None");
23 | else
24 | segment.ImageSource = MakeTypedImageSource(name);
25 |
26 | segment.Value = value;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/DoubleSlider.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Data;
4 |
5 | namespace Demo
6 | {
7 | /***************************************************************************************************
8 | DoubleSlider class
9 | ***************************************************************************************************/
10 |
11 | public class DoubleSlider : MagicSlider, IPropertyEditor
12 | {
13 | public override bool TranslateToUserValue1(decimal value, out object newValue)
14 | {
15 | newValue = (double)value;
16 | return true;
17 | }
18 |
19 | public override void TranslateFromUserValue1(object userValue1, out decimal newValue)
20 | {
21 | newValue = (decimal)(double)userValue1;
22 | }
23 |
24 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty)
25 | {
26 | SetBinding(UserValue1Property, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
27 | }
28 |
29 | public DoubleSlider()
30 | {
31 | PreviewView = new DefaultPreviewView();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Slider/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Controls.Primitives;
4 | using System;
5 |
6 | namespace Demo.Example_Slider
7 | {
8 | /***************************************************************************************************
9 | View class
10 | ***************************************************************************************************/
11 | ///
12 | /// Demonstrates the class.
13 | ///
14 | public partial class View : Decorator, IExampleView
15 | {
16 | Element IExampleView.MainElement => e_slider;
17 |
18 | void AddEnums(Selector selector, Type type, object selectedItem)
19 | {
20 | foreach (var cur in Enum.GetValues(type))
21 | selector.Items.Add(cur);
22 | selector.SelectedItem = selectedItem;
23 | }
24 |
25 | /*******************************************************************************
26 | $
27 | *******************************************************************************/
28 |
29 | public View()
30 | {
31 | InitializeComponent();
32 | }
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Samples/Readme.md:
--------------------------------------------------------------------------------
1 | ***
2 |
3 | # Frogui Samples solution
4 |
5 | ***
6 |
7 | ## Projects
8 |
9 | ### HelloWorldA
10 | Classic Hello World app.
11 |
12 | ### HelloWorldB
13 | Classic Hello World app that builds on concepts introduced in HelloWorldA by adding XAML, a view and model.
14 |
15 | ### HelloWorldC
16 | Classic Hello World app that builds on concepts introduced in HelloWorldB by using a view and view-model.
17 |
18 | ### Demo
19 |
20 | Main Frogui demonstration filled with examples of how to use:
21 | - elements such as panels, buttons, shapes, text, shapes, etc.
22 | - resources
23 | - model, view-models, and views
24 | - commands
25 | - styles and themes
26 | - visual states
27 | - applications to create deliverables
28 | - XAML
29 | - Reactive Extensions (Rx) observables
30 | - dependency properties
31 | - device input
32 | - validation
33 | - data-binding
34 | - cascading asset sheets
35 | - *and more*
36 |
37 | ### Console folder
38 | * ### HelloWorld
39 | Classic Hello World app.
40 |
41 | * ### HelloFriend
42 | Basic console i/o.
43 |
44 | * ### ReadKeyFun
45 | Demonstrates keyboard processing.
46 |
47 | *Check the code comments to learn more.*
48 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/RadioButton/View.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/WrappingFlex.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo
5 | {
6 | /***************************************************************************************************
7 | WrappingFlex class (design)
8 | ***************************************************************************************************/
9 | ///
10 | /// Used as a base class by demo classes which want to show multiple samples in a free-form,
11 | /// left-top-right, top-to-bottom wrap.
12 | ///
13 | public abstract class WrappingFlex : Flex
14 | {
15 | ///
16 | /// Used to skip samples permutations to keep the demo performance snappy for builds.
17 | ///
18 | protected readonly int Skip;
19 |
20 | protected int Current { get; private set; }
21 |
22 | public WrappingFlex(int windowsSkip, int wasmSkip)
23 | {
24 | #if WASM
25 | this.Skip = wasmSkip;
26 | #else
27 | this.Skip = windowsSkip;
28 | #endif
29 | Wrapping = FlexWrapping.Wrap;
30 | }
31 |
32 | protected bool IsReady() => ++Current % Skip == 0;
33 |
34 | protected void AddSample(Element child) => Children.Add(child);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Samples/Console/ReadKeyFun/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Demonstrates how to read console input. It:
3 | * - is a C# .NET Standard dll project -- the only option at the moment for frogui.
4 | * - has an property added to the project file so the "Main" method entry point can be found; dll's do not have entry points by default.
5 | * - has the Lesarde.Frogui.Wasm NuGet package added.
6 | * - may be run as-is within a browser.
7 | */
8 |
9 | namespace ReadKeyFun
10 | {
11 | /***************************************************************************************************
12 | Program class
13 | ***************************************************************************************************/
14 | ///
15 | /// Demonstrates how to read key entry into a console.
16 | ///
17 | class Program
18 | {
19 | ///
20 | /// This is the app entry point. Console processing should be done in
21 | /// .
22 | ///
23 | static void Main(string[] args)
24 | {
25 | // Create and run the app
26 | var app = new App();
27 | app.ScopeType = typeof(Lesarde.Frogui.Scope);
28 |
29 | app.Run();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Samples/Demo/Example.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Media.Imaging;
3 | using System;
4 | using System.Linq;
5 |
6 | namespace Demo
7 | {
8 | public enum PROP
9 | {
10 | All,
11 | None,
12 | NoCascade
13 | }
14 |
15 | public class Example
16 | {
17 | public Type Type { get; set; }
18 | public bool UseCustomIcon { get; set; }
19 | public string Notes { get; set; }
20 | public string FunFact { get; set; }
21 | public PROP Prop { get; set; }
22 | public Style[] Presets { get; set; }
23 | public BitmapImage Icon { get; set; }
24 |
25 | public string DisplayName => Type.Namespace.Split('.').Last().Substring("Example_".Length).Replace('_', ' ');
26 |
27 | public Example(Type type, bool useCustomIcon, string notes, string funFact, PROP prop, Style[] presets = null)
28 | {
29 | this.Type = type;
30 | this.UseCustomIcon = useCustomIcon;
31 | this.Notes = notes;
32 | this.FunFact = funFact;
33 | this.Prop = prop;
34 | this.Presets = presets;
35 |
36 | var iconFileName = (useCustomIcon) ? DisplayName : "Misc";
37 |
38 | Icon = new BitmapImage(new System.Uri($"Resources/Menu-{iconFileName}.png", UriKind.Relative));
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Button/View.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
30 |
31 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/BrushEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 | using Lesarde.Frogui.Media;
6 |
7 | namespace Demo
8 | {
9 | public class BrushEditor : Border, IPropertyEditor
10 | {
11 | public BrushEditor()
12 | {
13 | BorderThickness = Thickness.InPixels(1);
14 | BorderBrush = SolidColorBrushes.Gray.Brush;
15 | MinWidth = Length.InPixels(100);
16 | Height = Length.InPixels(40);
17 | CornerRadius = CornerRadius.InPixels(3);
18 |
19 | IsHitTestVisible = true;
20 |
21 | PointerClick += BrushZoomer_PointerClick;
22 | }
23 |
24 | void BrushZoomer_PointerClick(object sender, Lesarde.Frogui.Input.PointerEventArgs e)
25 | {
26 | var editor = MainWindow.Me.e_brushPicker as IPropertyEditor;
27 |
28 | if (null != editor)
29 | editor.BindToSourceProperty(this, BackgroundProperty);
30 | }
31 |
32 | public Brush Brush
33 | {
34 | get => Background;
35 | set => Background = value;
36 | }
37 |
38 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(BackgroundProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/BrushInfoView.cs:
--------------------------------------------------------------------------------
1 | using Lesarde;
2 | using Lesarde.Frogui;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Media;
5 |
6 | namespace Demo
7 | {
8 | public partial class BrushInfoView : TextBlock
9 | {
10 | public BrushInfoView()
11 | {
12 | InitializeComponent();
13 |
14 | AddPropertyChangedListener(TextBlock.BackgroundProperty, BackgroundChanged, true);
15 | }
16 |
17 | internal void BackgroundChanged(Brush brush)
18 | {
19 | LesardeDebug.AssertValued(brush);
20 |
21 | if (brush is SolidColorBrush solidColorBrush)
22 | {
23 | TextShadowColor = null;
24 | TextShadowBlur = Length.ZeroPx;
25 | TextShadowHorizontalOffset = Length.ZeroPx;
26 | TextShadowVerticalOffset = Length.ZeroPx;
27 |
28 | if ((solidColorBrush.Color.R.Intensity + solidColorBrush.Color.G.Intensity + solidColorBrush.Color.B.Intensity) / 3 >= 0x80)
29 | this.Foreground = SolidColorBrushes.Black.Brush;
30 | else
31 | this.Foreground = SolidColorBrushes.White.Brush;
32 | }
33 | else
34 | {
35 | Foreground = SolidColorBrushes.White.Brush;
36 | TextShadowColor = (SolidColorBrush)SolidColorBrushes.Black.Brush;
37 | TextShadowBlur = Length.InPixels(1);
38 | TextShadowHorizontalOffset = Length.InPixels(1);
39 | TextShadowVerticalOffset = Length.InPixels(1);
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Samples/HelloWorldB/Greeting.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace HelloWorldB
5 | {
6 | /***************************************************************************************************
7 | Greeting class
8 | ***************************************************************************************************/
9 | ///
10 | /// This class inherits from , and displays "Hello, World!".
11 | ///
12 | public partial class Greeting
13 | :
14 | TextBlock, // Inherit from TextBlock to keep the design simple
15 | IViewOfModel // Indicate that this class is a view of the Model class
16 | {
17 | public object ModelObject
18 | {
19 | get => DataContext;
20 | set => DataContext = value;
21 | }
22 |
23 | ///
24 | /// Provides a type-safe property to access the associated model.
25 | ///
26 | public Model Model => (Model)ModelObject;
27 |
28 | public Greeting()
29 | {
30 | // Allow the design.cs file to initialize
31 | InitializeComponent();
32 |
33 | // For simplicity, create and assign the Model property here. There are no specific rules about
34 | // when and how to associate a view with a model. Just keep in mind that a view is of little
35 | // use without a model.
36 | ModelObject = new Model();
37 | }
38 |
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Samples/HelloWorldC/Greeting.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace HelloWorldC
5 | {
6 | /***************************************************************************************************
7 | Greeting class
8 | ***************************************************************************************************/
9 | ///
10 | /// This class is a that displays "Hello, World!".
11 | /// Note this is a partial class.
12 | ///
13 | public partial class Greeting
14 | :
15 | TextBlock, // Inherit from TextBlock to keep the design simple
16 | IViewOfViewModel // Indicate that this is a view of the ViewModel class
17 | {
18 | ///
19 | /// Provides a type-safe property to access the associated model.
20 | ///
21 | public ViewModel ViewModel
22 | {
23 | get => (ViewModel)DataContext;
24 | set => DataContext = value;
25 | }
26 |
27 | public Greeting()
28 | {
29 | // Allow the design.cs file to initialize
30 | InitializeComponent();
31 |
32 | // For simplicity, create and assign the ViewModel property here. There are no specific rules about
33 | // when and how to associate a view with a view-model. Just keep in mind that a view is of little
34 | // use without a view-model.
35 | ViewModel = new ViewModel();
36 | }
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/ItemsSourceEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Data;
4 | using System.Collections;
5 |
6 | namespace Demo
7 | {
8 | public class ItemsSourceEditor : MagicSlider, IPropertyEditor
9 | {
10 | static readonly IEnumerable[] ItemSources =
11 | {
12 | Common.LoremIpsumWords,
13 | People.All,
14 | Common.Cartoons,
15 | SolidColorBrushes.Singleton.All,
16 | LinearGradientBrushes.Singleton.All,
17 | RadialGradientBrushes.Singleton.All,
18 | Bitmaps.All
19 | };
20 |
21 | public ItemsSourceEditor()
22 | {
23 | this.SmallChange = 1.0m;
24 | this.LargeChange = 1.0m;
25 | this.Maximum = ItemSources.Length;
26 | }
27 |
28 | public override bool TranslateToUserValue1(decimal value, out object newValue)
29 | {
30 | var intValue = (int)value;
31 |
32 | if (0 == intValue)
33 | {
34 | newValue = null;
35 | return true;
36 | }
37 |
38 | newValue = ItemSources[intValue-1];
39 | return true;
40 | }
41 |
42 | public override void TranslateFromUserValue1(object userValue1, out decimal newValue)
43 | {
44 | for (var i = 0; i < ItemSources.Length; ++i)
45 | {
46 | if (ItemSources[i] == userValue1)
47 | {
48 | newValue = i + 1;
49 | return;
50 | }
51 | }
52 |
53 | newValue = 0m;
54 | }
55 |
56 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(UserValue1Property, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Samples/Console/ReadKeyFun/ReadKeyFun.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.2
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 |
32 |
33 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/PersonView.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
18 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Samples/Console/HelloFriend/App.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using System.Threading.Tasks;
3 |
4 | namespace HelloFriend
5 | {
6 | /***************************************************************************************************
7 | App class
8 | ***************************************************************************************************/
9 | ///
10 | /// Used for this application's singleton object, deriving from
11 | /// which all console apps must do.
12 | ///
13 | public class App : ConsoleApplication
14 | {
15 | ///
16 | /// This is where console interaction begins, much like the static main()
17 | /// method in a traditional console app.
18 | ///
19 | public async override Task MainAsync()
20 | {
21 | var outputColor = System.ConsoleColor.Green;
22 | var inputColor = System.ConsoleColor.Yellow;
23 |
24 | Console.ForegroundColor = System.ConsoleColor.Green;
25 | Console.BackgroundColor = System.ConsoleColor.Black;
26 | Console.Clear();
27 |
28 | Console.ForegroundColor = outputColor;
29 | Console.Write("Enter your name:");
30 |
31 | Console.ForegroundColor = inputColor;
32 | var name = await Console.ReadLineAsync();
33 |
34 | Console.ForegroundColor = outputColor;
35 | Console.Write("Enter your age:");
36 |
37 | Console.ForegroundColor = inputColor;
38 | var age = await Console.ReadLineAsync();
39 |
40 | Console.ForegroundColor = outputColor;
41 | Console.WriteLine("Hello, " + name + "! It's nice to meet you. " + age + " is a good age!");
42 | }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | Samples/\.vs/
3 |
4 | Samples/Console/HelloFriend/bin/
5 |
6 | Samples/Console/HelloFriend/obj/
7 |
8 | Samples/Console/HelloFriend/Properties/
9 |
10 | Samples/Console/HelloFriend/wwwroot/
11 |
12 | *.user
13 |
14 | Samples/Console/HelloWorld/bin/
15 |
16 | Samples/Console/HelloWorld/obj/
17 |
18 | Samples/Console/ReadKeyFun/bin/
19 |
20 | Samples/Console/ReadKeyFun/obj/
21 |
22 | Samples/Console/ReadKeyFun/wwwroot/
23 |
24 | Samples/Console/ReadKeyFun/Properties/
25 |
26 | Samples/Demo/bin/
27 |
28 | Samples/Demo/obj/
29 |
30 | Samples/Demo/Properties/
31 |
32 | Samples/Demo/wwwroot/
33 |
34 | Samples/Demo/App\.g\.cs
35 |
36 | Samples/Demo/Examples/_Misc/Animation A/View\.g\.cs
37 |
38 | Samples/Demo/Examples/_Misc/Binding A/View\.g\.cs
39 |
40 | Samples/Demo/Examples/_Misc/Calculator/MyAssets\.g\.cs
41 |
42 | Samples/Demo/Examples/_Misc/Calculator/View\.g\.cs
43 |
44 | Samples/Demo/Examples/_Misc/Home/View\.g\.cs
45 |
46 | Samples/Demo/Examples/_Misc/Observable A/View\.g\.cs
47 |
48 | Samples/Console/HelloWorld/Properties/
49 |
50 | Samples/Console/HelloWorld/wwwroot/
51 |
52 | Samples/Demo bin April 18/
53 |
54 | Samples/Demo/BrushPicker - 1 droplist\.cs
55 |
56 | Samples/HelloWorld/Properties/
57 |
58 | Samples/HelloWorld/wwwroot/
59 |
60 | Samples/HelloWorldA/bin/
61 |
62 | Samples/HelloWorldA/obj/
63 |
64 | Samples/HelloWorldA/Properties/
65 |
66 | Samples/HelloWorldA/wwwroot/
67 |
68 | Samples/HelloWorldB/bin/
69 |
70 | Samples/HelloWorldB/obj/
71 |
72 | Samples/HelloWorldB/Properties/
73 |
74 | Samples/HelloWorldB/wwwroot/
75 |
76 | Samples/HelloWorldC/bin/
77 |
78 | Samples/HelloWorldC/obj/
79 |
80 | Samples/HelloWorldC/Properties/
81 |
82 | Samples/HelloWorldC/wwwroot/
83 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Calculator/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using System;
4 | using System.Reactive.Linq;
5 |
6 | namespace Demo.Example_Calculator
7 | {
8 | /***************************************************************************************************
9 | Calculator_Demo class
10 | ***************************************************************************************************/
11 | ///
12 | /// This element is used as the root of the calculator demo. It inherits from
13 | /// because the calculator view is very grid-like. This is the view associated with the
14 | /// class.
15 | ///
16 | /// Note the property creates the model object during initialization.
17 | /// The technique works well here, but is not generally how models are wired to views.
18 | ///
19 | public partial class View : Grid, Lesarde.Frogui.IViewOfViewModel, IExampleView
20 | {
21 | public ViewModel ViewModel { get => (ViewModel)DataContext; set => DataContext = value; }
22 |
23 | Element IExampleView.MainElement => this;
24 |
25 | ///
26 | /// The constructor of a design must always first call .
27 | ///
28 | public View()
29 | {
30 | InitializeComponent();
31 |
32 | ViewModel = new ViewModel();
33 |
34 | // User code below
35 |
36 | ViewModel.CreateObservable(ViewModel.InErrorProperty)
37 | .Select(inError => inError ? MyAssets.Singleton.MyErrorForeground : MyAssets.Singleton.MyForeground)
38 | .Subscribe((displayForeground) => e_text.Foreground = displayForeground);
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/Samples/Demo/Editors/MagicSlider.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Data;
4 | using System;
5 |
6 | namespace Demo
7 | {
8 | /***************************************************************************************************
9 | MagicSlider class
10 | ***************************************************************************************************/
11 |
12 | public abstract class MagicSlider : Slider
13 | {
14 | internal class DefaultPreviewView : TextBlock
15 | {
16 | public DefaultPreviewView()
17 | {
18 | Width = new Length(50, Unit.Px);
19 |
20 | // When the data context changes update the Text property
21 | AddPropertyChangedListener(Element.DataContextProperty, v =>
22 | {
23 | Text = (v is decimal) ? ((decimal)v).ToString("0.00") : (null == v) ? String.Empty : v.ToString();
24 | });
25 | }
26 | }
27 |
28 | /*******************************************************************************
29 | $
30 | *******************************************************************************/
31 |
32 | public MagicSlider()
33 | {
34 | Focusable = false;
35 |
36 | var ThumbButtonSize = new Length(11, Unit.Px);
37 |
38 | this.Minimum = 0m;
39 | this.Maximum = 10m;
40 | this.Height = new Length(20, Unit.Px);
41 | this.Width = new Length(300, Unit.Px);
42 | this.Orientation = Orientation.Horizontal;
43 | this.SmallChange = 0.25m;
44 | this.LargeChange = 1m;
45 | this.Value = 0m;
46 | this.EdgeDesign = TrackEdgeDesign.Square;
47 | this.TrackBreadth = Length.InPixels(1);
48 | this.TrackBackground = SolidColorBrushes.White.Brush;
49 | this.ThumbButtonLength = ThumbButtonSize;
50 | this.ThumbButtonBreadth = ThumbButtonSize;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Samples/Console/HelloWorld/HelloWorld.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netcoreapp2.2
4 | 40
5 | C:\proj\Dev\Frogui\Backup\repo\Samples\Console\HelloWorld\
6 | 2.0
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/NullableSolidColorBrushEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using System;
4 |
5 | namespace Demo
6 | {
7 | /***************************************************************************************************
8 | NullableSolidBrushColorEditor class
9 | ***************************************************************************************************/
10 |
11 | public class NullableSolidBrushColorEditor : CheckedEditorPart, IPropertyEditor
12 | {
13 | WeakReference WeakSourceObject { get; set; }
14 | DependencyObject SourceObject
15 | {
16 | get
17 | {
18 | WeakSourceObject.TryGetTarget(out var target);
19 | return target;
20 | }
21 | }
22 |
23 | DependencyProperty SourceProperty { get; set; }
24 |
25 | internal override void ValuedChanged_IsChecked(bool value)
26 | {
27 | base.ValuedChanged_IsChecked(value);
28 |
29 | if (null == WeakSourceObject)
30 | return;
31 |
32 | if (!value)
33 | SourceObject.SetValue(SourceProperty, null);
34 | }
35 |
36 | /*******************************************************************************
37 | BindToSourceProperty()
38 | *******************************************************************************/
39 |
40 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty)
41 | {
42 | WeakSourceObject = new WeakReference(sourceObject);
43 | SourceProperty = sourceProperty;
44 |
45 | ((IPropertyEditor)E_editor).BindToSourceProperty(sourceObject, sourceProperty);
46 |
47 | sourceObject.AddPropertyChangedListener(sourceProperty, Source_ValueChanged);
48 | }
49 |
50 | internal void Source_ValueChanged(object v)
51 | {
52 | E_checkBox.IsChecked = null != v;
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/FontSizeEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Data;
4 |
5 | namespace Demo
6 | {
7 | /***************************************************************************************************
8 | FontSizeSlider class
9 | ***************************************************************************************************/
10 |
11 | public class FontSizeEditor : MagicSlider, IPropertyEditor
12 | {
13 | /*******************************************************************************
14 | $
15 | *******************************************************************************/
16 |
17 | public FontSizeEditor()
18 | {
19 | PreviewView = new DefaultPreviewView();
20 | Maximum = 72m;
21 | }
22 |
23 | /*******************************************************************************
24 | TranslateToUserValue1()
25 | *******************************************************************************/
26 |
27 | public override bool TranslateToUserValue1(decimal value, out object newValue)
28 | {
29 | newValue = Lesarde.Frogui.Media.FontSize.FromLength((double)value, Unit.Pt);
30 | return true;
31 | }
32 |
33 | public override void TranslateFromUserValue1(object userValue1, out decimal newValue)
34 | {
35 | newValue = (decimal)((Lesarde.Frogui.Media.FontSize)userValue1).SizeOrPercent;
36 | }
37 |
38 | /*******************************************************************************
39 | BindToSourceProperty()
40 | *******************************************************************************/
41 |
42 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty)
43 | {
44 | SetBinding(UserValue1Property, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
45 | }
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Samples/Console/ReadKeyFun/App.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using System.Threading.Tasks;
3 |
4 | namespace ReadKeyFun
5 | {
6 | /***************************************************************************************************
7 | App class
8 | ***************************************************************************************************/
9 | ///
10 | /// Used for this application's singleton object, deriving from
11 | /// which all console apps must do.
12 | ///
13 | public class App : ConsoleApplication
14 | {
15 | ///
16 | /// This is where console interaction begins, much like the static main()
17 | /// method in a traditional console app.
18 | ///
19 | public async override Task MainAsync()
20 | {
21 | var sysForeground = System.ConsoleColor.White;
22 |
23 | Console.BackgroundColor = System.ConsoleColor.DarkBlue;
24 | Console.Clear();
25 |
26 | Console.ForegroundColor = sysForeground;
27 | Console.WriteLine("Press any key to start the fun, including special keys such as [F1], [->], [Enter/Return], number pad, etc.");
28 | Console.WriteLine("Modify by simultaneously pressing [Shift], [Ctrl], [Alt], [Windows or ⌘].");
29 | Console.WriteLine("[Esc] to quit");
30 |
31 | Console.ForegroundColor = System.ConsoleColor.Cyan;
32 |
33 | System.ConsoleKey ck = System.ConsoleKey.NoName;
34 | while (System.ConsoleKey.Escape != ck)
35 | {
36 | var value = await Console.ReadKeyAsync();
37 | ck = value.Key;
38 | var s = ck.ToString();
39 | if (value.Modifiers != 0)
40 | s += " " + value.Modifiers.ToString();
41 | Console.WriteLine(s);
42 | };
43 |
44 | Console.ForegroundColor = sysForeground;
45 | Console.WriteLine();
46 | Console.WriteLine("All done!");
47 |
48 | }
49 |
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/ThicknessEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Data;
4 |
5 | namespace Demo
6 | {
7 | public class ThicknessEditor : LengthEditorBase
8 | {
9 | /***********************************************************
10 | Value property
11 | ***********************************************************/
12 |
13 | public static DependencyProperty ValueProperty { get; } = DependencyProperty
14 | .Register()
15 | .Changed((d, e) =>
16 | {
17 | if (!d.AvoidRecursion)
18 | d.NumberDouble = e.NewValue.Left.Size;
19 | });
20 |
21 | public Thickness Value
22 | {
23 | get => GetValue(ValueProperty);
24 | set => SetValue(ValueProperty, value);
25 | }
26 |
27 | /*******************************************************************************
28 | $
29 | *******************************************************************************/
30 |
31 | public ThicknessEditor()
32 | {
33 | AddPropertyChangedListener(NumericEdit.NumberDoubleProperty, ValueChanged_Number);
34 | }
35 |
36 | /*******************************************************************************
37 | ValueChanged_Number()
38 | *******************************************************************************/
39 |
40 | void ValueChanged_Number(double number) => Value = new Thickness(Length.InPixels(number));
41 |
42 | /*******************************************************************************
43 | BindToSourceProperty()
44 | *******************************************************************************/
45 |
46 | public override void BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(ValueProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Samples/Console/HelloFriend/HelloFriend.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netcoreapp2.2
4 | 40
5 | C:\proj\Dev\Frogui\Backup\repo\Samples\Console\HelloFriend\
6 | 2.0
7 | 4dcf9062-5ab8-42d2-ad09-365c40f62222
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/CornerRadiusEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Data;
4 |
5 | namespace Demo
6 | {
7 | public class CornerRadiusEditor : LengthEditorBase
8 | {
9 | /***********************************************************
10 | Value property
11 | ***********************************************************/
12 |
13 | public static DependencyProperty ValueProperty { get; } = DependencyProperty
14 | .Register()
15 | .Changed((d, e) =>
16 | {
17 | if (!d.AvoidRecursion)
18 | d.NumberDouble = e.NewValue.TopLeft.Size;
19 | });
20 |
21 | public CornerRadius Value
22 | {
23 | get => GetValue(ValueProperty);
24 | set => SetValue(ValueProperty, value);
25 | }
26 |
27 | /*******************************************************************************
28 | $
29 | *******************************************************************************/
30 |
31 | public CornerRadiusEditor()
32 | {
33 | AddPropertyChangedListener(NumericEdit.NumberDoubleProperty, NumberDoubleChanged);
34 | }
35 |
36 | /*******************************************************************************
37 | NumberDoubleChanged()
38 | *******************************************************************************/
39 |
40 | void NumberDoubleChanged(double number) => Value = new CornerRadius(Length.InPixels(number));
41 |
42 | /*******************************************************************************
43 | BindToSourceProperty()
44 | *******************************************************************************/
45 |
46 | public override void BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(ValueProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/FontFamilyEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 | using Lesarde.Frogui.Media;
6 |
7 | namespace Demo
8 | {
9 | /***************************************************************************************************
10 | FontFamilyEditor class
11 |
12 | https://websitesetup.org/web-safe-fonts-html-css/
13 | ***************************************************************************************************/
14 |
15 | public class FontFamilyEditor : MagicSlider, IPropertyEditor
16 | {
17 | /***********************************************************
18 | FamilyName property
19 | ***********************************************************/
20 |
21 | public override bool TranslateToUserValue1(decimal value, out object newValue)
22 | {
23 | newValue = Common.FontFamilyArray[(int)value];
24 | return true;
25 | }
26 |
27 | /*******************************************************************************
28 | $
29 | *******************************************************************************/
30 |
31 | public FontFamilyEditor()
32 | {
33 | PreviewSource = SliderPreviewSource.UserValue1;
34 | PreviewView = new DefaultPreviewView();
35 |
36 | this.SmallChange = 1.0m;
37 | this.LargeChange = 1.0m;
38 | this.Maximum = Common.FontFamilyArray.Length - 1;
39 | }
40 |
41 | /*******************************************************************************
42 | BindToSourceProperty()
43 | *******************************************************************************/
44 |
45 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty)
46 | {
47 | SetBinding(UserValue1Property, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
48 | }
49 |
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/CheckedEditorPart.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 |
6 | namespace Demo
7 | {
8 | /***************************************************************************************************
9 | CheckedEditorPart class
10 | ***************************************************************************************************/
11 |
12 | public class CheckedEditorPart : Grid where EDITOR : Element, IPropertyEditor, new()
13 | {
14 | /***********************************************************
15 | element properties
16 | ***********************************************************/
17 |
18 | public CheckBox E_checkBox { get; } = new CheckBox() { Focusable = false, BorderThickness = Length.ZeroPx, CornerRadius = CornerRadius.InPixels(2) };
19 |
20 | protected EDITOR E_editor { get; } = new EDITOR() { Focusable = false, Margin = new Thickness(new Length(8, Unit.Px), Length.ZeroPx, Length.ZeroPx, Length.ZeroPx) };
21 |
22 | /*******************************************************************************
23 | $
24 | *******************************************************************************/
25 |
26 | public CheckedEditorPart()
27 | {
28 | ColumnCount = 2;
29 | Children.Add(E_checkBox, new GridAnchor(0, 0));
30 | Children.Add(E_editor, new GridAnchor(1, 0));
31 |
32 | E_checkBox.AddPropertyChangedListener(CheckBox.IsCheckedProperty, ValuedChanged_IsChecked);
33 | }
34 |
35 | /*******************************************************************************
36 | ValuedChanged_IsChecked()
37 | *******************************************************************************/
38 |
39 | internal virtual void ValuedChanged_IsChecked(bool value)
40 | {
41 | E_editor.Visibility = (value) ? Visibility.Visible : Visibility.Collapsed;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/LengthEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Data;
4 |
5 | namespace Demo
6 | {
7 | public class LengthEditor : LengthEditorBase
8 | {
9 | /***********************************************************
10 | Value property
11 | ***********************************************************/
12 |
13 | public static DependencyProperty ValueProperty { get; } = DependencyProperty
14 | .Register()
15 | .Changed((d, e) =>
16 | {
17 | if (!d.AvoidRecursion)
18 | d.NumberDouble = e.NewValue.Size;
19 | });
20 |
21 | public Length Value
22 | {
23 | get => GetValue(ValueProperty);
24 | set => SetValue(ValueProperty, value);
25 | }
26 |
27 | /*******************************************************************************
28 | $
29 | *******************************************************************************/
30 |
31 | public LengthEditor()
32 | {
33 | AddPropertyChangedListener(NumericEdit.NumberDoubleProperty, ValueChanged_Number);
34 | }
35 |
36 | /*******************************************************************************
37 | ValueChanged_Number()
38 | *******************************************************************************/
39 |
40 | void ValueChanged_Number(double number)
41 | {
42 | AvoidRecursion = true;
43 | Value = Length.InPixels(number);
44 | AvoidRecursion = false;
45 | }
46 |
47 | /*******************************************************************************
48 | BindToSourceProperty()
49 | *******************************************************************************/
50 |
51 | public override void BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(ValueProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Tip Calculator/MoneyBlock.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo.Example_Tip_Calculator
5 | {
6 | /***************************************************************************************************
7 | MoneyBlock class
8 | ***************************************************************************************************/
9 | ///
10 | /// A control that allows money values to be displayed in text form.
11 | ///
12 | public class MoneyBlock : TextBlock
13 | {
14 | /***********************************************************
15 | Money property
16 | ***********************************************************/
17 | ///
18 | /// Identifies the dependency property.
19 | ///
20 | public static DependencyProperty MoneyProperty { get; } = DependencyProperty
21 | .Register()
22 | .Changed((d, e) => d.SyncText());
23 |
24 | ///
25 | /// Gets or sets the money value. This property should be used
26 | /// instead of the property for managing the displayed text.
27 | ///
28 | public decimal Money
29 | {
30 | get => GetValue(MoneyProperty);
31 | set => SetValue(MoneyProperty, value);
32 | }
33 |
34 | /*******************************************************************************
35 | $
36 | *******************************************************************************/
37 |
38 | public MoneyBlock()
39 | {
40 | SyncText();
41 | }
42 |
43 | /*******************************************************************************
44 | SyncText()
45 | *******************************************************************************/
46 |
47 | void SyncText() => Text = Example_Tip_Calculator.Money.ToText(Money);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Alignment Properties/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 | using System;
5 |
6 | namespace Demo.Example_Alignment_Properties
7 | {
8 | /***************************************************************************************************
9 | LayoutAlignment_Demo class
10 | ***************************************************************************************************/
11 | ///
12 | /// Demonstrates the use of
13 | /// and properties.
14 | ///
15 | public partial class View : Grid, IExampleView
16 | {
17 | public View()
18 | {
19 | var bkgdBrush = new ImageBrush(Common.ElectricRed);
20 |
21 | var horzEnumValues = Enum.GetValues(typeof(HorizontalAlignment));
22 | var vertEnumValues = Enum.GetValues(typeof(VerticalAlignment));
23 |
24 | Common.PrepareDemoGrid(this, horzEnumValues.Length, vertEnumValues.Length, SolidColorBrushes.Blue.Brush, bkgdBrush);
25 |
26 | var padding = new Thickness(new Length(5.0, Unit.Px));
27 |
28 | int col = 0, row = 0;
29 |
30 | foreach (HorizontalAlignment horz in horzEnumValues)
31 | {
32 | foreach (VerticalAlignment vert in vertEnumValues)
33 | {
34 |
35 | var anchor = new GridAnchor(col, row);
36 |
37 | var e_textBlock = new TextBlock()
38 | {
39 | Text = $"{horz}, {vert}",
40 | Foreground = SolidColorBrushes.White.Brush,
41 | Background = SolidColorBrushes.DarkMagenta.Brush,
42 | Padding = padding,
43 | HorizontalAlignment = horz,
44 | VerticalAlignment = vert
45 | };
46 |
47 | this.Children.Add(e_textBlock, anchor);
48 |
49 | ++row;
50 | }
51 |
52 | row = 0;
53 | ++col;
54 | }
55 |
56 | }
57 |
58 | Element IExampleView.MainElement => this;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/AngleEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Data;
4 | using Lesarde.Frogui.Media;
5 |
6 | namespace Demo
7 | {
8 | public class AngleEditor : LengthEditorBase
9 | {
10 | /***********************************************************
11 | Value property
12 | ***********************************************************/
13 |
14 | public static DependencyProperty ValueProperty { get; } = DependencyProperty
15 | .Register()
16 | .Changed((d, e) =>
17 | {
18 | if (!d.AvoidRecursion)
19 | d.NumberDouble = e.NewValue.Size;
20 | });
21 |
22 | public Angle Value
23 | {
24 | get => GetValue(ValueProperty);
25 | set => SetValue(ValueProperty, value);
26 | }
27 |
28 | /*******************************************************************************
29 | $
30 | *******************************************************************************/
31 |
32 | public AngleEditor()
33 | {
34 | AddPropertyChangedListener(NumericEdit.NumberDoubleProperty, ValueChanged_Number);
35 | }
36 |
37 | /*******************************************************************************
38 | ValueChanged_Number()
39 | *******************************************************************************/
40 |
41 | void ValueChanged_Number(double number)
42 | {
43 | AvoidRecursion = true;
44 | Value = new Angle(number, AngleKind.Deg);
45 | AvoidRecursion = false;
46 | }
47 |
48 | /*******************************************************************************
49 | BindToSourceProperty()
50 | *******************************************************************************/
51 |
52 | public override void BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty) => SetBinding(ValueProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/IntEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Data;
5 |
6 | namespace Demo
7 | {
8 | /***************************************************************************************************
9 | IntEditor class
10 | ***************************************************************************************************/
11 |
12 | public class IntEditor : MagicSlider, IPropertyEditor
13 | {
14 | class MyPreviewView : TextBlock
15 | {
16 | public MyPreviewView()
17 | {
18 | Width = new Length(40, Unit.Px);
19 |
20 | // When the data context changes update the Text property
21 | AddPropertyChangedListener(Element.DataContextProperty, v =>
22 | {
23 | Text = (null == v) ? string.Empty : v.ToString();
24 | });
25 | }
26 | }
27 |
28 | public override bool TranslateToUserValue1(decimal value, out object newValue)
29 | {
30 | var i = (int)value;
31 | newValue = i;
32 | return true;
33 | }
34 |
35 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty)
36 | {
37 | SetBinding(UserValue1Property, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
38 | }
39 |
40 | public virtual void IntChanged(int value) { }
41 |
42 | public override void TranslateFromUserValue1(object userValue1, out decimal newValue)
43 | {
44 | newValue = (decimal)(int)userValue1;
45 | }
46 |
47 | public IntEditor()
48 | {
49 | this.Maximum = 200m;
50 |
51 | PreviewSource = SliderPreviewSource.UserValue1;
52 | PreviewView = new MyPreviewView();
53 |
54 | this.SmallChange = 1m;
55 | this.LargeChange = 1m;
56 |
57 | AddPropertyChangedListener(Slider.UserValue1Property, ValueChanged_UserValue1);
58 | }
59 |
60 | public void ValueChanged_UserValue1(object value)
61 | {
62 | IntChanged((int)value);
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Binding A/View.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
18 |
19 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Tip Calculator/Money.cs:
--------------------------------------------------------------------------------
1 | using System.Text.RegularExpressions;
2 |
3 | namespace Demo.Example_Tip_Calculator
4 | {
5 | /***************************************************************************************************
6 | Money class
7 | ***************************************************************************************************/
8 |
9 | public class Money
10 | {
11 | const string Pattern = "\\d+.\\d*";
12 |
13 | /*******************************************************************************
14 | ToText()
15 | *******************************************************************************/
16 | ///
17 | /// Convert the specified to a money string.
18 | ///
19 | ///
20 | ///
21 | public static string ToText(decimal value) => string.Format("${0:N2}", value);
22 |
23 | /*******************************************************************************
24 | ToDecimal()
25 | *******************************************************************************/
26 | ///
27 | /// Convert the specified money string to a money decimal, or 0 if the conversion fails.
28 | ///
29 | ///
30 | ///
31 | public static decimal ToDecimal(string s)
32 | {
33 | #if notyet // KEY:GlobalizationInWasm - This works for Windows but not yet for was wasm
34 | if (decimal.TryParse(s, System.Globalization.NumberStyles.Currency, null, out var result))
35 | {
36 | Lesarde.Frogui.Application.Me.LogWriteLine($"ToDecimal({s}) = {result}");
37 | return result;
38 | }
39 |
40 | Lesarde.Frogui.Application.Me.LogWriteLine($"ToDecimal({s}) failed.");
41 | return 0;
42 | #else
43 | var decStr = Regex.Match(s, Pattern);
44 | if (decStr.Success && decimal.TryParse(decStr.Value, out var decValue))
45 | return decValue;
46 |
47 | return 0.0M;
48 | #endif
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Samples/Demo/PresetSelector.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 |
4 | namespace Demo
5 | {
6 | //public class PresetSelector : Droplist
7 | public class PresetSelector : ListBox
8 | {
9 | static readonly string[] Names = {
10 | "None",
11 | "A",
12 | "B",
13 | "C",
14 | "D",
15 | "E",
16 | "F",
17 | "G",
18 | "H",
19 | "I",
20 | "J",
21 | "K",
22 | "L",
23 | "M",
24 | "N",
25 | "O",
26 | "P",
27 | "Q",
28 | "R",
29 | "S",
30 | "T",
31 | "U",
32 | "V",
33 | "W",
34 | "X",
35 | "Y",
36 | "Z"
37 | };
38 |
39 | Style[] presets;
40 | IExampleView exampleView;
41 |
42 | public PresetSelector()
43 | {
44 | this.ItemsWrapping = FlexWrapping.Wrap;
45 | this.ItemsDirection = FlexDirection.Row;
46 |
47 | this.ItemViewMatcher = new SingleModelViewMatcher(typeof(StringView));
48 | }
49 |
50 | public void Init(Style[] presets, IExampleView exampleView)
51 | {
52 | var totalPresets = presets.Length;
53 | var totalDroplistItems = totalPresets + 1;
54 | this.presets = presets;
55 | this.exampleView = exampleView;
56 |
57 | // Increasings items in dropdown...
58 | if (totalDroplistItems > Items.Count)
59 | {
60 | for (var i = Items.Count; i < totalDroplistItems; ++i)
61 | this.Items.Add(Names[i]);
62 | }
63 | // Decreasing items in dropdown...
64 | else if (totalDroplistItems < Items.Count)
65 | {
66 | for (var i = Items.Count; i > totalDroplistItems; --i)
67 | this.Items.RemoveAt(i-1);
68 | }
69 |
70 | SelectedItem = Names[0];
71 |
72 | Sync();
73 | }
74 |
75 | protected override void OnSelectedItemChanged(object origValue, object newValue)
76 | {
77 | base.OnSelectedItemChanged(origValue, newValue);
78 | if (null != exampleView)
79 | Sync();
80 | }
81 |
82 | void Sync()
83 | {
84 | if (SelectedIndex > 0)
85 | exampleView.MainElement.Style = presets[SelectedIndex - 1];
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Flex/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 |
5 | namespace Demo.Example_Flex
6 | {
7 | /***************************************************************************************************
8 | View class
9 | ***************************************************************************************************/
10 | ///
11 | /// Demonstrates the element.
12 | ///
13 | public partial class View : Decorator, IExampleView
14 | {
15 | public View()
16 | {
17 | InitializeComponent();
18 |
19 | Brush
20 | borderBrush = SolidColorBrushes.SeaShell.Brush,
21 | darkNumberBrush = SolidColorBrushes.Black.Brush,
22 | lightNumberBrush = SolidColorBrushes.Gray.Brush;
23 |
24 | var ballRadius = 60.0d;
25 | var ballLength = new Length(ballRadius * 2, Unit.Px);
26 | var ballCornerRadius = new CornerRadius(new Length(ballRadius, Unit.Px));
27 | var numberFontSize = FontSize.FromKind(FontSizeKind.Large);
28 |
29 | for (var i = 0; i < 30; ++i)
30 | {
31 | var ballBackground = Common.SolidColorBrushes[i % Common.SolidColorBrushes.Length];
32 | var isBallDark = ballBackground.Color.R.Intensity + ballBackground.Color.G.Intensity + ballBackground.Color.B.Intensity < 0x180;
33 |
34 | var e_ball = new Border()
35 | {
36 | CornerRadius = ballCornerRadius,
37 | BorderBrush = borderBrush,
38 | Background = ballBackground,
39 | Width = ballLength,
40 | Height = ballLength
41 | };
42 |
43 | var e_number = new TextBlock()
44 | {
45 | Foreground = (isBallDark) ? lightNumberBrush : darkNumberBrush,
46 | Text = i.ToString(),
47 | FontSize = numberFontSize,
48 | HorizontalAlignment = HorizontalAlignment.Center,
49 | VerticalAlignment = VerticalAlignment.Center
50 | };
51 |
52 | e_ball.Child = e_number;
53 |
54 | e_flex.Children.Add(e_ball);
55 | }
56 | }
57 |
58 | Element IExampleView.MainElement => e_flex;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Path/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 | using Lesarde.Frogui.Shapes;
5 |
6 | namespace Demo.Example_Path
7 | {
8 |
9 | /***************************************************************************************************
10 | View class
11 | ***************************************************************************************************/
12 | ///
13 | /// Demonstrates the class.
14 | ///
15 | /// Coding paths is definitely not intuitive and can become quite complex. Working with
16 | /// paths is easier using XAML (e.g. Path Data="M150 0 L75 200 L225 200 Z") or even
17 | /// better, using an SVG path editing tool. We were not able to get paths working in XAML in
18 | /// time for this release.
19 | ///
20 | ///
21 | public partial class View : Flex, IExampleView
22 | {
23 | Element IExampleView.MainElement => e_check;
24 |
25 | Path e_check { get; set; }
26 |
27 | public View()
28 | {
29 | InitializeComponent();
30 |
31 | // Create a check mark path (see class comments above).
32 | e_check = new Path();
33 | var pg = new PathGeometry();
34 | e_check.Data = pg;
35 | pg.Figures = new PathFigureCollection();
36 | var pf = new PathFigure();
37 | pf.StartPoint = new PointFloat(9.97498, 1.22334);
38 | pg.Figures.Add(pf);
39 | pf.Segments = new PathSegmentCollection();
40 | pf.Segments.Add(new LineSegment(new PointFloat(4.6983, 9.09834), true));
41 | pf.Segments.Add(new LineSegment(new PointFloat(4.52164, 9.09834), true));
42 | pf.Segments.Add(new LineSegment(new PointFloat(0, 5.19331), true));
43 | pf.Segments.Add(new LineSegment(new PointFloat(1.27664, 3.52165), true));
44 | pf.Segments.Add(new LineSegment(new PointFloat(4.255, 6.08833), true));
45 | pf.Segments.Add(new LineSegment(new PointFloat(8.33331, 1.52588e-005), true));
46 | pf.Segments.Add(new LineSegment(new PointFloat(9.97498, 1.22334), true));
47 |
48 | Children.Add(e_check);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Observable A/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using System;
4 | using System.Linq;
5 | using System.Reactive.Linq;
6 |
7 | namespace Demo.Example_Observable_A
8 | {
9 | /***************************************************************************************************
10 | View class
11 | ***************************************************************************************************/
12 | ///
13 | /// Demonstrates the class.
14 | ///
15 | public partial class View : Flex, IExampleView
16 | {
17 | public View()
18 | {
19 | InitializeComponent();
20 |
21 | #if ! WASM
22 | // e_tb1 <- e_tb2
23 | e_tb1.CreateObservable(TextBox.TextProperty)
24 | .Subscribe(v => e_tb2.Text = v);
25 |
26 | // e_tb1 <- e_tb3 - delay 2 seconds
27 | e_tb1.CreateObservable(TextBox.TextProperty)
28 | .Delay(TimeSpan.FromSeconds(2))
29 | .Subscribe(v => e_tb3.Text = v);
30 |
31 | // e_tb1 <- e_tb4 - delay 4 seconds
32 | e_tb1.CreateObservable(TextBox.TextProperty)
33 | .Delay(TimeSpan.FromSeconds(4))
34 | .Subscribe(v => e_tb4.Text = v);
35 |
36 | // e_tb1 <- e_tb5 - replace 'a' with '*'
37 | e_tb1.CreateObservable(TextBox.TextProperty)
38 | .Select(v => e_tb5.Text = v.Replace('a', '*'))
39 | .Subscribe(v => e_tb5.Text = v);
40 |
41 | // e_tb1 <- e_tb6 - throttle 3 seconds
42 | e_tb1.CreateObservable(TextBox.TextProperty)
43 | .Throttle(TimeSpan.FromSeconds(3))
44 | .Subscribe(v => e_tb6.Text = v);
45 |
46 | // e_tb1 <- e_tb7 - buffer 1 second
47 | e_tb1.CreateObservable(TextBox.TextProperty)
48 | .Buffer(TimeSpan.FromSeconds(1))
49 | .Select(argsList => string.Join('\n', argsList))
50 | .Subscribe(v => e_tb7.Text = v);
51 |
52 | // e_tb1 <- e_tb8 - TimeInterval()
53 | e_tb1.CreateObservable(TextBox.TextProperty)
54 | .TimeInterval()
55 | .Subscribe(v => e_timeInterval.Text = v.Interval.ToString());
56 | #endif
57 | }
58 |
59 | Element IExampleView.MainElement => this;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/EffectEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Controls;
4 | using Lesarde.Frogui.Media.Effects;
5 |
6 | namespace Demo
7 | {
8 | /***************************************************************************************************
9 | EffectEditor class
10 | ***************************************************************************************************/
11 |
12 | public class EffectEditor : CheckedEditorPart where EDITOR : Element, IPropertyEditor, new()
13 | {
14 | /***********************************************************
15 | properties
16 | ***********************************************************/
17 |
18 | public GraphicsEffectEditor ParentEditor { get; set; }
19 | public GraphicsEffect Effect { get; set; }
20 | public DependencyProperty Dproperty { get; set; }
21 |
22 | /*******************************************************************************
23 | $
24 | *******************************************************************************/
25 |
26 | public EffectEditor(GraphicsEffectEditor parentEditor, string label, GraphicsEffect effect, DependencyProperty dproperty)
27 | {
28 | this.ParentEditor = parentEditor;
29 | this.Effect = effect;
30 | this.Dproperty = dproperty;
31 |
32 | parentEditor.Members.Add(this, new Placecard(label));
33 |
34 | //E_editor.SetBinding(Slider.UserValue1Property, new Binding(dproperty, effect) { Mode = BindingMode.TwoWay });
35 | E_editor.BindToSourceProperty(effect, dproperty);
36 |
37 | E_checkBox.AddPropertyChangedListener(CheckBox.IsCheckedProperty, ValueChanged_IsChecked);
38 | }
39 |
40 | /*******************************************************************************
41 | ValueChanged_IsChecked()
42 | *******************************************************************************/
43 |
44 | internal void ValueChanged_IsChecked(bool v)
45 | {
46 | if (v)
47 | ParentEditor.CombinedEffect.Effects.Add(Effect);
48 | else
49 | ParentEditor.CombinedEffect.Effects.Remove(Effect);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Observable A/View.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
21 |
22 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Tip Calculator/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using System;
4 | using System.Reactive.Linq;
5 |
6 | namespace Demo.Example_Tip_Calculator
7 | {
8 | /***************************************************************************************************
9 | View class
10 |
11 | TODO:Add localized currency support
12 | https://docs.microsoft.com/en-us/globalization/locale/currency-formatting-in-the-dotnet-framework
13 | https://stackoverflow.com/questions/14162357/convert-currency-string-to-decimal
14 |
15 | TODO:Diagram how Tip Calc works -- data-binding & observation
16 | ***************************************************************************************************/
17 | ///
18 | /// This is the main element of the tip calculator demo. It inherits from
19 | /// which provides a simple way to pad and have a background.
20 | ///
21 | /// Uses as a model.
22 | ///
23 | public partial class View : Border, IViewOfModel, IExampleView
24 | {
25 | /***********************************************************
26 | Model property
27 | ***********************************************************/
28 |
29 | public Model Model => (Model)ModelObject;
30 |
31 | public object ModelObject
32 | {
33 | get => DataContext;
34 | set => DataContext = value;
35 | }
36 |
37 | Element IExampleView.MainElement => this;
38 |
39 | //public object ModelObject { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
40 |
41 | /*******************************************************************************
42 | $
43 | *******************************************************************************/
44 |
45 | public View()
46 | {
47 | InitializeComponent();
48 |
49 | ModelObject = new Model();
50 |
51 | // Observe the Model.NumPeopleProperty
52 | Model
53 | .CreateObservable(Model.NumPeopleProperty)
54 | .Select(numPeople => 1 == numPeople ? Visibility.Collapsed : Visibility.Visible)
55 | .Subscribe(vis =>
56 | {
57 | e_tipPerPersonLabel.Visibility = vis;
58 | e_totalPerPersonLabel.Visibility = vis;
59 | });
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/Samples/HelloWorldB/HelloWorldB.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.2
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | mono\
18 |
19 |
20 | mono\
21 |
22 |
23 | mono\
24 |
25 |
26 | mono\
27 |
28 |
29 |
30 |
31 |
32 | MSBuild:Compile
33 |
34 |
35 | MSBuild:Compile
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/Samples/HelloWorldC/HelloWorldC.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.2
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | mono\
18 |
19 |
20 | mono\
21 |
22 |
23 | mono\
24 |
25 |
26 | mono\
27 |
28 |
29 |
30 |
31 |
32 | MSBuild:Compile
33 |
34 |
35 | MSBuild:Compile
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/Brushes.cs:
--------------------------------------------------------------------------------
1 | using Lesarde;
2 | using Lesarde.Frogui;
3 | using Lesarde.Frogui.Media;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Threading.Tasks;
8 |
9 | namespace Demo
10 | {
11 | /***************************************************************************************************
12 | Brushes class
13 | ***************************************************************************************************/
14 |
15 | public abstract class Brushes : DependencyObject
16 | {
17 | /***********************************************************
18 | All property
19 | ***********************************************************/
20 |
21 | public abstract IList All { get; }
22 |
23 | public abstract BrushVariety Variety { get; }
24 |
25 | /*******************************************************************************
26 | Init()
27 | *******************************************************************************/
28 |
29 | protected static void Init(Type t, IList all)
30 | {
31 | var propInfos = t.GetProperties(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public).Where(o => o.PropertyType == typeof(BrushInfo));
32 |
33 | var i = 0;
34 | foreach (var cur in propInfos)
35 | all[i++].Name = cur.Name;
36 | }
37 |
38 | /*******************************************************************************
39 | Add()
40 | *******************************************************************************/
41 |
42 | protected static BrushInfo Add(Brush brush, IList all)
43 | {
44 | var info = new BrushInfo { Brush = brush };
45 |
46 | all.Add(info);
47 |
48 | return info;
49 | }
50 |
51 | /*******************************************************************************
52 | IndexOf()
53 | *******************************************************************************/
54 |
55 | public int IndexOf(Brush brush)
56 | {
57 | for (var i = 0; i < All.Count; ++i)
58 | if (All[i].Brush == brush)
59 | return i;
60 |
61 | return -1;
62 | }
63 |
64 | /*******************************************************************************
65 | Find()
66 | *******************************************************************************/
67 |
68 | public BrushInfo Find(Brush brush) => All.FirstOrDefault(o => o.Brush == brush);
69 |
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Samples/HelloWorldA/HelloWorldA.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netcoreapp2.2
4 | 40
5 | C:\proj\Dev\Frogui\Backup\repo\Samples\HelloWorld\
6 | 2.0
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | mono\
17 |
18 |
19 | mono\
20 |
21 |
22 | mono\
23 |
24 |
25 | mono\
26 |
27 |
28 |
29 |
30 | MSBuild:Compile
31 |
32 |
33 | MSBuild:Compile
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/Bitmaps.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui.Media.Imaging;
2 | using System;
3 |
4 | namespace Demo
5 | {
6 | public class Bitmaps
7 | {
8 | public class BitmapInfo
9 | {
10 | public string FileName { get; set; }
11 | public string Name { get; set; }
12 | public BitmapImage Bitmap { get; set; }
13 |
14 | public BitmapInfo(string fileName)
15 | {
16 | this.FileName = fileName;
17 | this.Name = fileName.Substring(0, fileName.Length - 4).Replace('-', ' ');
18 | this.Bitmap = new BitmapImage(new System.Uri($"Resources/{fileName}", UriKind.Relative));
19 | }
20 | }
21 |
22 | public static BitmapInfo FroguiLogo = new BitmapInfo("Frogui-Logo.png");
23 |
24 | public static BitmapInfo Disenchantment = new BitmapInfo("Disenchantment.jpg");
25 | public static BitmapInfo ScoobyDoo = new BitmapInfo("Scooby-Doo.png");
26 | public static BitmapInfo TheSimpsons = new BitmapInfo("The-Simpsons.jpg");
27 | public static BitmapInfo TheFlintstones = new BitmapInfo("The-Flintstones.jpg");
28 | public static BitmapInfo TheJetsons = new BitmapInfo("The-Jetsons.jpg");
29 | public static BitmapInfo BobsBurgers = new BitmapInfo("Bobs-Burgers.jpg");
30 | public static BitmapInfo FamilyGuy = new BitmapInfo("Family-Guy.png");
31 | public static BitmapInfo KingOfTheHill = new BitmapInfo("King-Of-The-Hill.png");
32 | public static BitmapInfo CheckeredLight = new BitmapInfo("Checkered-Light.png");
33 | public static BitmapInfo CheckeredDark = new BitmapInfo("Checkered-Dark.png");
34 | public static BitmapInfo CheckeredMedium = new BitmapInfo("Checkered-Medium.png");
35 | public static BitmapInfo LesardeLogo = new BitmapInfo("Lesarde-Logo.png");
36 | public static BitmapInfo GmailLogo = new BitmapInfo("Gmail-Logo.png");
37 | public static BitmapInfo Sun = new BitmapInfo("Sun.png");
38 | public static BitmapInfo Cart = new BitmapInfo("Cart.png");
39 | public static BitmapInfo Email = new BitmapInfo("Email.png");
40 | public static BitmapInfo Search = new BitmapInfo("Search.png");
41 | public static BitmapInfo Filter = new BitmapInfo("Filter.png");
42 | public static BitmapInfo AmericanFlag = new BitmapInfo("American-Flag.png");
43 |
44 | public static BitmapInfo[] All =
45 | {
46 | Disenchantment,
47 | ScoobyDoo,
48 | TheSimpsons,
49 | TheFlintstones,
50 | TheJetsons,
51 | BobsBurgers,
52 | FamilyGuy,
53 | KingOfTheHill,
54 | CheckeredLight,
55 | CheckeredDark,
56 | CheckeredMedium,
57 | LesardeLogo,
58 | GmailLogo,
59 | Sun,
60 | Cart,
61 | Email,
62 | Search,
63 | Filter,
64 | AmericanFlag
65 | };
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Animation A/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Input;
4 | using Lesarde.Frogui.Media;
5 | using Lesarde.Frogui.Media.Animation;
6 | using Lesarde.Frogui.Shapes;
7 | using System;
8 |
9 | namespace Demo.Example_Animation_A
10 | {
11 | /***************************************************************************************************
12 | View class
13 | ***************************************************************************************************/
14 | ///
15 | /// Demonstrates the class.
16 | ///
17 | public partial class View : Paper, IExampleView
18 | {
19 | Random random = new Random();
20 |
21 | Element IExampleView.MainElement => this;
22 |
23 | public View()
24 | {
25 | InitializeComponent();
26 |
27 | var size = new Lesarde.Frogui.Length(60, Lesarde.Frogui.Unit.Px);
28 |
29 | for (var i = 0; i < 50; ++i)
30 | {
31 | var e_ellipse = new Ellipse()
32 | {
33 | Width = size,
34 | Height = size,
35 | StrokeThickness = new Lesarde.Frogui.Length(i % 3, Lesarde.Frogui.Unit.Px),
36 | Stroke = Common.BrushesMix[(i + 1) % Common.BrushesMix.Length],
37 | Opacity = GetRandomDouble(0.4, 1.0),
38 | Fill = Common.BrushesMix[i % Common.BrushesMix.Length]
39 | };
40 | e_ellipse.Animation = new TransitionAnimation() { Duration = ((double)i + 1.0) / 10.0 , TimingFunction = GetFunc(i) };
41 | this.Children.Add(e_ellipse);
42 | }
43 |
44 | AnimationFunctionBase GetFunc(int i)
45 | {
46 | switch (i % 7)
47 | {
48 | case 0: return Linear.Singleton;
49 | case 1: return Ease.InSingleton;
50 | case 2: return Ease.OutSingleton;
51 | case 3: return Ease.InOutSingleton;
52 | case 4: return QuadraticEase.InSingleton;
53 | case 5: return QuadraticEase.OutSingleton;
54 | case 6: return QuadraticEase.InOutSingleton;
55 | }
56 |
57 | return null;
58 | }
59 |
60 | }
61 |
62 | void MyPointerDown(object sender, PointerEventArgs e)
63 | {
64 | var zero = new Lesarde.Frogui.Length(0, Lesarde.Frogui.Unit.Px);
65 |
66 | var scale = GetRandomDouble(1, 300) / 100.0;
67 | var scaleTransform = new ScaleTransform(scale, scale);
68 |
69 | foreach (Ellipse cur in this.Children)
70 | {
71 | if (GetRandomInt(0, 4) != 0)
72 | {
73 | cur.TranslateX = Length.InPixels(e.Position.X);
74 | cur.TranslateY = Length.InPixels(e.Position.Y);
75 | cur.RenderTransform = scaleTransform;
76 | }
77 | }
78 | }
79 |
80 | public double GetRandomDouble(double min, double max) => random.NextDouble() * (max - min) + min;
81 | public int GetRandomInt(int min, int max) => random.Next() % (max - min + 1) + min;
82 |
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/ImageBrushes.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Media;
3 | using Lesarde.Frogui.Media.Imaging;
4 | using System.Collections.Generic;
5 |
6 | namespace Demo
7 | {
8 | /***************************************************************************************************
9 | ImageBrushes class
10 | ***************************************************************************************************/
11 | ///
12 | /// Implements a set of predefined image brushes.
13 | ///
14 | public class ImageBrushes : Brushes
15 | {
16 | static readonly IList all = new List();
17 |
18 | public override IList All => all;
19 |
20 | public override BrushVariety Variety => BrushVariety.Image;
21 |
22 | /***********************************************************
23 | Singleton property
24 | ***********************************************************/
25 |
26 | public static ImageBrushes Singleton { get; } = new ImageBrushes();
27 |
28 | /***********************************************************
29 | the brushes
30 | ***********************************************************/
31 |
32 | public static BrushInfo Disenchantment { get; } = Add(Bitmaps.Disenchantment.Bitmap);
33 | public static BrushInfo ScoobyDoo { get; } = Add(Bitmaps.ScoobyDoo.Bitmap);
34 | public static BrushInfo Simpsons { get; } = Add(Bitmaps.TheSimpsons.Bitmap);
35 | public static BrushInfo Flintstones { get; } = Add(Bitmaps.TheFlintstones.Bitmap);
36 | public static BrushInfo Jetsons { get; } = Add(Bitmaps.TheJetsons.Bitmap);
37 | public static BrushInfo BobsBurgers { get; } = Add(Bitmaps.BobsBurgers.Bitmap);
38 | public static BrushInfo FamilyGuy { get; } = Add(Bitmaps.FamilyGuy.Bitmap);
39 | public static BrushInfo CheckeredLight { get; } = Add(Bitmaps.CheckeredLight.Bitmap);
40 | public static BrushInfo CheckeredMedium { get; } = Add(Bitmaps.CheckeredMedium.Bitmap);
41 | public static BrushInfo CheckeredDark { get; } = Add(Bitmaps.CheckeredDark.Bitmap);
42 |
43 | /*******************************************************************************
44 | ! $
45 | *******************************************************************************/
46 |
47 | static ImageBrushes()
48 | {
49 | Init(typeof(ImageBrushes), all);
50 | }
51 |
52 | /*******************************************************************************
53 | $
54 | *******************************************************************************/
55 |
56 | private ImageBrushes() { }
57 |
58 | /*******************************************************************************
59 | Add()
60 | *******************************************************************************/
61 |
62 | static BrushInfo Add (BitmapImage image) => Add(new ImageBrush(image), all);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/ScrollBar/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Controls.Primitives;
4 | using System;
5 |
6 | namespace Demo.Example_ScrollBar
7 | {
8 | /***************************************************************************************************
9 | View class
10 | ***************************************************************************************************/
11 | ///
12 | /// Demonstrates the class.
13 | ///
14 | public partial class View : Decorator, IExampleView
15 | {
16 | Length
17 | SbWidth = new Length(60, Unit.Px),
18 | SbHeight = new Length(700, Unit.Px);
19 |
20 | Element IExampleView.MainElement => e_scrollbar;
21 |
22 | void AddEnums(Selector selector, Type type, object selectedItem)
23 | {
24 | foreach (var cur in Enum.GetValues(type))
25 | selector.Items.Add(cur);
26 | selector.SelectedItem = selectedItem;
27 | }
28 |
29 | /*******************************************************************************
30 | $
31 | *******************************************************************************/
32 |
33 | public View()
34 | {
35 | InitializeComponent();
36 |
37 | PrepareScrollbar();
38 | }
39 |
40 | /*******************************************************************************
41 | E_orientation_SelectionChanged()
42 | *******************************************************************************/
43 |
44 | void E_orientation_SelectionChanged(object sender, SelectionChangedEventArgs e)
45 | {
46 | }
47 |
48 | /*******************************************************************************
49 | PrepareScrollbar()
50 | *******************************************************************************/
51 |
52 | void PrepareScrollbar()
53 | {
54 | e_scrollbar.AddPropertyChangedListener(ScrollBar.OrientationProperty, v =>
55 | {
56 | // Horizontal
57 | if (e_scrollbar.Orientation == Orientation.Horizontal)
58 | {
59 | e_scrollbar.Width = this.SbHeight;
60 | e_scrollbar.Height = this.SbWidth;
61 | }
62 | // Vertical
63 | else
64 | {
65 | e_scrollbar.Width = this.SbWidth;
66 | e_scrollbar.Height = this.SbHeight;
67 | }
68 | });
69 |
70 | e_scrollbar.SmallChange = 1.0m;
71 | e_scrollbar.LargeChange = 10.0m;
72 | e_scrollbar.Minimum = 1.0m;
73 | e_scrollbar.Maximum = 10.0m;
74 | e_scrollbar.Value = e_scrollbar.Minimum;
75 | e_scrollbar.ViewportSize = 20.0m;
76 |
77 | e_scrollbar.Background = SolidColorBrushes.Black.Brush;
78 | e_scrollbar.VaryButtonFill = SolidColorBrushes.DarkRed.Brush;
79 | e_scrollbar.TrackBackground = SolidColorBrushes.DodgerBlue.Brush;
80 | e_scrollbar.ThumbBackground = SolidColorBrushes.Violet.Brush;
81 |
82 | e_scrollbar.ThumbBorderBrush = SolidColorBrushes.Navy.Brush;
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Samples/Demo/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | DeepSkyBlue
10 |
11 |
12 |
13 |
38 |
39 |
44 |
45 |
59 |
60 |
61 |
64 |
65 |
66 |
69 |
70 |
78 |
79 |
82 |
83 |
84 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/LinearGradientBrushes.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Lesarde.Frogui;
3 | using Lesarde.Frogui.Media;
4 |
5 | namespace Demo
6 | {
7 | /***************************************************************************************************
8 | LinearGradientBrushes class
9 | ***************************************************************************************************/
10 | ///
11 | /// Implements a set of predefined linear gradient brushes.
12 | ///
13 | public class LinearGradientBrushes : Brushes
14 | {
15 | static readonly IList all = new List();
16 |
17 | public override IList All => all;
18 |
19 | public override BrushVariety Variety => BrushVariety.LinearGradient;
20 |
21 | /***********************************************************
22 | Singleton property
23 | ***********************************************************/
24 |
25 | public static LinearGradientBrushes Singleton { get; } = new LinearGradientBrushes();
26 |
27 | /***********************************************************
28 | the brushes
29 | ***********************************************************/
30 |
31 | public static BrushInfo Sunrise { get; } = Add(new LinearGradientBrush(Common.GradientStops_Sunrise));
32 | public static BrushInfo BlueHaze { get; } = Add(new LinearGradientBrush(Common.GradientStops_BlueHaze));
33 | public static BrushInfo ShadedWhite { get; } = Add(new LinearGradientBrush(Common.GradientStops_ShadedWhite));
34 | public static BrushInfo TwilightZone { get; } = Add(new LinearGradientBrush(Common.GradientStops_TwilightZone));
35 | public static BrushInfo Rainbow { get; } = Add(new LinearGradientBrush(Common.GradientStops_Rainbow));
36 | public static BrushInfo Chrome { get; } = Add(new LinearGradientBrush(Common.GradientStops_Chrome));
37 | public static BrushInfo Ruby { get; } = Add(new LinearGradientBrush(Common.GradientStops_Ruby));
38 | public static BrushInfo Sapphire { get; } = Add(new LinearGradientBrush(Common.GradientStops_Sapphire));
39 | public static BrushInfo GrayFade { get; } = Add(new LinearGradientBrush(Common.GradientStops_GrayFade));
40 | public static BrushInfo RicePaperFade { get; } = Add(new LinearGradientBrush(Common.GradientStops_RicePaperFade));
41 |
42 | /*******************************************************************************
43 | ! $
44 | *******************************************************************************/
45 |
46 | static LinearGradientBrushes()
47 | {
48 | Init(typeof(LinearGradientBrushes), all);
49 | }
50 |
51 | /*******************************************************************************
52 | $
53 | *******************************************************************************/
54 |
55 | private LinearGradientBrushes() { }
56 |
57 | /*******************************************************************************
58 | Add()
59 | *******************************************************************************/
60 |
61 | static BrushInfo Add(LinearGradientBrush brush) => Add(brush, all);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Samples/Demo/Shared/RadialGradientBrushes.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Media;
3 | using System.Collections.Generic;
4 |
5 | namespace Demo
6 | {
7 | /***************************************************************************************************
8 | RadialGradientBrushes class
9 | ***************************************************************************************************/
10 | ///
11 | /// Implements a set of predefined radial gradient brushes.
12 | ///
13 | public class RadialGradientBrushes : Brushes
14 | {
15 | static readonly IList all = new List();
16 |
17 | public override IList All => all;
18 |
19 | public override BrushVariety Variety => BrushVariety.RadialGradient;
20 |
21 | /***********************************************************
22 | Singleton property
23 | ***********************************************************/
24 |
25 | public static RadialGradientBrushes Singleton { get; } = new RadialGradientBrushes();
26 |
27 | /***********************************************************
28 | the brushes
29 | ***********************************************************/
30 |
31 | public static BrushInfo Sunrise { get; } = Add(new RadialGradientBrush(Common.GradientStops_Sunrise));
32 | public static BrushInfo BlueHaze { get; } = Add(new RadialGradientBrush(Common.GradientStops_BlueHaze));
33 | public static BrushInfo ShadedWhite { get; } = Add(new RadialGradientBrush(Common.GradientStops_ShadedWhite));
34 | public static BrushInfo TwilightZone { get; } = Add(new RadialGradientBrush(Common.GradientStops_TwilightZone));
35 | public static BrushInfo Rainbow { get; } = Add(new RadialGradientBrush(Common.GradientStops_Rainbow));
36 | public static BrushInfo Chrome { get; } = Add(new RadialGradientBrush(Common.GradientStops_Chrome));
37 | public static BrushInfo Ruby { get; } = Add(new RadialGradientBrush(Common.GradientStops_Ruby));
38 | public static BrushInfo Sapphire { get; } = Add(new RadialGradientBrush(Common.GradientStops_Sapphire));
39 | public static BrushInfo GrayFade { get; } = Add(new RadialGradientBrush(Common.GradientStops_GrayFade));
40 | public static BrushInfo RicePaperFade { get; } = Add(new RadialGradientBrush(Common.GradientStops_RicePaperFade));
41 |
42 | /*******************************************************************************
43 | ! $
44 | *******************************************************************************/
45 |
46 | static RadialGradientBrushes()
47 | {
48 | Init(typeof(RadialGradientBrushes), all);
49 | }
50 |
51 | /*******************************************************************************
52 | $
53 | *******************************************************************************/
54 |
55 | private RadialGradientBrushes() { }
56 |
57 | /*******************************************************************************
58 | Add()
59 | *******************************************************************************/
60 |
61 | static BrushInfo Add(RadialGradientBrush brush) => Add(brush, all);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Samples/Demo/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | #404080
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/Samples/HelloWorldC/ViewModel.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 |
3 | namespace HelloWorldC
4 | {
5 | /***************************************************************************************************
6 | ViewModel class
7 | ***************************************************************************************************/
8 | ///
9 | /// Used to model this application's message. Given the simple requirements of this app, having
10 | /// a view-model class is excessive, but serves as an ideal way to demonstrate how to design
11 | /// views and view-models.
12 | ///
13 | /// When using Frogui, as with general MVVM development, determining when to use a model versus
14 | /// a view-model sometimes comes down to a matter of preference. In scenarios where only one or
15 | /// the other is needed, we recommand using a model if the type is a plain CLR class, and a
16 | /// view-model (by inheriting from ) if binding, command processing
17 | /// or other features offered by are needed.
18 | ///
19 | /// Another advantage of dependency properties is they DO NOT take up memory space unless they
20 | /// are set to a value other than the default. In some cases this is a nominal advantage,
21 | /// while in other cases, such as when there are many objects, many properties or both the
22 | /// space savings can be substantial.
23 | ///
24 | /// Inherits from DependencyObject so that dependency properties can be used.
25 | ///
26 | public class ViewModel : DependencyObject
27 | {
28 | /***********************************************************
29 | Message property
30 | ***********************************************************/
31 | ///
32 | /// Identifies the dependency property.
33 | ///
34 | /// The actual name of a dependency property is derived by removing
35 | /// "Property" from the dependency property name. In this case,
36 | /// "MessageProperty" minus "Property" yields "Message."
37 | /// This may be a little bit confusing if you are new to XAML-based
38 | /// development, but it's done that way so that a "wrapper" property
39 | /// can also be made which is accessible from C#. In this case,
40 | /// the wrapper property below this property is called Message.
41 | ///
42 | ///
43 | public static DependencyProperty MessageProperty { get; } = DependencyProperty
44 | .Register() // Register the "Message" dependency property
45 | .Default("Hello, World!"); // Set the default values to "Hello, World!"
46 |
47 | ///
48 | /// Gets or sets the messages.
49 | ///
50 | /// You may be wondering why there is a setter below since this app's
51 | /// only purpose is to say hello to the world :) It's simply there
52 | /// in case you'd like to experiment with changing the message
53 | /// while the app is running.
54 | ///
55 | /// Because the binding in Greeting.xaml to this property
56 | /// uses the default mode (BindingMode.OneWay), any changes
57 | /// to this property will update automatically in the display.
58 | ///
59 | public string Message
60 | {
61 | get => GetValue(MessageProperty);
62 | set => SetValue(MessageProperty, value);
63 | }
64 |
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/BrushSlider.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 | using System;
5 | using System.Collections.Generic;
6 |
7 | namespace Demo
8 | {
9 | /***************************************************************************************************
10 | BrushSlider class
11 | ***************************************************************************************************/
12 |
13 | public class BrushSlider : MagicSlider
14 | {
15 | /***********************************************************
16 | MyPreviewView class
17 | ***********************************************************/
18 |
19 | class MyPreviewView : Grid
20 | {
21 | TextBlock e_name { get; } = new TextBlock()
22 | {
23 | Foreground = SolidColorBrushes.LightGray.Brush,
24 | Width = new Length(75, Unit.Px)
25 | };
26 |
27 | Border e_color { get; } = new Border()
28 | {
29 | Width = new Length(40, Unit.Px),
30 | Height = new Length(20, Unit.Px),
31 | BorderBrush = SolidColorBrushes.DarkSlateGray.Brush,
32 | BorderThickness = new Thickness(new Length(0.5, Unit.Px)),
33 | CornerRadius = new CornerRadius(new Length(4, Unit.Px))
34 | };
35 |
36 | public MyPreviewView()
37 | {
38 | ColumnCount = 2;
39 |
40 | AddPropertyChangedListener(Element.DataContextProperty, v =>
41 | {
42 | if (v is BrushInfo colorInfo)
43 | {
44 | e_name.Text = colorInfo.Name;
45 | e_color.Background = colorInfo.Brush;
46 | }
47 | });
48 |
49 | this.Children.Add(e_color);
50 | this.Children.Add(e_name, new GridAnchor(1, 0));
51 | }
52 | }
53 |
54 | /***********************************************************
55 | Brush property
56 | ***********************************************************/
57 |
58 | public static DependencyProperty BrushProperty { get; } = DependencyProperty
59 | .Register();
60 |
61 | public Brush Brush
62 | {
63 | get => GetValue(BrushProperty);
64 | set => SetValue(BrushProperty, value);
65 | }
66 |
67 | /***********************************************************
68 | Items property
69 | ***********************************************************/
70 |
71 | public Brushes Items
72 | {
73 | get => items;
74 |
75 | set
76 | {
77 | this.items = value;
78 | if (null != value)
79 | this.Maximum = Items.All.Count - 1;
80 | }
81 | }
82 |
83 | Brushes items;
84 |
85 | public override bool TranslateToUserValue1(decimal value, out object newValue)
86 | {
87 | newValue = Items?.All[(int)value];
88 | return true;
89 | }
90 |
91 | public override bool TranslateToUserValue2(decimal value, out object newValue)
92 | {
93 | newValue = Items?.All[(int)value].Brush;
94 | return true;
95 | }
96 |
97 | /*******************************************************************************
98 | $
99 | *******************************************************************************/
100 |
101 | public BrushSlider()
102 | {
103 | PreviewSource = SliderPreviewSource.UserValue1;
104 | PreviewView = new MyPreviewView();
105 |
106 | this.SmallChange = 1.0m;
107 | this.LargeChange = 1.0m;
108 | }
109 |
110 | ~BrushSlider()
111 | {
112 |
113 | }
114 | }
115 |
116 | }
117 |
--------------------------------------------------------------------------------
/Samples/Demo/Editors/EnumEditor.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.ComponentModel;
3 | using Lesarde.Frogui.Data;
4 | using Lesarde.Frogui.Media.Imaging;
5 | using System;
6 | using System.Collections.Generic;
7 |
8 | namespace Demo
9 | {
10 | public abstract class EnumEditor : MagicSegmentor, IPropertyEditor
11 | {
12 | /***********************************************************
13 | Segments property
14 | ***********************************************************/
15 |
16 | public override Segment[] Segments => segments;
17 |
18 | static Segment[] segments;
19 |
20 | /***********************************************************
21 | NameOfT property
22 | ***********************************************************/
23 |
24 | string NameOfT => typeof(T).Name;
25 |
26 | /*******************************************************************************
27 | $
28 | *******************************************************************************/
29 |
30 | public EnumEditor()
31 | {
32 | }
33 |
34 | /*******************************************************************************
35 | Initialize()
36 | *******************************************************************************/
37 |
38 | protected override void Initialize()
39 | {
40 | if (null == segments)
41 | {
42 | var items = new List();
43 |
44 | var names = typeof(T).GetEnumNames();
45 | var values = typeof(T).GetEnumValues();
46 |
47 | var i = 0;
48 | foreach (var value in values)
49 | {
50 | var segment = new Segment();
51 | PrepSegment(segment, names[i], (T)values.GetValue(i));
52 | items.Add(segment);
53 | ++i;
54 | }
55 | segments = items.ToArray();
56 | }
57 |
58 | base.Initialize();
59 | }
60 |
61 | /*******************************************************************************
62 | UseValue()
63 | *******************************************************************************/
64 |
65 | protected virtual bool UseValue(T value) => true;
66 |
67 | /*******************************************************************************
68 | PrepSegment()
69 | *******************************************************************************/
70 |
71 | protected abstract void PrepSegment(Segment segment, string name, T value);
72 |
73 | /*******************************************************************************
74 | BindToSourceProperty()
75 | *******************************************************************************/
76 |
77 | void IPropertyEditor.BindToSourceProperty(DependencyObject sourceObject, DependencyProperty sourceProperty)
78 | {
79 | SetBinding(SelectedValueProperty, new Binding(sourceProperty, sourceObject) { Mode = BindingMode.TwoWay });
80 | }
81 |
82 | /*******************************************************************************
83 | MakeImageSource()
84 | *******************************************************************************/
85 |
86 | protected BitmapImage MakeImageSource(string name) => new BitmapImage(new System.Uri($"Resources/Icon-{name}.png", UriKind.Relative));
87 |
88 | /*******************************************************************************
89 | MakeTypedImageSource()
90 | *******************************************************************************/
91 |
92 | protected BitmapImage MakeTypedImageSource(string name) => MakeImageSource($"{NameOfT}-{name}");
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/_Misc/Tip Calculator/View.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 | 360px
12 | helvetica
13 | per person
14 | XLarge
15 | White
16 | Black
17 |
18 |
19 |
27 |
30 |
42 |
43 |
48 |
51 |
52 |
55 |
56 |
60 |
61 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/Samples/Demo/Examples/Grid/View.cs:
--------------------------------------------------------------------------------
1 | using Lesarde.Frogui;
2 | using Lesarde.Frogui.Controls;
3 | using Lesarde.Frogui.Media;
4 | using Lesarde.Frogui.Shapes;
5 |
6 | namespace Demo.Example_Grid
7 | {
8 | /***************************************************************************************************
9 | View class
10 | ***************************************************************************************************/
11 | ///
12 | /// Demonstrates the element.
13 | ///
14 | public partial class View : Decorator, IExampleView
15 | {
16 | /***********************************************************
17 | ...
18 | ***********************************************************/
19 |
20 | int origColumnCount = 0;
21 | int origRowCount = 0;
22 |
23 | /***********************************************************
24 | MainElement property
25 | ***********************************************************/
26 |
27 | Element IExampleView.MainElement => e_grid;
28 |
29 | /*******************************************************************************
30 | $
31 | *******************************************************************************/
32 |
33 | public View()
34 | {
35 | InitializeComponent();
36 |
37 | e_grid.AddPropertyChangedListener(Grid.ColumnCountProperty, ColumnCountChanged, true);
38 | e_grid.AddPropertyChangedListener(Grid.RowCountProperty, RowCountChanged, true);
39 | }
40 |
41 | /*******************************************************************************
42 | ColumnCountChanged()
43 | *******************************************************************************/
44 |
45 | internal void ColumnCountChanged(int newColumnCount)
46 | {
47 | // Increasing
48 | if (newColumnCount > origColumnCount)
49 | {
50 | for (var column = origColumnCount; column < newColumnCount; ++column)
51 | for (var row = 0; row < e_grid.RowCount; ++row)
52 | AddBall(column, row);
53 | }
54 | // Decreasing
55 | else
56 | {
57 | for (var column = newColumnCount; column < origColumnCount; ++column)
58 | for (var row = 0; row < e_grid.RowCount; ++row)
59 | RemoveBall(column, row);
60 | }
61 |
62 | origColumnCount = newColumnCount;
63 | }
64 |
65 | /*******************************************************************************
66 | RowCountChanged()
67 | *******************************************************************************/
68 |
69 | internal void RowCountChanged(int newRowCount)
70 | {
71 | // Increasing
72 | if (newRowCount > origRowCount)
73 | {
74 | for (var column = 0; column < e_grid.ColumnCount; ++column)
75 | for (var row = origRowCount; row < newRowCount; ++row)
76 | AddBall(column, row);
77 | }
78 | // Decreasing
79 | else
80 | {
81 | for (var column = 0; column < e_grid.ColumnCount; ++column)
82 | for (var row = newRowCount; row < origRowCount; ++row)
83 | RemoveBall(column, row);
84 | }
85 |
86 | origRowCount = newRowCount;
87 | }
88 |
89 | /*******************************************************************************
90 | AddBall()
91 | *******************************************************************************/
92 |
93 | void AddBall(int column, int row)
94 | {
95 | var e_ball = new Ellipse()
96 | {
97 | Stroke = SolidColorBrushes.Yellow.Brush,
98 | Fill = SolidColorBrushes.Blue.Brush,
99 | MinWidth = Length.InPixels(10),
100 | MinHeight = Length.InPixels(10)
101 | };
102 |
103 | e_grid.Children.Add(e_ball, new GridAnchor(column, row));
104 | }
105 |
106 | /*******************************************************************************
107 | RemoveBall()
108 | *******************************************************************************/
109 |
110 | void RemoveBall(int column, int row)
111 | {
112 | foreach (var cur in e_grid.Children)
113 | {
114 | var anchor = (GridAnchor)cur.Anchor;
115 |
116 | if (anchor.ColumnAsInt == column && anchor.RowAsInt == row)
117 | {
118 | e_grid.Children.Remove(cur);
119 | return;
120 | }
121 | }
122 | }
123 | }
124 | }
125 |
--------------------------------------------------------------------------------