Nabend,
ich bekomm es gerade einfach nicht hin einen LabelText an eine Klasse zu binden.
Wieder aufgeräumt sieht der Test soweit aus.
XML:
Spoiler anzeigen
VB:
Spoiler anzeigen
Kann mir da wer helfen?
Danke und bleibt gesund!
ich bekomm es gerade einfach nicht hin einen LabelText an eine Klasse zu binden.
Wieder aufgeräumt sieht der Test soweit aus.
XML:
XML-Quellcode
- <Window x:Class="MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:WpfApp5"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <Grid>
- <Label Name="testlabel"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- FontSize="20"
- Content="{Binding test.CustomerName}"/>
- </Grid>
- </Window>
VB:
VB.NET-Quellcode
- Class MainWindow
- Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
- Test.CustomerName = "Hallo"
- End Sub
- End Class
- Public Class Test
- Private Shared customerNameValue As String
- Public Shared Property CustomerName() As String
- Get
- Return customerNameValue
- End Get
- Set(ByVal value As String)
- If Not (value = customerNameValue) Then
- customerNameValue = value
- End If
- End Set
- End Property
- End Class
Kann mir da wer helfen?
Danke und bleibt gesund!
In Arbeit...