A collection of samples and templates for OpenSilver application development. Provides modularized examples of XAML, C#, data binding, MVVM and other XAML-based elements. Each sample is independently structured for easy learning and reuse.
Check out all examples instantly at OpenSilver Hub (temporary).
- Real-time execution - See samples running directly in your browser
- Interactive testing - Manipulate controls and learn how they work
- View source code - Instantly examine XAML and C# code
- Implementation ideas - Explore various UI patterns and implementation methods
If OpenSilver is not installed, choose one of the following methods:
Method 1: Using .NET CLI
dotnet new install OpenSilver.Templates
Method 2: Visual Studio Extension Download and install the VS extension from https://opensilver.net/download-sdk within Visual Studio
git clone https://github.com/opensilver/samples
cd samples
cd templates
install_templates.bat
Installed templates:
- Showcase Template (OpenSilver) - Project template
- Showcase Content (OpenSilver) - Item template
- Showcase Item (OpenSilver) - Item template
cd ../src
# Open OpenSilverSample.sln in Visual Studio
samples/
├── templates/
│ ├── install_templates.bat
│ └── vs-templates/
└── src/
├── OpenSilverSample.sln # Main solution
├── OpenSilverSample/ # Sample project
│ └── MainPage.xaml # Main showcase page
└── OpenSilverSample.Browser/ # Execution project
Right-click solution → Add → New Project → Select "Showcase Template (OpenSilver)"
Right-click project → Add → New Item → Select "Showcase Content" or "Showcase Item"
- Add new TabItem to
MainPage.xaml
:
<TabItem Header="MySample">
<mysample:MySampleContent IsMenuPanelVisible="True" DefaultSelectedItemName="Basic"/>
</TabItem>
- Run
OpenSilverSample.Browser
to test
- Basic Controls: Button, ToggleButton, Slider, CheckBox, RadioButton
- Data Controls: ComboBox, ListBox, TextBox, ProgressBar
- Layout: Grid, StackPanel, WrapPanel, Border
- Advanced Components: AnimatedNavigationBar, AdaptiveColumnsPanel, StaggeredPanel
- Patterns: MVVM, Binding, DataContext, Resource
- Fork the repository
- Clone locally and install templates
- Develop new samples
- Test thoroughly and submit Pull Request