xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Canvas_Positioning_Properties.Window1"
Title="Canvas Positioning Properties">
//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Imports System.Windows.Data
Namespace Canvas_Positioning_Properties
Public Partial Class Window1
Inherits Window
Public Sub ChangeLeft(sender As Object, args As SelectionChangedEventArgs)
Dim li As ListBoxItem = TryCast(TryCast(sender, ListBox).SelectedItem, ListBoxItem)
Dim myLengthConverter As New LengthConverter()
Dim db1 As [Double] = CType(myLengthConverter.ConvertFromString(li.Content.ToString()), [Double])
Canvas.SetLeft(text1, db1)
Console.WriteLine(myLengthConverter.ConvertToString(Canvas.GetLeft(text1)))
End Sub
End Class
End Namespace