Coder Social home page Coder Social logo

emu2021makuake / xaml-code-snippets-for-vs2019 Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 60 KB

XAML code snippets for Visual Studio 2019

License: The Unlicense

Vim Snippet 100.00%
xaml snippets snippet code-snippets code-snippet visualstudio2019 wpf uwp emmet windows

xaml-code-snippets-for-vs2019's Introduction

XAML-code-snippets-for-VS2019

XAML code snippets for Visual Studio 2019.

You can enter it with a shortcut like Emmet.

Installation procedure

  1. Select Tools - Code Snippets Manager from the menu.

01

  1. Select the Import button.

02

  1. Select the Xammet.snippet file you downloaded and click the Open button.

03

  1. Select the Finish button.

04

Usage

Enter the shortcut command and type Tab.

05

06

List of snippets

Shortcut Insert code Description
btn <Button Content="Button" Margin="5" /> Button
btn# <Button x:Name="btn1" Content="Button" Margin="5" /> Button with name
check <CheckBox Content="CheckBox" IsChecked="True" Margin="5" /> CheckBox
check# <CheckBox x:Name="check1" Content="CheckBox" IsChecked="True" Margin="5" /> CheckBox with name
radio <RadioButton Content="RadioButton" IsChecked="True" Margin="5" /> RadioButton
radio# <RadioButton x:Name="radio1" Content="RadioButton" IsChecked="True" Margin="5" /> RadioButton with name
lbl <Label Content="Label" Margin="5" /> Label
tblk <TextBlock Text="TextBlock" Margin="5" /> TextBlock
tbx <TextBox Text="TextBox" Margin="5" /> TextBox
tbx# <TextBox x:Name="txt1" Text="TextBox" Margin="5" /> TextBox with name
lbl+tbx <Label Content="Item Name1" Margin="5,5,5,0" Padding="0" />
<TextBox Text="Item Value1" Margin="5,0,5,5" />
Label and TextBox
tblk+tbx <TextBlock Text="Item Name1" Margin="5,5,5,0" />
<TextBox Text="Item Value1" Margin="5,0,5,5" />
TextBlock and TextBox
list <ListBox ItemsSource="{}" SelectedIndex="0" Margin="5" /> ListBox
list# <ListBox x:Name="list1" ItemsSource="{}" SelectedIndex="0" Margin="5" /> ListBox with name
list>li <ListBox SelectedIndex="0" Margin="5">
<ListBoxItem Content="item1" />
</ListBox>
ListBox containing ListBoxItem
combo <ComboBox ItemsSource="{}" SelectedIndex="0" Margin="5" /> ComboBox
combo# <ComboBox x:Name="combo1" ItemsSource="{}" SelectedIndex="0" Margin="5" /> ComboBox with name
combo>ci <ComboBox SelectedIndex="0" Margin="5">
<ComboBoxItem Content="item1" />
</ComboBox>
ComboBox containing ComboBoxItem
border <Border BorderBrush="Black" BorderThickness="1" Height="100" Width="100" /> Border
rect <Rectangle Fill="LightGray" Height="100" Width="100" Stroke="Black" /> Rectangle
img <Image Source="image1.png" /> Image
rds <Grid.RowDefinitions></Grid.RowDefinitions> Grid RowDefinitions
cds <Grid.ColumnDefinitions></Grid.ColumnDefinitions> Grid ColumnDefinitions
grid <Grid></Grid> Grid
stack <StackPanel></StackPanel> StackPanel
stackh <StackPanel Orientation="Horizontal"></StackPanel> Horizontal StackPanel
wrap <WrapPanel></WrapPanel> WrapPanel
dock <DockPanel></DockPanel> DockPanel
stack>btn*3 <StackPanel>
<Button Content="Button1" Margin="5,5,5,0" />
<Button Content="Button2" Margin="5,5,5,0" />
<Button Content="Button3" Margin="5,5,5,0" />
</StackPanel>
StackPanel containing 3 Buttons
stackh>btn*3 <StackPanel Orientation="Horizontal">
<Button Content="Button1" Margin="5,5,0,5" />
<Button Content="Button2" Margin="5,5,0,5" />
<Button Content="Button3" Margin="5,5,0,5" />
</StackPanel>
Horizontal StackPanel containing 3 Buttons
rds>rd*2 <Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
2 rows Grid
rds>rd*3 <Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
3 rows Grid
cds>cd*2 <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
2 columns Grid
cds>cd*3 <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
3 columns Grid
style <Style TargetType="Button"></Style> Style
style# <Style x:Key="key1" TargetType="Button"></Style> Style with key
winres <Window.Resources></Window.Resources> Window Resources
pgres <Page.Resources></Page.Resources> Page Resources
ucres <UserControl.Resources></UserControl.Resources> UserControl Resources
menu <Menu></Menu> Menu
menu>mi <Menu>
<MenuItem Header="Item1" />
</Menu>
Menu containing MenuItem
cmenu <ContextMenu></ContextMenu> ContextMenu
cmenu>mi <ContextMenu>
<MenuItem Header="Item1" />
</ContextMenu>
ContextMenu containing MenuItem

FYR Visual Studio 2019 default snippets

Shortcut Insert code Description
#region <!--#region NewRegion -->
<!--#endregion-->
Collapsible XAML regions
ddc d:DataContext="{d:DesignInstance Type=local:MyViewModel, IsDesignTimeCreatable=True}" DataContext attribute at design time
rd <RowDefinition Height="1*" /> Grid row definition
cd <ColumnDefinition Width="1*" /> Grid column definition
set <Setter Property="Background" Value="Red" /> Setter
tag <Grid></Grid> Any tag

Reference link

For Visual Studio Code here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.