Files
docs-desktop/dotnet-desktop-guide/net/wpf/properties/snippets/dependency-properties-overview/vb/MainWindow.xaml.vb
T
Tris ShoresandAndy De George 57b6ca1593 Content update - Dependency properties overview (user story 1878471) (#1160)
* Update article and code projects

* Further edits

* Fix links

* Relocate article & snippets to wpf/properties folder

* add toc and redirects

* Add acrolinx comment and make a minor edit.

* minor

Co-authored-by: Andy De George (adegeo) <[email protected]>
2021-09-27 13:53:44 -07:00

46 lines
1.3 KiB
VB.net

Namespace CodeSampleVb
Partial Public Class MainWindow
Inherits Window
Public Sub New()
InitializeComponent()
' <ProceduralPropertySet>
Dim myButton As New Button With {
.Width = 200.0
}
' </ProceduralPropertySet>
' <ProceduralPropertyGet>
Dim whatWidth As Double = myButton.Width
' </ProceduralPropertyGet>
End Sub
' <DefineDependencyProperty>
Public Shared ReadOnly IsSpinningProperty As DependencyProperty =
DependencyProperty.Register("IsSpinning", GetType(Boolean), GetType(MainWindow))
Public Property IsSpinning As Boolean
Get
Return GetValue(IsSpinningProperty)
End Get
Set(value As Boolean)
SetValue(IsSpinningProperty, value)
End Set
End Property
' </DefineDependencyProperty>
End Class
' <OverrideMetadata>
Public Class SpinnerControl
Inherits ItemsControl
Shared Sub New()
DefaultStyleKeyProperty.OverrideMetadata(GetType(SpinnerControl), New FrameworkPropertyMetadata(GetType(SpinnerControl)))
End Sub
End Class
' </OverrideMetadata>
End Namespace