A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
1.4 KiB

<Window xmlns="https://github.com/avaloniaui"
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
xmlns:sandbox="clr-namespace:Sandbox"
x:DataType="sandbox:MainViewModel"
x:Class="Sandbox.MainWindow">
<Window.DataContext>
<sandbox:MainViewModel />
</Window.DataContext>
<StackPanel>
<ComboBox MinWidth="100" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}"/>
<!--<Button Content="Set Property1 manually" Command="{Binding ButtonClick}"/>-->
<!--<TextBlock Text="TextBlock bound to the ComboBox SelectedItem" Margin="0,10,0,0"/>-->
<TextBlock Foreground="Black" TextAlignment="Right" Background="LightBlue" Margin="1" Text="{Binding SelectedItem, StringFormat='({0})'}"/>
<!--<TextBlock Margin="0,10,0,0" TextWrapping="Wrap" Foreground="WhiteSmoke">
TextBlock bound to the Property1 which get set: <LineBreak/>
-> To the <Span Foreground="Blue">value</Span> in the SelectedItem property Setter <LineBreak/>
-> To a string on ButtonClick
</TextBlock>
<TextBlock Foreground="Black" TextAlignment="Right" Background="LightBlue" Margin="1" Text="{Binding Property1, StringFormat='({0})'}"/>
<TextBlock TextAlignment="Right" Background="LightBlue" Margin="1" Foreground="Black">
SelectedItem = <Run Text="{Binding SelectedItem}" />
Property1 = <Run Text="{Binding Property1}" />
</TextBlock>-->
</StackPanel>
</Window>