Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Window x:Class="MvvmDemo.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:MvvmDemo"
- xmlns:vm="clr-namespace:MvvmDemo.ViewModel"
- mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
- <Window.Resources>
- <vm:CustomerViewModel x:Key="CustomerViewModel"></vm:CustomerViewModel>
- </Window.Resources>
- <Grid DataContext="{Binding Source ={StaticResource CustomerViewModel}}">
- <ListView HorizontalAlignment="Left" Height="316" Margin="0,94,-0.4,0" VerticalAlignment="Top" Width="794" ItemsSource="{Binding Customers}">
- <ListView.View>
- <GridView>
- <GridViewColumn Header="Id" DisplayMemberBinding="{Binding CustomerId}" Width="Auto"/>
- <GridViewColumn Header="CompanyName" DisplayMemberBinding="{Binding CompanyName}" Width="Auto"/>
- </GridView>
- </ListView.View>
- </ListView>
- <Button Content="Button" Command="{Binding GetCommand}" HorizontalAlignment="Left" Margin="75,42,0,0" VerticalAlignment="Top" Width="75"/>
- </Grid>
- </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement